public class SyntaxPackage extends SyntaxNode implements ParserLoader
ABBREV_DELIMITER, RESOURCE_PREFIX, VALUE_DELIMITER
KW_ACTION_NAME, KW_CLASS, KW_CONSTRAINTS_PARSER, KW_CONSTRAINTS_TYPE, KW_DEFAULT, KW_DESCRIPTION, KW_EXTENDS, KW_FLOATING, KW_HELP_TEXT, KW_HELP_TOPICS, KW_NAME, KW_PACKAGE, KW_PARAMETER, KW_PARAMETER_PARSER, KW_PRIORITY, KW_PROPERTY, KW_RESOURCES, KW_SUPER, KW_SYNTAX, KW_USAGE, KW_VALUE, KW_VALUE_TYPE, MAX_OCCURRENCES, MIN_OCCURRENCES, OPTIONAL
Modifier | Constructor and Description |
---|---|
protected |
SyntaxPackage()
Default constructor.
|
|
SyntaxPackage(Properties db,
Locale locale)
Constructs a new syntax package using the given properties.
|
Modifier and Type | Method and Description |
---|---|
void |
addNode(SyntaxNode node)
Adds the given node to the syntax package.
|
void |
addParser(TypedParser parser,
Class<?> parserInterface)
Registers the specified parser, using its type token, in the pool of
parsers that implement the specified interface.
|
SyntaxNode |
getNode(String name)
Get the named node using its fully qualified node name.
|
Map<String,SyntaxNode> |
getNodes()
Get a map of name/node bindings for all syntax nodes defined in this
package.
|
TypedParser |
getParser(String name,
Class<?> parserInterface)
Returns the parser with the specified name and from the specified
intefrace pool.
|
List<Syntax> |
getSyntaxes()
Get prioritized list of syntaxes (instances of
Syntax ) defined
within this package. |
error, getContainer, getDB, getDescription, getHelpText, getLocale, getName, getResourceBundle, getShortName, isFloating, matches, setDescription, setFloating, setHelpText, setName, setResourceBundle, toString, translate
protected SyntaxPackage()
public SyntaxPackage(Properties db, Locale locale)
db
- Properties containing definition of this node.locale
- Locale context for this node's attributes.public TypedParser getParser(String name, Class<?> parserInterface)
getParser
in interface ParserLoader
name
- Type token associated with this parser.parserInterface
- ConstraintsParser
or
ParameterParser
class object
that identifies the general interface pool.public void addParser(TypedParser parser, Class<?> parserInterface)
addParser
in interface ParserLoader
parser
- Class that implements the given parser interface and
should therefore be added to the corresponding poolparserInterface
- ConstraintsParser
or
ParameterParser
class object
that identifies the general interface pool.public List<Syntax> getSyntaxes()
Syntax
) defined
within this package.public Map<String,SyntaxNode> getNodes()
public void addNode(SyntaxNode node)
Syntax
then it will also be added, according to its priority to
the ordered list of syntaxes.node
- Syntax node to be added to this package.public SyntaxNode getNode(String name)
name
- Fully qualified node name.Copyright © 2015. All Rights Reserved.