us.bpsm.edn.parser
Class Parsers
- java.lang.Object
-
- us.bpsm.edn.parser.Parsers
-
public class Parsers extends java.lang.ObjectFactory methods for all things related toParser. Typical usage is as follows:- Ask
newParserConfigBuilder()for a newParser.Config.Builder. - Make any desired customizations. Primarily, this will mean using
Parser.Config.Builder.putTagHandler(Tag, TagHandler)to registerTagHandlers for any customTags used by your expected input documents. - Pass the resulting
Parser.ConfigtonewParser(Parser.Config)to create aParser. - Create one or more
Parseables usingnewParseable(CharSequence)ornewParseable(Readable). - Use
Parser.nextValue(Parseable)to get the edn values contained in your Parseables
- Ask
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static Parser.ConfigdefaultConfiguration()Return the default configuration.static ParseablenewParseable(java.lang.CharSequence cs)Create a newParseablewrapping the givenCharSequence.static ParseablenewParseable(java.lang.Readable r)Create a newParseablewrapping the givenReadable.static ParsernewParser(Parser.Config cfg)Return a Parser configured by the givenParser.Config.static Parser.Config.BuildernewParserConfigBuilder()Return a newParser.Config.Builder.
-
-
-
Method Detail
-
newParser
public static Parser newParser(Parser.Config cfg)
Return a Parser configured by the givenParser.Config.- Parameters:
cfg- The configuration of the Parser. Must not be null.- Returns:
- a Parser, never null.
-
newParseable
public static Parseable newParseable(java.lang.CharSequence cs)
Create a newParseablewrapping the givenCharSequence.The
Closeable.close()method of the resulting Parseable is a no-op.- Returns:
- a Parseable, never null.
-
newParseable
public static Parseable newParseable(java.lang.Readable r)
Create a newParseablewrapping the givenReadable.The
Closeable.close()method of the resulting Parseable closes therifris itself Closeable.
-
newParserConfigBuilder
public static Parser.Config.Builder newParserConfigBuilder()
Return a newParser.Config.Builder.- Returns:
- a new
Parser.Config.Builder, never null.
-
defaultConfiguration
public static Parser.Config defaultConfiguration()
Return the default configuration. This is equivalent tonewParserConfigBuilder().build().- Returns:
- a new
Parser.Config, never null.
-
-
DMelt 3.0 © DataMelt by jWork.ORG