public class SyntaxKeyword extends SyntaxNode
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 |
SyntaxKeyword()
Default constructor.
|
|
SyntaxKeyword(String tokens,
SyntaxNode container,
Locale locale)
Constructs a new syntax keyword from the given string set token.
|
Modifier and Type | Method and Description |
---|---|
StringSet |
getTokens()
Get the enclosed StringSet which defines valid values for this keyword.
|
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.
|
String |
toString()
Returns the string image of this node.
|
error, getContainer, getDB, getDescription, getHelpText, getLocale, getName, getResourceBundle, getShortName, isFloating, setDescription, setFloating, setHelpText, setName, setResourceBundle, translate
protected SyntaxKeyword()
public SyntaxKeyword(String tokens, SyntaxNode container, Locale locale)
tokens
- String set tokens delimited by pipe (|) character and
using asterisk (*) character as the abbreviation delimiter.container
- Node which contains this keyword definition.locale
- Locale context for this keyword node.public StringSet getTokens()
StringSet
instance that
defines valid values for this keyword.public String toString()
toString
in class SyntaxNode
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.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.SyntaxNode.matches(java.lang.String[], com.hp.util.syntax.Parameters, com.hp.util.syntax.Parameters, java.text.ParsePosition, java.text.ParsePosition, com.hp.util.syntax.SyntaxPosition, boolean)
Copyright © 2015. All Rights Reserved.