public class SyntaxParameter extends SyntaxNodeExtension
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 |
SyntaxParameter()
Default constructor.
|
|
SyntaxParameter(SyntaxNode node,
SyntaxNodeExtension parent,
ParserLoader parserLoader)
Constructs a new syntax node from the data in the given property db.
|
Modifier and Type | Method and Description |
---|---|
Constraints |
getConstraints()
Get the constraints object associated with this parameter.
|
ConstraintsParser |
getConstraintsParser()
Returns the parser associated with this syntax parameter.
|
Serializable |
getDefaultValue()
Returns the object representing the default value of the parameter.
|
ParameterParser |
getParser()
Returns the parser associated with this syntax parameter.
|
boolean |
matches(String[] args,
Parameters parameters,
Parameters committedParameters,
ParsePosition position,
ParsePosition start,
SyntaxPosition farthestMismatchPosition,
boolean indexParameters)
Returns true if the node matches the given arguments starting with the
specified position.
|
void |
setConstraints(Constraints constraints)
Returns the constraints object associated with this parameter.
|
void |
setConstraintsParser(ConstraintsParser constraintsParser)
Returns the parser associated with this syntax parameter.
|
void |
setParser(ParameterParser parser)
Sets the parser associated with this syntax parameter.
|
String |
toString()
Returns a simple string image of the syntax node.
|
getMaxOccurrences, getMinOccurrences, getParent
error, getContainer, getDB, getDescription, getHelpText, getLocale, getName, getResourceBundle, getShortName, isFloating, setDescription, setFloating, setHelpText, setName, setResourceBundle, translate
protected SyntaxParameter()
public SyntaxParameter(SyntaxNode node, SyntaxNodeExtension parent, ParserLoader parserLoader)
node
- originating syntax nodeparent
- parent syntax nodeparserLoader
- parser loader to be used for constraints and
parameter parserspublic Constraints getConstraints()
public ConstraintsParser getConstraintsParser()
public void setConstraintsParser(ConstraintsParser constraintsParser)
constraintsParser
- constraints parser to be used by this
parameterpublic ParameterParser getParser()
public void setParser(ParameterParser parser)
parser
- parameter parser for values of this parameterpublic void setConstraints(Constraints constraints)
constraints
- new effective constraints for values of this
parameterpublic Serializable getDefaultValue()
public boolean matches(String[] args, Parameters parameters, Parameters committedParameters, ParsePosition position, ParsePosition start, SyntaxPosition farthestMismatchPosition, boolean indexParameters)
farthestMismatchPosition
parameter will hold the index of
the farthest argument that failed to match and the reference to the
syntax node against which that match failed.
This base implementation always returns false.matches
in class SyntaxNode
args
- Command-line argument stringsparameters
- Parameter map into which this matching attempt should
accumulate its (String, Serializable) bindings.committedParameters
- Parameter map of (String, Serializable)
bindings that has been committed thus far through the entire syntax
matching process.position
- Position within the args, where this matching
attempt should start.start
- Position within the defined syntax, where this matching
attempt should start.farthestMismatchPosition
- The farthest position where mismatch
occured within this matching attempt.indexParameters
- flag indicating whether parameters contained
within this node should be added as indexed.public String toString()
SyntaxNode
toString
in class SyntaxNode
Copyright © 2016. All Rights Reserved.