| java.lang.Object de.susebox.jtopas.AbstractTokenizerProperties
All known Subclasses: de.susebox.jtopas.StandardTokenizerProperties,
Field Summary | |
protected int | _flags overall tokenizer flags. |
Method Summary | |
public void | addBlockComment(String start, String end) Registering a block comment. | public void | addBlockComment(String start, String end, Object companion) Registering a block comment. | public void | addBlockComment(String start, String end, Object companion, int flags) Registering a block comment. | public void | addBlockComment(String start, String end, Object companion, int flags, int flagMask) Registering a block comment with a set of flags and an associated flag mask. | public void | addKeyword(String keyword) Registering a keyword. | public void | addKeyword(String keyword, Object companion) Registering a keyword. | public void | addKeyword(String keyword, Object companion, int flags) Registering a keyword. | public void | addKeyword(String keyword, Object companion, int flags, int flagMask) Registering a keyword with a set of flags and an associated flag mask.. | public void | addLineComment(String lineComment) Registering a the starting sequence of a line comment. | public void | addLineComment(String lineComment, Object companion) Registering a the starting sequence of a line comment. | public void | addLineComment(String lineComment, Object companion, int flags) Registering a the starting sequence of a line comment. | public void | addLineComment(String lineComment, Object companion, int flags, int flagMask) Registering a line comment with a set of flags and an associated flag mask. | public void | addPattern(String pattern) Registering a pattern. | public void | addPattern(String pattern, Object companion) Registering a pattern with an associated object. | public void | addPattern(String pattern, Object companion, int flags) Registering a pattern with an associated object. | public void | addPattern(String pattern, Object companion, int flags, int flagMask) Registering a pattern with an associated object and explicitely given flags. | public void | addProperty(TokenizerProperty property) Registering a
TokenizerProperty . | public void | addSeparators(String separators) Adding new separators to the existing set.
Parameters: separators - additional separators for the separator set throws: IllegalArgumentException - when null is passed or incompleteranges are specified (e.g. | public void | addSpecialSequence(String specSeq) Registering a special sequence of characters. | public void | addSpecialSequence(String specSeq, Object companion) Registering a special sequence of characters. | public void | addSpecialSequence(String specSeq, Object companion, int flags) Registering a special sequence of characters. | public void | addSpecialSequence(String specSeq, Object companion, int flags, int flagMask) Registering a special sequence with a set of flags and an associated flag mask. | public void | addString(String start, String end, String escape) Registering a string description. | public void | addString(String start, String end, String escape, Object companion) Registering a the sequences that are used for string-like text parts. | public void | addString(String start, String end, String escape, Object companion, int flags) Registering a the sequences that are used for string-like text parts. | public void | addString(String start, String end, String escape, Object companion, int flags, int flagMask) Registering a string with a set of flags and an associated flag mask. | public void | addTokenizerPropertyListener(TokenizerPropertyListener listener) Registering a new
TokenizerPropertyListener . | public void | addWhitespaces(String whitespaces) Adding new whitespaces to the existing set.
Parameters: additional - whitespaces for the whitespace set throws: IllegalArgumentException - when null is passed or incompleteranges are specified (e.g. | public boolean | blockCommentExists(String start) Checks if the given block comment is known. | protected void | checkArgument(String arg, String name) Checking a string parameter on null or emptiness. | protected void | checkPropertyArgument(TokenizerProperty property) Checking a
TokenizerProperty parameter on null or missing nessecary
values. | abstract protected TokenizerProperty | doAddProperty(TokenizerProperty property) This method must be implemented by derived classes to register a
TokenizerProperty . | abstract protected TokenizerProperty | doGetProperty(int type, String startImage) This method must be implemented by derived classes to retrieve the
TokenizerProperty for the given image. | abstract protected TokenizerProperty | doRemoveProperty(TokenizerProperty property) This method must be implemented by derived classes to deregister a
TokenizerProperty . | abstract protected String | doSetSeparators(String separators) This method must be implemented by derived classes to set the given
simple separators. | abstract protected String | doSetWhitespaces(String whitespaces) This method must be implemented by derived classes to register the given
simple whitespaces. | public TokenizerProperty | getBlockComment(String start) Get the full description of a block comment property. | public Object | getBlockCommentCompanion(String start) Retrieving a certain block comment. | public TokenizerProperty | getKeyword(String keyword) Get the full description of a keyword property. | public Object | getKeywordCompanion(String keyword) Retrieving the companion of the given keyword. | public TokenizerProperty | getLineComment(String lineComment) Get the full description of a line comment property. | public Object | getLineCommentCompanion(String lineComment) Retrieving the associated object of a certain line comment. | public int | getParseFlags() See the method description in
TokenizerProperties . | public TokenizerProperty | getPattern(String pattern) Get the full description of a string property starting with the given
prefix. | public Object | getPatternCompanion(String pattern) Retrieving the information associated with a given pattern. | public TokenizerProperty | getSpecialSequence(String specSeq) Get the full description of a special sequence property. | public Object | getSpecialSequenceCompanion(String specSeq) Retrieving the companion of the given special sequence. | public TokenizerProperty | getString(String start) Get the full description of a string property. | public Object | getStringCompanion(String start) Retrieving the information associated with a certain string. | protected void | handleEvent(int type, String newValue, String oldValue) The method fires the nessecary events when whitespace or separator sets
change. | public boolean | isFlagSet(int flag) Returns true if a given flag is set in the current parse flags. | public boolean | isFlagSet(TokenizerProperty prop, int flag) Checks if a given flag (see the constants in
Flags ) is set for the
given
TokenizerProperty in the context of this TokenizerProperties
instance. | public boolean | keywordExists(String keyword) Checks if the given keyword is known to the Tokenizer . | public boolean | lineCommentExists(String lineComment) Checks if the give line comment is known. | protected void | notifyListeners(TokenizerPropertyEvent event) Notifying the registered listeners about a change in the properties. | public boolean | patternExists(String pattern) Checks if the given pattern is known to the parser. | public boolean | propertyExists(TokenizerProperty property) Checks if the given
TokenizerProperty is known. | public void | removeBlockComment(String start) Removing a certain block comment. | public void | removeKeyword(String keyword) Deregistering a keyword. | public void | removeLineComment(String lineComment) Removing a certain line comment. | public void | removePattern(String pattern) Removing a pattern. | public void | removeProperty(TokenizerProperty property) Deregistering a
TokenizerProperty from the store. | public void | removeSeparators(String separators) Removing separators from the existing set.
Parameters: separators - separating characters to remove from the separator set throws: IllegalArgumentException - when null is passed or incompleteranges are specified (e.g. | public void | removeSpecialSequence(String specSeq) Deregistering a special sequence from the parser. | public void | removeString(String start) Removing a string description. | public void | removeTokenizerPropertyListener(TokenizerPropertyListener listener) Removing a listener from the list of registered
TokenizerPropertyListener instances. | public void | removeWhitespaces(String whitespaces) Removing whitespaces from the existing set.
Parameters: whitespaces - whitespaces to remove from the whitespace set throws: IllegalArgumentException - when null is passed or incompleteranges are specified (e.g. | public void | setParseFlags(int flags) See the method description in
TokenizerProperties . | public void | setSeparators(String separators) Setting the separator character set of the tokenizer. | public void | setWhitespaces(String whitespaces) Setting the whitespace character set of the tokenizer. | public boolean | specialSequenceExists(String specSeq) Checks if the given special sequence is known to the Tokenizer . | public boolean | stringExists(String start) Checks if the given starting sequence of the string is known to the parser. |
_flags | protected int _flags(Code) | | overall tokenizer flags.
|
addBlockComment | public void addBlockComment(String start, String end) throws IllegalArgumentException(Code) | | Registering a block comment. See the method description in
TokenizerProperties .
Parameters: start - the starting sequence of the block comment Parameters: end - the finishing sequence of the block comment throws: IllegalArgumentException - when null or an empty string is passed for start / end sequence of the block comment |
addBlockComment | public void addBlockComment(String start, String end, Object companion) throws IllegalArgumentException(Code) | | Registering a block comment.
See the method description in
TokenizerProperties .
Parameters: start - the starting sequence of the block comment Parameters: end - the finishing sequence of the block comment Parameters: companion - information object associated with this block comment throws: IllegalArgumentException - when null or an empty string is passed for start / end sequence of the block comment |
addBlockComment | public void addBlockComment(String start, String end, Object companion, int flags) throws IllegalArgumentException(Code) | | Registering a block comment.
See the method description in
TokenizerProperties .
Parameters: start - the starting sequence of the block comment Parameters: end - the finishing sequence of the block comment Parameters: companion - information object associated with this block comment Parameters: flags - modification flags throws: IllegalArgumentException - when null or an empty string is passed for start / end sequence of the block comment |
addBlockComment | public void addBlockComment(String start, String end, Object companion, int flags, int flagMask) throws IllegalArgumentException(Code) | | Registering a block comment with a set of flags and an associated flag mask.
Parameters: start - the starting sequence of the block comment Parameters: end - the finishing sequence of the block comment Parameters: companion - information object associated with this block comment Parameters: flags - modification flags Parameters: flagMask - flags that have valid values in the parameter flags throws: IllegalArgumentException - when null or an empty stringis passed for keyword |
addKeyword | public void addKeyword(String keyword, Object companion, int flags, int flagMask) throws IllegalArgumentException(Code) | | Registering a keyword with a set of flags and an associated flag mask..
Parameters: keyword - keyword to register Parameters: companion - information object associated with this keyword Parameters: flags - modification flags Parameters: flagMask - flags that have valid values in the parameter flags throws: IllegalArgumentException - when null or an empty stringis passed for keyword |
addLineComment | public void addLineComment(String lineComment, Object companion) throws IllegalArgumentException(Code) | | Registering a the starting sequence of a line comment.
See the method description in
TokenizerProperties .
Parameters: lineComment - the starting sequence of a line comment Parameters: companion - the associated information throws: IllegalArgumentException - when null or an empty string is passed for start sequence of the line comment |
addLineComment | public void addLineComment(String lineComment, Object companion, int flags) throws IllegalArgumentException(Code) | | Registering a the starting sequence of a line comment.
See the method description in
TokenizerProperties .
Parameters: lineComment - the starting sequence of a line comment Parameters: companion - the associated information Parameters: flags - modification flags throws: IllegalArgumentException - when null or an empty string is passed for start sequence of the line comment |
addLineComment | public void addLineComment(String lineComment, Object companion, int flags, int flagMask) throws IllegalArgumentException(Code) | | Registering a line comment with a set of flags and an associated flag mask.
Parameters: lineComment - the starting sequence of a line comment Parameters: companion - the associated information Parameters: flags - modification flags Parameters: flagMask - flags that have valid values in the parameter flags throws: IllegalArgumentException - when null or an empty stringis passed for keyword |
addPattern | public void addPattern(String pattern, Object companion, int flags, int flagMask) throws IllegalArgumentException(Code) | | Registering a pattern with an associated object and explicitely given flags.
See the description of the
AbstractTokenizerProperties.addPattern(String) for details on pattern.
Parameters: pattern - the regular expression to be added Parameters: companion - information object associated with this keyword Parameters: flags - values for modification flags Parameters: flagMask - flags that have valid values in the parameter flags throws: IllegalArgumentException - when null or an empty patternis passed |
addSeparators | public void addSeparators(String separators) throws IllegalArgumentException(Code) | | Adding new separators to the existing set.
Parameters: separators - additional separators for the separator set throws: IllegalArgumentException - when null is passed or incompleteranges are specified (e.g. "a-" ) |
addSpecialSequence | public void addSpecialSequence(String specSeq, Object companion, int flags, int flagMask) throws IllegalArgumentException(Code) | | Registering a special sequence with a set of flags and an associated flag mask.
Parameters: specSeq - special sequence to register Parameters: companion - information object associated with this special sequence Parameters: flags - modification flags Parameters: flagMask - flags that have valid values in the parameter flags throws: IllegalArgumentException - when null or an empty stringis passed for keyword |
addString | public void addString(String start, String end, String escape, Object companion) throws IllegalArgumentException(Code) | | Registering a the sequences that are used for string-like text parts.
See the method description in
TokenizerProperties .
Parameters: start - the starting sequence of a string Parameters: end - the finishing sequence of a string Parameters: escape - the escape sequence inside the string Parameters: companion - the associated information throws: IllegalArgumentException - when null or an empty string is passed for start or end |
addString | public void addString(String start, String end, String escape, Object companion, int flags) throws IllegalArgumentException(Code) | | Registering a the sequences that are used for string-like text parts.
See the method description in
TokenizerProperties .
Parameters: start - the starting sequence of a string Parameters: end - the finishing sequence of a string Parameters: escape - the escape sequence inside the string Parameters: companion - the associated information Parameters: flags - modification flags throws: IllegalArgumentException - when null or an empty string is passed for start or end |
addString | public void addString(String start, String end, String escape, Object companion, int flags, int flagMask) throws IllegalArgumentException(Code) | | Registering a string with a set of flags and an associated flag mask.
Parameters: start - the starting sequence of a string Parameters: end - the finishing sequence of a string Parameters: escape - the escape sequence inside the string Parameters: companion - the associated information Parameters: flags - modification flags Parameters: flagMask - flags that have valid values in the parameter flags throws: IllegalArgumentException - when null or an empty stringis passed for keyword |
addWhitespaces | public void addWhitespaces(String whitespaces) throws IllegalArgumentException(Code) | | Adding new whitespaces to the existing set.
Parameters: additional - whitespaces for the whitespace set throws: IllegalArgumentException - when null is passed or incompleteranges are specified (e.g. "a-" ) |
blockCommentExists | public boolean blockCommentExists(String start)(Code) | | Checks if the given block comment is known.
See the method description in
TokenizerProperties .
Parameters: start - the starting sequence of the block comment true if the block comment is known, false otherwise |
doAddProperty | abstract protected TokenizerProperty doAddProperty(TokenizerProperty property)(Code) | | This method must be implemented by derived classes to register a
TokenizerProperty . When called, the given property
has already been checked for not being null or incomplete
(no leading image).
If the property to register is already known, perhaps with a different
type, different flags or a different companion, it is replaced and returned.
The notification of the registered
TokenizerPropertyListener is
done by this abstract class, the implementations must not do it themselves.
The method is called in a thread-safe way. That means only one thread can
enter the method at a given time.
Parameters: property - a non-null, complete token description the old, replaced property or null |
doGetProperty | abstract protected TokenizerProperty doGetProperty(int type, String startImage)(Code) | | This method must be implemented by derived classes to retrieve the
TokenizerProperty for the given image. When called, the given
image has already been checked for not being null .
According to the
TokenizerProperties interface specification of the
various get methods, this method must return null if there is
no property that matches the given image.
The method is called in a thread-safe way. That means only one thread can
enter the method at a given time.
Parameters: type - the type the returned property should have Parameters: startImage - the (starting) image the token description for the image or null |
doRemoveProperty | abstract protected TokenizerProperty doRemoveProperty(TokenizerProperty property)(Code) | | This method must be implemented by derived classes to deregister a
TokenizerProperty . When called, the given property
has already been checked for not being null or incomplete
(no leading image).
According to the
TokenizerProperties interface specification of the
TokenizerProperties.removeProperty method, this method does nothing
if the given property is unknown. In this case null is returned.
Otherwise the removed property is returned.
The notification of the registered
TokenizerPropertyListener is
done by this abstract class, the implementations must not do it themselves.
The method is called in a thread-safe way. That means only one thread can
enter the method at a given time.
Parameters: property - a non-null, complete token description the removed property or null |
doSetSeparators | abstract protected String doSetSeparators(String separators)(Code) | | This method must be implemented by derived classes to set the given
simple separators. When called, the calling method
AbstractTokenizerProperties.setSeparators has already ensured that the parameter is not
null (but empty) and uppercase if the
Flags.F_NO_CASE flag is set.
The method should return the old separator set. When first called, this
is the default separator set. It is ok to return null if the
old set is empty.
The notification of the registered
TokenizerPropertyListener is
done by this abstract class, the implementations must not do it themselves.
The method is called in a thread-safe way. That means only one thread can
enter the method at a given time.
Parameters: separators - the new separator set the old separator set |
doSetWhitespaces | abstract protected String doSetWhitespaces(String whitespaces)(Code) | | This method must be implemented by derived classes to register the given
simple whitespaces. When called, the calling method has already ensured that
the parameter is not null (but could be empty) and uppercase
if the
Flags.F_NO_CASE flag is set.
The method should return the old whitespace set. When first called, this
is the default whitespace set. It is ok to return null if the
old set is empty.
The notification of the registered
TokenizerPropertyListener is
done by this abstract class, the implementations must not do it themselves.
The method is called in a thread-safe way. That means only one thread can
enter the method at a given time.
Parameters: whitespaces - the new whitespace set the old whitespace set |
getLineCommentCompanion | public Object getLineCommentCompanion(String lineComment) throws IllegalArgumentException(Code) | | Retrieving the associated object of a certain line comment.
See the method description in
TokenizerProperties .
Parameters: lineComment - the starting sequence of the line comment the object associated with the line comment throws: IllegalArgumentException - when null or an empty string is passed for start sequence of the line comment |
handleEvent | protected void handleEvent(int type, String newValue, String oldValue)(Code) | | The method fires the nessecary events when whitespace or separator sets
change.
Parameters: type - token type Parameters: newValue - the newly set value Parameters: oldValue - the old value with case-sensitive handling |
isFlagSet | public boolean isFlagSet(int flag)(Code) | | Returns true if a given flag is set in the current parse flags.
If the parameter contains more than one bit the method returns only
true if all bits are set.
Parameters: flag - the flag to test true if all bits in flag are set. See Also: AbstractTokenizerProperties.setParseFlags |
isFlagSet | public boolean isFlagSet(TokenizerProperty prop, int flag) throws NullPointerException(Code) | | Checks if a given flag (see the constants in
Flags ) is set for the
given
TokenizerProperty in the context of this TokenizerProperties
instance.
Parameters: prop - the TokenizerProperty concerned Parameters: flag - the flag to check (may contain more than one bit) true if the flag is set either explicit in the propertyor globally for this TokenizerProperties object, false otherwise throws: NullPointerException - if no property is given |
keywordExists | public boolean keywordExists(String keyword)(Code) | | Checks if the given keyword is known to the Tokenizer .
See the method description in
TokenizerProperties .
Parameters: keyword - keyword to search true if the keyword is known,false otherwise |
lineCommentExists | public boolean lineCommentExists(String lineComment)(Code) | | Checks if the give line comment is known.
See the method description in
TokenizerProperties .
Parameters: lineComment - the starting sequence of the line comment true if the line comment is known, false otherwise |
patternExists | public boolean patternExists(String pattern)(Code) | | Checks if the given pattern is known to the parser.
See the method description in
TokenizerProperties .
Parameters: pattern - the regular expression to be looked for true if the pattern is registered, false otherwise |
removeSeparators | public void removeSeparators(String separators) throws IllegalArgumentException(Code) | | Removing separators from the existing set.
Parameters: separators - separating characters to remove from the separator set throws: IllegalArgumentException - when null is passed or incompleteranges are specified (e.g. "a-" ) |
removeWhitespaces | public void removeWhitespaces(String whitespaces) throws IllegalArgumentException(Code) | | Removing whitespaces from the existing set.
Parameters: whitespaces - whitespaces to remove from the whitespace set throws: IllegalArgumentException - when null is passed or incompleteranges are specified (e.g. "a-" ) |
specialSequenceExists | public boolean specialSequenceExists(String specSeq)(Code) | | Checks if the given special sequence is known to the Tokenizer .
See the method description in
TokenizerProperties .
Parameters: specSeq - sequence to check true if the block comment is known,false otherwise |
stringExists | public boolean stringExists(String start)(Code) | | Checks if the given starting sequence of the string is known to the parser.
See the method description in
TokenizerProperties .
Parameters: start - the starting sequence of a string true if the string is registered, false otherwise |
|
|