|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.japaki.self.SyntaxParser
public class SyntaxParser
Provides a parser for syntax definitions. The parser accepts the following patterns:
pattern description parser bean abcA constant in the in- or output stream. LeafParserConstantParserBean<property>Selects the parser based on the property type. LeafParserLeafParserBean<property,,"pattern">Selects the parser based on the property type and uses the pattern. LeafParserLeafParserBean<property,parserName>Uses the parser stored under parserName to parse the property. LeafParserLeafParserBean<property,parserName,"pattern">Uses the parser stored under parserName to parse the property and uses the pattern. LeafParserLeafParserBean<property,,subParser,delimiter>Parses a collection with the specified subparser. CollectionParserLeafParserBean<property,,subParser,delimiter>Parses a map with the specified subparser. MapParserLeafParserBean\nA line break. LineFeedFixedParserBeanparser1parser2parser3The parsers are used one after another. BeanParserBeanParserBean[parser]The parsers is only used if possible (if no exception is thrown). OptionalParserOptionalParserBean(parser1|parser2|parser3)Exactly one of the parsers is used. ChoiceParserChoiceParserBean
Constructor Summary protectedSyntaxParser()
Method Summary protected
<B,T extends B>
voidadd(String name, Parser<B> parser, Class<T> type)
Adds a parser to the parser storeprotected voidaddParsersToEntry(ArrayList<Parser<? super SinglePropertyBean<ParserBean>>> parsers)
Adds the parsers to the main choice parser.protected voidfillStore()
Adds the parser definitions of the syntax parser to the store.protected ParserStoregetParserStore()
Returns the underlying parser store.static Parser<BeanParserBean>getSyntaxParser()
Returns the main parser
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail SyntaxParser
protected SyntaxParser()
Method Detail getParserStore
protected final ParserStore getParserStore()
- Returns the underlying parser store.
- Returns:
- the underlying parser store
add
protected <B,T extends B> void add(String name, Parser<B> parser, Class<T> type)
- Adds a parser to the parser store
- Parameters:
name- seeParserStoreparser- seeParserStoretype- seeParserStore
fillStore
protected void fillStore()
- Adds the parser definitions of the syntax parser to the store.
addParsersToEntry
protected void addParsersToEntry(ArrayList<Parser<? super SinglePropertyBean<ParserBean>>> parsers)
- Adds the parsers to the main choice parser. this is the anchor for changes in subclasses.
- Parameters:
parsers- parsers that are options for an entry
getSyntaxParser
public static Parser<BeanParserBean> getSyntaxParser()
- Returns the main parser
- Returns:
- the main parser
Overview Package Class Tree Deprecated Index Help PREV CLASS NEXT CLASS FRAMES NO FRAMES SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD