Java Doc for TokenizerProperties.java in  » Parser » JTopas » de » susebox » jtopas » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Parser » JTopas » de.susebox.jtopas 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


de.susebox.jtopas.TokenizerProperties

All known Subclasses:   de.susebox.jtopas.StandardTokenizerProperties,  de.susebox.jtopas.AbstractTokenizerProperties,
TokenizerProperties
public interface TokenizerProperties (Code)

The interface TokenizerProperties declares constants and methods to maintain the characteristics of a Tokenizer , e. g. comments, keywords and special sequences. A TokenizerProperties implementation instance can be used by one or more Tokenizer instances.

A TokenizerProperties object that is used to parse Java or C code including line and column information, would be setup like this:

 TokenizerProperties props = new StandardTokenizerProperties();
 props.setParseFlags(Flags.F_COUNT_LINES);
 props.addLineComment("//");
 props.addBlockComment(TokenizerProperties.DEFAULT_BLOCK_COMMENT_START,
 TokenizerProperties.DEFAULT_BLOCK_COMMENT_END);
 props.addString("\"", "\"", "\\");
 props.addString("'", "'", "\\");
 props.addSpecialSequence(">>");
 props.addSpecialSequence("<<");
 props.addSpecialSequence("++");
 props.addSpecialSequence("--");
 ...
 props.addKeyword("class");
 props.addKeyword("if");
 props.addKeyword("then");
 props.addKeyword("while");
 props.addKeyword("do");
 ...
 

Beside the dedicated method groups for comments, strings, keywords and special sequences (e.g. TokenizerProperties.addKeyword , TokenizerProperties.removeKeyword and TokenizerProperties.keywordExists ) there is a set of generic methods working with TokenizerProperty objects:

When adding a property through one of the add... calls without the flags parameter, the currently active flags of the TokenizerProperties instance will be used for the property.

This interface is separated from the Tokenizer interface mainly to distinguish between the more static information, the actual source of data and the tokenizing process. Especially in multithreaded environments where multible instances of "equal" tokenizers are run at the same time, it saves both memory resources and setup effort to have one TokenizerProperties instance for all Tokenizer instances.

Beside its function as a store for lexical element descriptions, this interface also provides an event mechanism to notify all interested objects about changes (additions, modifications and removals) of such lexical element descriptions.

This interface partly replaces the older de.susebox.java.util.Tokenizer interface which is deprecated.


See Also:   Token
See Also:   Tokenizer
See Also:   TokenizerProperty
author:
   Heiko Blau


Field Summary
final public static  StringDEFAULT_BLOCK_COMMENT_END
     Default end sequence of a block comment (Java, C/C++).
final public static  StringDEFAULT_BLOCK_COMMENT_START
     Default starting sequence of a block comment (Java, C/C++).
final public static  StringDEFAULT_CHAR_END
     The well-known character ending sequence of C/C++, Java and other languages.
final public static  StringDEFAULT_CHAR_ESCAPE
     The well-known escape sequence for character literals in C/C++, Java and other languages.
final public static  StringDEFAULT_CHAR_START
     The well-known character starting sequence of C/C++, Java and other languages.
final public static  StringDEFAULT_LINE_COMMENT
    
final public static  StringDEFAULT_SEPARATORS
     Separators are otherwise not remarkable characters.
final public static  StringDEFAULT_STRING_END
     The well-known string ending sequence of C/C++, Java and other languages.
final public static  StringDEFAULT_STRING_ESCAPE
     The well-known escape sequence for strings in C/C++, Java and other languages.
final public static  StringDEFAULT_STRING_START
     The well-known string starting sequence " of C/C++, Java and other languages.
final public static  StringDEFAULT_WHITESPACES
     Whitespaces are portions of the text, that contain one or more characters that separate the significant parts of the text.


Method Summary
public  voidaddBlockComment(String start, String end)
     Registering a block comment with the parser.
public  voidaddBlockComment(String start, String end, Object companion)
     Registering a block comment with the parser.
public  voidaddBlockComment(String start, String end, Object companion, int flags)
     Registering a block comment.
public  voidaddBlockComment(String start, String end, Object companion, int flags, int flagMask)
     Registering a block comment with a set of flags and an associated flag mask.
The method is an extension to TokenizerProperties.addBlockComment(String,String,Object,int) having a bitmask for the flags that are explicitely specified for the block comment property.
public  voidaddKeyword(String keyword)
     Registering a keyword.
public  voidaddKeyword(String keyword, Object companion)
     Registering a keyword.
public  voidaddKeyword(String keyword, Object companion, int flags)
     Registering a keyword.
public  voidaddKeyword(String keyword, Object companion, int flags, int flagMask)
     Registering a keyword with a set of flags and an associated flag mask..
The method is an extension to TokenizerProperties.addKeyword(String,Object,int) having a bitmask for the flags that are explicitely specified for the pattern property.
public  voidaddLineComment(String lineComment)
     Registering a the starting sequence of a line comment.
public  voidaddLineComment(String lineComment, Object companion)
     Registering a the starting sequence of a line comment.
public  voidaddLineComment(String lineComment, Object companion, int flags)
     Registering a the starting sequence of a line comment.
public  voidaddLineComment(String lineComment, Object companion, int flags, int flagMask)
     Registering a line comment with a set of flags and an associated flag mask.
The method is an extension to TokenizerProperties.addLineComment(String,Object,int) having a bitmask for the flags that are explicitely specified for the block comment property.
public  voidaddPattern(String pattern)
     Registering a pattern.
public  voidaddPattern(String pattern, Object companion)
     Registering a pattern with an associated object.
public  voidaddPattern(String pattern, Object companion, int flags)
     Registering a pattern with an associated object.
public  voidaddPattern(String pattern, Object companion, int flags, int flagMask)
     Registering a pattern with an associated object and explicitely given flags. See the description of the TokenizerProperties.addPattern(String) for details on pattern.
The method is an extension to TokenizerProperties.addPattern(String,Object,int) having a bitmask for the flags that are specified for the pattern property.
public  voidaddProperty(TokenizerProperty property)
     Registering a TokenizerProperty .
public  voidaddSeparators(String separators)
     Adding new separators to the existing set.
public  voidaddSpecialSequence(String specSeq)
     Registering a special sequence of characters.
public  voidaddSpecialSequence(String specSeq, Object companion)
     Registering a special sequence of characters.
public  voidaddSpecialSequence(String specSeq, Object companion, int flags)
     Registering a special sequence of characters.
public  voidaddSpecialSequence(String specSeq, Object companion, int flags, int flagMask)
     Registering a special sequence with a set of flags and an associated flag mask.
The method is an extension to TokenizerProperties.addSpecialSequence(String,Object,int) having a bitmask for the flags that are explicitely specified for the special sequence property.
public  voidaddString(String start, String end, String escape)
     Registering a string description.
public  voidaddString(String start, String end, String escape, Object companion)
     Registering a the sequences that are used for string-like text parts. This method supports also an information associated with the string, called the companion.
If the given string starting sequence is already known to the parser, it will simply be re-registered.
public  voidaddString(String start, String end, String escape, Object companion, int flags)
     Registering a the sequences that are used for string-like text parts. This method supports also an information associated with the string, called the companion.
If the given string starting sequence is already known to the parser, it will simply be re-registered.
public  voidaddString(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.
The method is an extension to TokenizerProperties.addString(String,Object,int) having a bitmask for the flags that are explicitely specified for the block comment property.
public  voidaddTokenizerPropertyListener(TokenizerPropertyListener listener)
     Registering a new TokenizerPropertyListener .
public  voidaddWhitespaces(String whitespaces)
     Adding new whitespaces to the existing set.
public  booleanblockCommentExists(String start)
     Checks if the give block comment is known.
public  TokenizerPropertygetBlockComment(String start)
     Get the full description of a block comment property starting with the given prefix.
public  ObjectgetBlockCommentCompanion(String start)
     Retrieving a certain block comment.
public  IteratorgetBlockComments()
     This method returns an java.util.Iterator of TokenizerProperty objects.
public  TokenizerPropertygetKeyword(String keyword)
     Get the full description of a keyword property.
public  ObjectgetKeywordCompanion(String keyword)
     Retrieving the companion of the given special sequence.
public  IteratorgetKeywords()
     This method returns an java.util.Iterator of TokenizerProperty objects.
public  TokenizerPropertygetLineComment(String lineComment)
     Get the full description of a line comment property starting with the given prefix.
public  ObjectgetLineCommentCompanion(String lineComment)
     Retrieving the associated object of a certain line comment.
public  IteratorgetLineComments()
     This method returns an java.util.Iterator of TokenizerProperty objects.
public  intgetParseFlags()
     Retrieving the parser control flags.
public  TokenizerPropertygetPattern(String pattern)
     Get the full description of a pattern property.
public  ObjectgetPatternCompanion(String pattern)
     Retrieving the information associated with a given pattern.
public  IteratorgetPatterns()
     This method returns an java.util.Iterator of TokenizerProperty objects.
public  IteratorgetProperties()
     This method returns an java.util.Iterator of TokenizerProperty objects.
public  StringgetSeparators()
     Obtaining the separator set of the TokenizerProperties.
public  TokenizerPropertygetSpecialSequence(String specSeq)
     Get the full description of a special sequence property.
public  ObjectgetSpecialSequenceCompanion(String specSeq)
     Retrieving the companion of the given special sequence.
public  IteratorgetSpecialSequences()
     This method returns an java.util.Iterator of TokenizerProperty objects.
public  TokenizerPropertygetString(String start)
     Get the full description of a string property starting with the given prefix.
public  ObjectgetStringCompanion(String start)
     Retrieving the information associated with a certain string.
public  IteratorgetStrings()
     This method returns an java.util.Iterator of TokenizerProperty objects.
public  StringgetWhitespaces()
     Obtaining the whitespace character set.
public  booleanisFlagSet(int flag)
     Returns true if a given flag is set in the current parse flags.
public  booleanisFlagSet(TokenizerProperty prop, int flag)
     Checks if a given flag (see Flags ) is set for the given TokenizerProperty in the context of this TokenizerProperties instance.
The method uses the flag state of the TokenizerProperty object if it is contained in the flag mask of the property (see TokenizerProperty.containsFlag ). Otherwise it falls back to the flag state set globally for this TokenizerProperties instance.
public  booleankeywordExists(String keyword)
     Checks if the given keyword is known to the TokenizerProperties.
public  booleanlineCommentExists(String lineComment)
     Checks if the give line comment is known.
public  booleanpatternExists(String pattern)
     Checks if the given pattern is known to the parser.
public  booleanpropertyExists(TokenizerProperty property)
     Checks if the given TokenizerProperty is known to this TokenizerProperties instance.
public  voidremoveBlockComment(String start)
     Removing a certain block comment.
public  voidremoveKeyword(String keyword)
     Removing a keyword property from the store.
public  voidremoveLineComment(String lineComment)
     Removing a certain line comment.
public  voidremovePattern(String pattern)
     Removing a pattern.
public  voidremoveProperty(TokenizerProperty property)
     Deregistering a TokenizerProperty from the store.
public  voidremoveSeparators(String separators)
     Removing separators from the existing set.
public  voidremoveSpecialSequence(String specSeq)
     Removing a special sequence property from the store.
public  voidremoveString(String start)
     Removing a string description.
public  voidremoveTokenizerPropertyListener(TokenizerPropertyListener listener)
     Removing a listener from the list of registered TokenizerPropertyListener instances.
public  voidremoveWhitespaces(String whitespaces)
     Removing whitespaces from the existing set.
public  voidsetParseFlags(int flags)
     Setting the control flags of the TokenizerProperties.
public  voidsetSeparators(String separators)
     Setting the separator set.
public  voidsetWhitespaces(String whitespaces)
     Setting the whitespace character set of the tokenizer.
public  booleanspecialSequenceExists(String specSeq)
     Checks if the given special sequence is known to the TokenizerProperties.
public  booleanstringExists(String start)
     Checks if the given starting sequence of the string is known to the parser. The method accepts both empty and null strings for start by returning false.
Note that there is no choice of parsing flags (different to the TokenizerProperties.addString(String,String,String,Object,int) method), since it makes generally no sense to "overload" properties.

Field Detail
DEFAULT_BLOCK_COMMENT_END
final public static String DEFAULT_BLOCK_COMMENT_END(Code)
Default end sequence of a block comment (Java, C/C++).



DEFAULT_BLOCK_COMMENT_START
final public static String DEFAULT_BLOCK_COMMENT_START(Code)
Default starting sequence of a block comment (Java, C/C++).



DEFAULT_CHAR_END
final public static String DEFAULT_CHAR_END(Code)
The well-known character ending sequence of C/C++, Java and other languages.



DEFAULT_CHAR_ESCAPE
final public static String DEFAULT_CHAR_ESCAPE(Code)
The well-known escape sequence for character literals in C/C++, Java and other languages.



DEFAULT_CHAR_START
final public static String DEFAULT_CHAR_START(Code)
The well-known character starting sequence of C/C++, Java and other languages.



DEFAULT_LINE_COMMENT
final public static String DEFAULT_LINE_COMMENT(Code)
Default line comment seqence (Java, C++)



DEFAULT_SEPARATORS
final public static String DEFAULT_SEPARATORS(Code)
Separators are otherwise not remarkable characters. An opening parenthesis might be nessecary for a syntactically correct text, but without any special meaning to the compiler, interpreter etc. after it has been detected.
The value of this constant includes all printable characters that are not alphanumeric and not whitespaces. Note, that adding one of the separator characters as a special sequence ( TokenizerProperties.addSpecialSequence ) takes precedence.



DEFAULT_STRING_END
final public static String DEFAULT_STRING_END(Code)
The well-known string ending sequence of C/C++, Java and other languages.



DEFAULT_STRING_ESCAPE
final public static String DEFAULT_STRING_ESCAPE(Code)
The well-known escape sequence for strings in C/C++, Java and other languages.



DEFAULT_STRING_START
final public static String DEFAULT_STRING_START(Code)
The well-known string starting sequence " of C/C++, Java and other languages.



DEFAULT_WHITESPACES
final public static String DEFAULT_WHITESPACES(Code)
Whitespaces are portions of the text, that contain one or more characters that separate the significant parts of the text. Generally, a sequence of whitespaces is equally represented by one single whitespace character. That is the difference to separators.
The value of this constant contains the ASCII characters space, tab, carriage return and linefeed.





Method Detail
addBlockComment
public void addBlockComment(String start, String end) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registering a block comment with the parser. This version takes only the starting and finishing sequence of the block comment.
If the given starting sequence is already known to the parser, the block comment is simply re-registered. Using this method on a known block comment with an associated companion will remove that companion.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_ADDED to all registered listeners (see TokenizerProperties.addTokenizerPropertyListener ) with the new block comment TokenizerProperty if the comment is a new one, or of type TokenizerPropertyEvent.PROPERTY_MODIFIED if the comment is re-registered.
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 stringis passed for start or end
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface
See Also:   TokenizerProperties.addBlockComment(String,String,Object)
See Also:   TokenizerProperties.addBlockComment(String,String,Object,int)
See Also:   TokenizerProperties.removeBlockComment



addBlockComment
public void addBlockComment(String start, String end, Object companion) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registering a block comment with the parser. Beside the obviously nessecary starting and finishing sequence of the block comment, it takes an object that is associated with the block comment, called the companion.
If the given starting sequence is already known to the parser, the block comment is simply re-registered. Using this method on a known block comment with an associated companion will replace that companion against the given one.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_ADDED to all registered listeners (see TokenizerProperties.addTokenizerPropertyListener ) with the new block comment TokenizerProperty if the comment is a new one, or of type TokenizerPropertyEvent.PROPERTY_MODIFIED if the comment is re-registered.
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 stringis passed for start or end
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface
See Also:   TokenizerProperties.addBlockComment(String,String)
See Also:   TokenizerProperties.addBlockComment(String,String,Object,int)
See Also:   TokenizerProperties.removeBlockComment



addBlockComment
public void addBlockComment(String start, String end, Object companion, int flags) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registering a block comment. Beside the obviously nessecary starting and finishing sequence of the block comment, it takes an object that is associated with the block comment, called the companion.
If the given starting sequence is already known to the parser, the block comment is simply re-registered. Using this method on a known block comment with an associated companion will replace that companion against the given one.
This version of addBlockComment supports a bitmask of the Flags to modify the general tokenizer settings (see TokenizerProperties.setParseFlags ) for this special element.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_ADDED to all registered listeners (see TokenizerProperties.addTokenizerPropertyListener ) with the new block comment TokenizerProperty if the comment is a new one, or of type TokenizerPropertyEvent.PROPERTY_MODIFIED if the comment is re-registered.
A call to this method is equivalent to addBlockComment(start, end, companion, flags, flags).
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 stringis passed for start or end
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface
See Also:   TokenizerProperties.addBlockComment(String,String)
See Also:   TokenizerProperties.addBlockComment(String,String,Object)
See Also:   TokenizerProperties.addBlockComment(String,String,Object,int,int)
See Also:   TokenizerProperties.removeBlockComment



addBlockComment
public void addBlockComment(String start, String end, Object companion, int flags, int flagMask) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registering a block comment with a set of flags and an associated flag mask.
The method is an extension to TokenizerProperties.addBlockComment(String,String,Object,int) having a bitmask for the flags that are explicitely specified for the block comment property. All other flag values (states) should be taken from the TokenizerProperty instance or from the Tokenizer .
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
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface
See Also:   TokenizerProperties.addBlockComment(String,String)
See Also:   TokenizerProperties.addBlockComment(String,String,Object)
See Also:   TokenizerProperties.addBlockComment(String,String,Object,int)
See Also:   TokenizerProperties.removeBlockComment



addKeyword
public void addKeyword(String keyword) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registering a keyword. If the keyword is already known to the TokenizerProperties then it is simply re-registered. If the known keyword has an associated companion it will be removed.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_ADDED to all registered listeners (see TokenizerProperties.addTokenizerPropertyListener ) with the new keyword TokenizerProperty if the keyword is a new one, or of type TokenizerPropertyEvent.PROPERTY_MODIFIED if the keyword is re-registered.
Parameters:
  keyword - keyword to register
throws:
  IllegalArgumentException - when null or an empty stringis passed
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface
See Also:   TokenizerProperties.addKeyword(String,Object)
See Also:   TokenizerProperties.addKeyword(String,Object,int)
See Also:   TokenizerProperties.removeKeyword



addKeyword
public void addKeyword(String keyword, Object companion) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registering a keyword. If the keyword is already known to the TokenizerProperties then it is simply re-registered. If the known keyword has an associated companion it will be replaced against the given one.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_ADDED to all registered listeners (see TokenizerProperties.addTokenizerPropertyListener ) with the new keyword TokenizerProperty if the keyword is a new one, or of type TokenizerPropertyEvent.PROPERTY_MODIFIED if the keyword is re-registered.
Parameters:
  keyword - keyword to register
Parameters:
  companion - information object associated with this keyword
throws:
  IllegalArgumentException - when null or an empty stringis passed for keyword
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface
See Also:   TokenizerProperties.addKeyword(String)
See Also:   TokenizerProperties.addKeyword(String,Object,int)
See Also:   TokenizerProperties.removeKeyword



addKeyword
public void addKeyword(String keyword, Object companion, int flags) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registering a keyword. If the keyword is already known to the TokenizerProperties then it is simply re-registered. If the known keyword has an associated companion it will be replaced against the given one.
This version of addKeyword supports a bitmask of the Flags to modify the general tokenizer settings (see TokenizerProperties.setParseFlags ) for this special element.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_ADDED to all registered listeners (see TokenizerProperties.addTokenizerPropertyListener ) with the new keyword TokenizerProperty if the keyword is a new one, or of type TokenizerPropertyEvent.PROPERTY_MODIFIED if the keyword is re-registered.
A call to this method is equivalent to addKeyword(keyword, companion, flags, flags).
Parameters:
  keyword - keyword to register
Parameters:
  companion - information object associated with this keyword
Parameters:
  flags - modification flags
throws:
  IllegalArgumentException - when null or an empty stringis passed for keyword
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface
See Also:   TokenizerProperties.addKeyword(String)
See Also:   TokenizerProperties.addKeyword(String,Object)
See Also:   TokenizerProperties.removeKeyword



addKeyword
public void addKeyword(String keyword, Object companion, int flags, int flagMask) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registering a keyword with a set of flags and an associated flag mask..
The method is an extension to TokenizerProperties.addKeyword(String,Object,int) having a bitmask for the flags that are explicitely specified for the pattern property. All other flag values (states) should be taken from the TokenizerProperty instance or from the Tokenizer .
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
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface
See Also:   TokenizerProperties.addKeyword(String)
See Also:   TokenizerProperties.addKeyword(String,Object)
See Also:   TokenizerProperties.removeKeyword



addLineComment
public void addLineComment(String lineComment) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registering a the starting sequence of a line comment. The line comment is a special type of whitespace. It starts with the given character sequence and contains all characters up to and including the next end-of-line character(s).
Although most languages have only one line comment sequence, it is possible to use more than one.
If the given line comment starting sequence is already known to the parser, it will simply be re-registered. Using this method on a known line comment with an associated companion will effectively remove the companion.
Parameters:
  lineComment - the starting sequence of the line comment
throws:
  IllegalArgumentException - when null or an empty stringis passed
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface
See Also:   TokenizerProperties.addLineComment(String,Object)
See Also:   TokenizerProperties.addLineComment(String,Object,int)
See Also:   TokenizerProperties.removeLineComment



addLineComment
public void addLineComment(String lineComment, Object companion) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registering a the starting sequence of a line comment. The line comment is a special type of whitespace. It starts with the given character sequence and contains all characters up to and including the next end-of-line character(s).
Although most languages have only one line comment sequence, it is possible to use more than one.
This method supports also an information associated with the line comment, called the companion.
If the given line comment starting sequence is already known to the parser, it will simply be re-registered. Using this method on a known line comment with an associated companion will replace that companion against the given one.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_ADDED to all registered listeners (see TokenizerProperties.addTokenizerPropertyListener ) with the new line comment TokenizerProperty if the line comment is a new one, or of type TokenizerPropertyEvent.PROPERTY_MODIFIED if the line comment is re-registered.
Parameters:
  lineComment - the starting sequence of a line comment
Parameters:
  companion - the associated information
throws:
  IllegalArgumentException - when null or an empty stringis passed for lineComment
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface
See Also:   TokenizerProperties.addLineComment(String)
See Also:   TokenizerProperties.addLineComment(String,Object,int)
See Also:   TokenizerProperties.removeLineComment



addLineComment
public void addLineComment(String lineComment, Object companion, int flags) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registering a the starting sequence of a line comment. The line comment is a special type of whitespace. It starts with the given character sequence and contains all characters up to and including the next end-of-line character(s).
Although most languages have only one line comment sequence, it is possible to use more than one.
This method supports also an information associated with the line comment, called the companion.
If the given line comment starting sequence is already known to the parser, it will simply be re-registered. Using this method on a known line comment with an associated companion will replace that companion against the given one.
This version of addLineComment supports a bitmask of the Flags to modify the general tokenizer settings (see TokenizerProperties.setParseFlags ) for this special element.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_ADDED to all registered listeners (see TokenizerProperties.addTokenizerPropertyListener ) with the new line comment TokenizerProperty if the line comment is a new one, or of type TokenizerPropertyEvent.PROPERTY_MODIFIED if the line comment is re-registered.
A call to this method is equivalent to addLineComment(lineComment, companion, flags, flags).
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 stringis passed for lineComment
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface
See Also:   TokenizerProperties.addLineComment(String)
See Also:   TokenizerProperties.addLineComment(String,Object)
See Also:   TokenizerProperties.addLineComment(String,Object,int,int)
See Also:   TokenizerProperties.removeLineComment



addLineComment
public void addLineComment(String lineComment, Object companion, int flags, int flagMask) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registering a line comment with a set of flags and an associated flag mask.
The method is an extension to TokenizerProperties.addLineComment(String,Object,int) having a bitmask for the flags that are explicitely specified for the block comment property. All other flag values (states) should be taken from the TokenizerProperty instance or from the Tokenizer .
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
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface
See Also:   TokenizerProperties.addLineComment(String)
See Also:   TokenizerProperties.addLineComment(String,Object)
See Also:   TokenizerProperties.addLineComment(String,Object,int)
See Also:   TokenizerProperties.removeLineComment



addPattern
public void addPattern(String pattern) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registering a pattern. Pattern can describe identifiers, numbers etc. They provide a way to deal with token that cannot be enumerated like keywords.
A pattern is usually a regular expression that is used by java.util.regex.Pattern . But implementations of de.susebox.jtopas.spi.PatternHandler may use other pattern syntaxes, for example the simpler syntax used for file path matching.
Pattern are applied to input data in the order of their registration. The first matching pattern stops the iteration.
Pattern matching is a rather complex operation that may have a significant impact on the speed of a Tokenizer . On the other hand, pattern may be used instead of string or comment descriptions (see TokenizerProperties.addString etc.) or if a pattern matching would be performed after the return of a token of type Token.NORMAL .
If the given pattern is already known to the parser, it will simply be re-registered. Using this method on a known pattern with an associated companion will remove that companion.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_ADDED to all registered listeners (see TokenizerProperties.addTokenizerPropertyListener ) with the new pattern TokenizerProperty if the pattern is a new one, or of type TokenizerPropertyEvent.PROPERTY_MODIFIED if the pattern is re-registered.
Parameters:
  pattern - the regular expression to be added
throws:
  IllegalArgumentException - when null or an empty patternis passed
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface
See Also:   TokenizerProperties.removePattern
See Also:   TokenizerProperties.addPattern(String,Object)
See Also:   TokenizerProperties.addPattern(String,Object,int)



addPattern
public void addPattern(String pattern, Object companion) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registering a pattern with an associated object. See the description of the TokenizerProperties.addPattern(String) for details on pattern.
If the given pattern is already known to the parser, it will simply be re-registered. The associated companion will be replaced against the new one.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_ADDED to all registered listeners (see TokenizerProperties.addTokenizerPropertyListener ) with the new pattern TokenizerProperty if the pattern is a new one, or of type TokenizerPropertyEvent.PROPERTY_MODIFIED if the pattern is re-registered.
Parameters:
  pattern - the regular expression to be added
Parameters:
  companion - information object associated with this pattern
throws:
  IllegalArgumentException - when null or an empty patternis passed
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface
See Also:   TokenizerProperties.removePattern
See Also:   TokenizerProperties.addPattern(String)
See Also:   TokenizerProperties.addPattern(String,Object,int)



addPattern
public void addPattern(String pattern, Object companion, int flags) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registering a pattern with an associated object. See the description of the TokenizerProperties.addPattern(String) for details on pattern.
If the given pattern is already known to the parser, it will simply be re-registered. The associated companion will be replaced against the new one.
This version of addPattern supports a bitmask of the Flags to modify the general tokenizer settings (see TokenizerProperties.setParseFlags ) for this special pattern.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_ADDED to all registered listeners (see TokenizerProperties.addTokenizerPropertyListener ) with the new pattern TokenizerProperty if the pattern is a new one, or of type TokenizerPropertyEvent.PROPERTY_MODIFIED if the pattern is re-registered.
A call to this method is equivalent to addPattern(pattern, companion, flags, flags).
Parameters:
  pattern - the regular expression to be added
Parameters:
  companion - information object associated with this keyword
Parameters:
  flags - modification flags
throws:
  IllegalArgumentException - when null or an empty patternis passed
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface
See Also:   TokenizerProperties.removePattern
See Also:   TokenizerProperties.addPattern(String)
See Also:   TokenizerProperties.addPattern(String,Object)



addPattern
public void addPattern(String pattern, Object companion, int flags, int flagMask) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registering a pattern with an associated object and explicitely given flags. See the description of the TokenizerProperties.addPattern(String) for details on pattern.
The method is an extension to TokenizerProperties.addPattern(String,Object,int) having a bitmask for the flags that are specified for the pattern property. All other flag values (states) should be taken from the TokenizerProperty instance or from the Tokenizer .
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
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface
See Also:   TokenizerProperties.removePattern
See Also:   TokenizerProperties.addPattern(String)
See Also:   TokenizerProperties.addPattern(String,Object)
See Also:   TokenizerProperties.addPattern(String,Object,int)



addProperty
public void addProperty(TokenizerProperty property) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registering a TokenizerProperty . This can be a keyword, comment etc., even whitespaces, separators and property types not defined in Token .
If the property is already known to this TokenizerProperties instance then it is simply re-registered.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_ADDED or TokenizerPropertyEvent.PROPERTY_MODIFIED to all registered listeners (see TokenizerProperties.addTokenizerPropertyListener ).
An implementation of this interface may or may not support adding of whitespaces and separators.
Parameters:
  property - property to register
throws:
  IllegalArgumentException - when null, an incomplete or otherwise unusable property is passed
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface



addSeparators
public void addSeparators(String separators) throws IllegalArgumentException(Code)
Adding new separators to the existing set. This is a convenience method to complete the separator set without having to include the already known separators (for instance the TokenizerProperties.DEFAULT_SEPARATORS set).
Separators that are already known, are ignored (the new separators are "merged" into the known set).
For more information see TokenizerProperties.setSeparators .
Parameters:
  separators - additional set of separating characters
throws:
  IllegalArgumentException - when null is passed or incompleteranges are specified (e.g. "a-")
See Also:   TokenizerProperties.getSeparators
See Also:   TokenizerProperties.setSeparators
See Also:   TokenizerProperties.removeSeparators



addSpecialSequence
public void addSpecialSequence(String specSeq) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registering a special sequence of characters. Such sequences may be multicharacter operators like the shift operators in Java.
Unlike keywords, special sequences act also as separators between other tokens. If one special sequence is the prefix of other special sequences (in Java the shift operator >> is the prefix of the shift operator >>>), always the longest possible match is returned. Testing on special sequences takes place after whitespaces and comments are ruled out, but before ordinary separators are tested.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_ADDED to all registered listeners (see TokenizerProperties.addTokenizerPropertyListener ) with the new special sequence TokenizerProperty if the sequence is a new one, or of type TokenizerPropertyEvent.PROPERTY_MODIFIED if the sequence is re-registered.
Parameters:
  specSeq - special sequence to register
throws:
  IllegalArgumentException - when null or an empty stringis passed
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface
See Also:   TokenizerProperties.addSpecialSequence(String,Object)
See Also:   TokenizerProperties.addSpecialSequence(String,Object,int)
See Also:   TokenizerProperties.removeSpecialSequence



addSpecialSequence
public void addSpecialSequence(String specSeq, Object companion) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registering a special sequence of characters. Such sequences may be multicharacter operators like the shift operators in Java.
Unlike keywords, special sequences act also as separators between other tokens. If one special sequence is the prefix of other special sequences (in Java the shift operator >> is the prefix of the shift operator >>>), always the longest possible match is returned. Testing on special sequences takes place after whitespaces and comments are ruled out, but before ordinary separators are tested. This form of addSpecialSequence also takes an object associated with the special sequence, called the companion.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_ADDED to all registered listeners (see TokenizerProperties.addTokenizerPropertyListener ) with the new special sequence TokenizerProperty if the sequence is a new one, or of type TokenizerPropertyEvent.PROPERTY_MODIFIED if the sequence is re-registered.
Parameters:
  specSeq - special sequence to register
Parameters:
  companion - information object associated with this special sequence
throws:
  IllegalArgumentException - when null or an empty stringis passed for specSeq
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface
See Also:   TokenizerProperties.addSpecialSequence(String)
See Also:   TokenizerProperties.addSpecialSequence(String,Object,int)
See Also:   TokenizerProperties.removeSpecialSequence



addSpecialSequence
public void addSpecialSequence(String specSeq, Object companion, int flags) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registering a special sequence of characters. Such sequences may be multicharacter operators like the shift operators in Java.
Unlike keywords, special sequences act also as separators between other tokens. If one special sequence is the prefix of other special sequences (in Java the shift operator >> is the prefix of the shift operator >>>), always the longest possible match is returned. Testing on special sequences takes place after whitespaces and comments are ruled out, but before ordinary separators are tested. This form of addSpecialSequence also takes an object associated with the special sequence, called the companion.
This version of addSpecialSequence supports a bitmask of the Flags to modify the general tokenizer settings (see TokenizerProperties.setParseFlags ) for this special element.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_ADDED to all registered listeners (see TokenizerProperties.addTokenizerPropertyListener ) with the new special sequence TokenizerProperty if the sequence is a new one, or of type TokenizerPropertyEvent.PROPERTY_MODIFIED if the sequence is re-registered.
A call to this method is equivalent to addSpecialSequence(keyword, companion, flags, flags).
Parameters:
  specSeq - special sequence to register
Parameters:
  companion - information object associated with this special sequence
Parameters:
  flags - modification flags
throws:
  IllegalArgumentException - when null or an empty stringis passed for specSeq
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface
See Also:   TokenizerProperties.addSpecialSequence(String)
See Also:   TokenizerProperties.addSpecialSequence(String,Object)
See Also:   TokenizerProperties.addSpecialSequence(String,Object,int,int)
See Also:   TokenizerProperties.removeSpecialSequence



addSpecialSequence
public void addSpecialSequence(String specSeq, Object companion, int flags, int flagMask) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registering a special sequence with a set of flags and an associated flag mask.
The method is an extension to TokenizerProperties.addSpecialSequence(String,Object,int) having a bitmask for the flags that are explicitely specified for the special sequence property. All other flag values (states) should be taken from the TokenizerProperty instance or from the Tokenizer .
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
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface
See Also:   TokenizerProperties.addSpecialSequence(String)
See Also:   TokenizerProperties.addSpecialSequence(String,Object)
See Also:   TokenizerProperties.addSpecialSequence(String,Object,int)
See Also:   TokenizerProperties.removeSpecialSequence



addString
public void addString(String start, String end, String escape) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registering a string description. Strings are things like the primitive string literals in C/C++, SQL varchar literals, but also the character literals of C/C++ and Java.
If the given string starting sequence is already known to the parser, it will simply be re-registered. Using this method on a known string with an associated companion will remove that companion.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_ADDED to all registered listeners (see TokenizerProperties.addTokenizerPropertyListener ) with the new string TokenizerProperty if the string is a new one, or of type TokenizerPropertyEvent.PROPERTY_MODIFIED if the string is re-registered.
Passing null or an empty string for the escape sequence means that no escapes are used in the described string element.
Parameters:
  start - the starting sequence of a string
Parameters:
  end - the finishing sequence of a string
Parameters:
  escape - the escape sequence inside the string
throws:
  IllegalArgumentException - when null or an empty string is passed for start or end
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface
See Also:   TokenizerProperties.addString(String,String,String,Object)
See Also:   TokenizerProperties.addString(String,String,String,Object,int)
See Also:   TokenizerProperties.removeString



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. This method supports also an information associated with the string, called the companion.
If the given string starting sequence is already known to the parser, it will simply be re-registered. Using this method on a known string with an associated companion will replace that companion against the given one.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_ADDED to all registered listeners (see TokenizerProperties.addTokenizerPropertyListener ) with the new string TokenizerProperty if the string is a new one, or of type TokenizerPropertyEvent.PROPERTY_MODIFIED if the string is re-registered.
Passing null or an empty string for the escape sequence means that no escapes are used in the described string element.
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
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface
See Also:   TokenizerProperties.addString(String,String,String)
See Also:   TokenizerProperties.addString(String,String,String,Object,int)
See Also:   TokenizerProperties.removeString



addString
public void addString(String start, String end, String escape, Object companion, int flags) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registering a the sequences that are used for string-like text parts. This method supports also an information associated with the string, called the companion.
If the given string starting sequence is already known to the parser, it will simply be re-registered. Using this method on a known string with an associated companion will replace that companion against the given one.
This version of addString supports a bitmask of the Flags to modify the general tokenizer settings (see TokenizerProperties.setParseFlags for this special element.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_ADDED to all registered listeners (see TokenizerProperties.addTokenizerPropertyListener ) with the new string TokenizerProperty if the string is a new one, or of type TokenizerPropertyEvent.PROPERTY_MODIFIED if the string is re-registered.
Passing null or an empty string for the escape sequence means that no escapes are used in the described string element.
A call to this method is equivalent to addString(start, end, escape, flags, flags).
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
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface
See Also:   TokenizerProperties.addString(String,String,String)
See Also:   TokenizerProperties.addString(String,String,String,Object)
See Also:   TokenizerProperties.addString(String,String,String,Object,int,int)
See Also:   TokenizerProperties.removeString



addString
public void addString(String start, String end, String escape, Object companion, int flags, int flagMask) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registering a string with a set of flags and an associated flag mask.
The method is an extension to TokenizerProperties.addString(String,Object,int) having a bitmask for the flags that are explicitely specified for the block comment property. All other flag values (states) should be taken from the TokenizerProperty instance or from the Tokenizer .
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
throws:
  UnsupportedOperationException - if the method is not available for animplementation of the TokenizerProperties interface
See Also:   TokenizerProperties.addString(String,String,String)
See Also:   TokenizerProperties.addString(String,String,String,Object)
See Also:   TokenizerProperties.addString(String,String,String,Object,int)
See Also:   TokenizerProperties.removeString



addTokenizerPropertyListener
public void addTokenizerPropertyListener(TokenizerPropertyListener listener)(Code)
Registering a new TokenizerPropertyListener . An implementation of the TokenizerProperties interface should call the approbriate methods in the TokenizerPropertyListener interface for all registered listeners whenever a TokenizerProperty is added, removed or modified.
Adding is done by one of the add... calls like TokenizerProperties.addKeyword or TokenizerProperties.addString .
Modifications are re-registering of keywords, comments etc. regardless if companions or parse flags actually changed. Also, TokenizerProperties.setWhitespaces and TokenizerProperties.setSeparators are modifications.
Removals are performed by the remove... calls, for instance TokenizerProperties.removeKeyword .
Similar to the policy of event listener registration in the JDK, passing null does nothing.
Parameters:
  listener - the new TokenizerPropertyListener
See Also:   TokenizerProperties.removeTokenizerPropertyListener



addWhitespaces
public void addWhitespaces(String whitespaces) throws IllegalArgumentException(Code)
Adding new whitespaces to the existing set. This is a convenience method to complete the whitespace set without having to include the already known whitespaces (for instance the TokenizerProperties.DEFAULT_WHITESPACES set).
Whitespaces that are already known, are ignored (the new whitespaces are "merged" into the known set).
For more information see TokenizerProperties.setWhitespaces .
Parameters:
  whitespaces - additional whitespaces for the whitespace set
throws:
  IllegalArgumentException - when null is passed or incompleteranges are specified (e.g. "a-")
See Also:   TokenizerProperties.getWhitespaces
See Also:   TokenizerProperties.setWhitespaces
See Also:   TokenizerProperties.removeWhitespaces



blockCommentExists
public boolean blockCommentExists(String start)(Code)
Checks if the give block comment is known. Only the starting sequence is nessecary to identify the block comment. The method accepts both empty and null strings for start by returning false.
Parameters:
  start - the starting sequence of the block comment true if the block comment is known, false otherwise



getBlockComment
public TokenizerProperty getBlockComment(String start) throws IllegalArgumentException(Code)
Get the full description of a block comment property starting with the given prefix. The method returns null if the passed start parameter cannot be mapped to a known block comment description ( TokenizerProperties.blockCommentExists would return false).
Parameters:
  start - the starting sequence of the block comment the full block comment description or null
throws:
  IllegalArgumentException - when null or an empty stringis passed



getBlockCommentCompanion
public Object getBlockCommentCompanion(String start) throws IllegalArgumentException(Code)
Retrieving a certain block comment. Only the starting sequence is nessecary to identify the block comment. If the block comment is not known to the parser, then null is returned.
To distinguish between an unknown line comment and companion-less line comment, use the method TokenizerProperties.lineCommentExists .
Parameters:
  start - the starting sequence of the block comment the associated object of the block comment
throws:
  IllegalArgumentException - when null or an empty stringis passed



getBlockComments
public Iterator getBlockComments()(Code)
This method returns an java.util.Iterator of TokenizerProperty objects. Each TokenizerProperty object contains the starting and finishing sequence of a block comment and the companion if it exists. enumeration of TokenizerProperty objects



getKeyword
public TokenizerProperty getKeyword(String keyword) throws IllegalArgumentException(Code)
Get the full description of a keyword property. The method returns null if the passed keyword image is unknown ( TokenizerProperties.keywordExists would return false).
Parameters:
  keyword - keyword to search the full sequence description or null
throws:
  IllegalArgumentException - when null or an empty stringis passed



getKeywordCompanion
public Object getKeywordCompanion(String keyword) throws IllegalArgumentException(Code)
Retrieving the companion of the given special sequence. If the special sequence doesn't exist the method returns null.
Parameters:
  keyword - keyword thats companion is sought the object associated with the keyword
throws:
  IllegalArgumentException - when null or an empty stringis passed



getKeywords
public Iterator getKeywords()(Code)
This method returns an java.util.Iterator of TokenizerProperty objects. Each TokenizerProperty object contains a keyword and the companion if it exists. enumeration of TokenizerProperty objects



getLineComment
public TokenizerProperty getLineComment(String lineComment) throws IllegalArgumentException(Code)
Get the full description of a line comment property starting with the given prefix. The method returns null if the passed lineComment parameter cannot be mapped to a known line comment description ( TokenizerProperties.lineCommentExists would return false).
Parameters:
  lineComment - the starting sequence of the line comment the full line comment description or null
throws:
  IllegalArgumentException - when null or an empty stringis passed
See Also:   TokenizerProperties.lineCommentExists



getLineCommentCompanion
public Object getLineCommentCompanion(String lineComment) throws IllegalArgumentException(Code)
Retrieving the associated object of a certain line comment. If the given starting sequence of a line comment is not known to the parser, then the method returns null.
To distinguish between an unknown line comment and companion-less line comment, use the method TokenizerProperties.lineCommentExists .
Parameters:
  lineComment - the starting sequence of the line comment the object associated with the line comment
throws:
  IllegalArgumentException - when null or an empty stringis passed for lineComment
See Also:   TokenizerProperties.lineCommentExists



getLineComments
public Iterator getLineComments()(Code)
This method returns an java.util.Iterator of TokenizerProperty objects. Each TokenizerProperty object contains one starting sequence of a line comment and its companion if it exists. enumeration of TokenizerProperty objects



getParseFlags
public int getParseFlags()(Code)
Retrieving the parser control flags. A bitmask containing the Flags constants is returned. These flags are the ones set for all Tokenizer instances sharing this TokenizerProperties object and may be partially overridden in these tokenizers. the globally set parser control flags
See Also:   TokenizerProperties.setParseFlags



getPattern
public TokenizerProperty getPattern(String pattern) throws IllegalArgumentException(Code)
Get the full description of a pattern property. The method returns null if the passed pattern parameter cannot be mapped to a known pattern description ( TokenizerProperties.patternExists would return false).
Parameters:
  pattern - the regular expression to be looked for the full pattern description or null
throws:
  IllegalArgumentException - when null or an emtpy pattern is passed



getPatternCompanion
public Object getPatternCompanion(String pattern) throws IllegalArgumentException(Code)
Retrieving the information associated with a given pattern. If the pattern is not known to the parser, null will be returned.
If You need to know if a pattern is known to this TokenizerProperties instance with or without a companion, use the method TokenizerProperties.patternExists instead.
Parameters:
  pattern - the regular expression to be removed the associated information or null
throws:
  IllegalArgumentException - when null or an emtpy patternis passed



getPatterns
public Iterator getPatterns()(Code)
This method returns an java.util.Iterator of TokenizerProperty objects. Each TokenizerProperty object contains a pattern and its companion if such an associated object exists. enumeration of TokenizerProperty objects



getProperties
public Iterator getProperties()(Code)
This method returns an java.util.Iterator of TokenizerProperty objects. enumeration of TokenizerProperty objects



getSeparators
public String getSeparators()(Code)
Obtaining the separator set of the TokenizerProperties. The set may contain ranges or may be empty. the currently used set of separating characters
See Also:   TokenizerProperties.setSeparators



getSpecialSequence
public TokenizerProperty getSpecialSequence(String specSeq) throws IllegalArgumentException(Code)
Get the full description of a special sequence property. The method returns null if the passed specSeq image is unknown ( TokenizerProperties.specialSequenceExists would return false).
Parameters:
  specSeq - sequence to find the full sequence description or null
throws:
  IllegalArgumentException - when null or an empty stringis passed



getSpecialSequenceCompanion
public Object getSpecialSequenceCompanion(String specSeq) throws IllegalArgumentException(Code)
Retrieving the companion of the given special sequence. If the special sequence doesn't exist the method returns null.
Parameters:
  specSeq - sequence to remove the object associated with the special sequence
throws:
  IllegalArgumentException - when null or an empty stringis passed



getSpecialSequences
public Iterator getSpecialSequences()(Code)
This method returns an java.util.Iterator of TokenizerProperty objects. Each TokenizerProperty object contains a special sequence and the companion if it exists. enumeration of TokenizerProperty objects



getString
public TokenizerProperty getString(String start) throws IllegalArgumentException(Code)
Get the full description of a string property starting with the given prefix. The method returns null if the passed start parameter cannot be mapped to a known string description ( TokenizerProperties.stringExists would return false).
Parameters:
  start - the starting sequence of a string the full string description or null
throws:
  IllegalArgumentException - when null is passed



getStringCompanion
public Object getStringCompanion(String start) throws IllegalArgumentException, UnsupportedOperationException(Code)
Retrieving the information associated with a certain string. Only the starting sequence is nessecary to identify the string. If the string is not known to the parser, null will be returned.
If one needs to know if a string exists without a companion or if the string is unknown so far, use also the method TokenizerProperties.stringExists .
Parameters:
  start - the starting sequence of a string the associated information or null
throws:
  IllegalArgumentException - when null or an emtpy stringis passed



getStrings
public Iterator getStrings()(Code)
This method returns an java.util.Iterator of TokenizerProperty objects. Each TokenizerProperty object contains the starting, finishing and escaping sequence of a string description and the companion if it exists. enumeration of TokenizerProperty objects



getWhitespaces
public String getWhitespaces()(Code)
Obtaining the whitespace character set. The set may contain ranges. The method may return an emtpy string, if no whitespaces are known.
See Also:   TokenizerProperties.setWhitespaces the currently active whitespace set



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:   TokenizerProperties.setParseFlags
See Also:   TokenizerProperties.getParseFlags
See Also:   TokenizerProperties.isFlagSet(TokenizerProperty,int)



isFlagSet
public boolean isFlagSet(TokenizerProperty prop, int flag) throws NullPointerException(Code)
Checks if a given flag (see Flags ) is set for the given TokenizerProperty in the context of this TokenizerProperties instance.
The method uses the flag state of the TokenizerProperty object if it is contained in the flag mask of the property (see TokenizerProperty.containsFlag ). Otherwise it falls back to the flag state set globally for 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 TokenizerProperties. The method accepts both empty and null strings for keyword by returning false.
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. The method accepts both empty and null strings for lineComment by returning false.
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. The method accepts both empty and null strings for pattern by returning false.
Note that there is no choice of parsing flags (different to the TokenizerProperties.addString(String,String,String,Object,int) method), since it makes generally no sense to "overload" properties.
Parameters:
  pattern - the regular expression to be looked for true if the pattern is registered, false otherwise



propertyExists
public boolean propertyExists(TokenizerProperty property)(Code)
Checks if the given TokenizerProperty is known to this TokenizerProperties instance. The method compares the characteristics given in property against all known properties.
The method accepts null for property by returning false.
Parameters:
  property - the property to search true if the property is known,false otherwise



removeBlockComment
public void removeBlockComment(String start) throws IllegalArgumentException(Code)
Removing a certain block comment. Only the starting sequence is nessecary to identify the block comment.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_REMOVED to all registered listeners if a block comment property is actually removed.
Parameters:
  start - the starting sequence of the block comment
throws:
  IllegalArgumentException - when null or an empty stringis passed



removeKeyword
public void removeKeyword(String keyword) throws IllegalArgumentException(Code)
Removing a keyword property from the store. If the keyword is not known then the method does nothing.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_REMOVED to all registered listeners if a keyword property is actually removed.
Parameters:
  keyword - keyword to remove
throws:
  IllegalArgumentException - when null or an empty stringis passed
See Also:   TokenizerProperties.addKeyword(String)
See Also:   TokenizerProperties.addKeyword(String,Object)
See Also:   TokenizerProperties.addKeyword(String,Object,int)



removeLineComment
public void removeLineComment(String lineComment) throws IllegalArgumentException(Code)
Removing a certain line comment. If the given comment is not known to this TokenizerProperties instance, the method does nothing.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_REMOVED to all registered listeners if a line comment property is actually removed.
Parameters:
  lineComment - the starting sequence of the line comment
throws:
  IllegalArgumentException - when null or an empty stringis passed
See Also:   TokenizerProperties.addLineComment(String)
See Also:   TokenizerProperties.addLineComment(String,Object)
See Also:   TokenizerProperties.addLineComment(String,Object,int)



removePattern
public void removePattern(String pattern) throws IllegalArgumentException(Code)
Removing a pattern. The method does nothing if the given pattern is not known to this TokenizerProperties instance. The method may throw an java.lang.IllegalArgumentException if the given pattern is null or empty.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_REMOVED to all registered listeners (see TokenizerProperties.addTokenizerPropertyListener ) if a pattern is actually removed.
Parameters:
  pattern - the regular expression to be removed
throws:
  IllegalArgumentException - when null or an empty string is passed



removeProperty
public void removeProperty(TokenizerProperty property) throws IllegalArgumentException(Code)
Deregistering a TokenizerProperty from the store. If the property is not known the method does nothing.
Parameters:
  property - property to register
throws:
  IllegalArgumentException - when null, an incomplete or otherwise unusable property is passed



removeSeparators
public void removeSeparators(String separators) throws IllegalArgumentException(Code)
Removing separators from the existing set. This is a convenience method to modify the separator set without having to reconstruct the probably major part of the separators (for instance the TokenizerProperties.DEFAULT_SEPARATORS set). Especially, this method can be used to remove a known single separator without bothering about the other separators.
Separators that are not known, are ignored.
For more information see TokenizerProperties.setSeparators .
Parameters:
  separators - separating characters to remove from the separator set
throws:
  IllegalArgumentException - when null is passed or incompleteranges are specified (e.g. "a-")
See Also:   TokenizerProperties.getSeparators
See Also:   TokenizerProperties.setSeparators
See Also:   TokenizerProperties.addSeparators



removeSpecialSequence
public void removeSpecialSequence(String specSeq) throws IllegalArgumentException(Code)
Removing a special sequence property from the store. If the special sequence is not known, the method does nothing.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_REMOVED to all registered listeners if a special sequence property is actually removed.
Parameters:
  specSeq - sequence to remove
throws:
  IllegalArgumentException - when null or an empty stringis passed
See Also:   TokenizerProperties.addSpecialSequence(String)
See Also:   TokenizerProperties.addSpecialSequence(String,Object)
See Also:   TokenizerProperties.addSpecialSequence(String,Object,int)



removeString
public void removeString(String start) throws IllegalArgumentException(Code)
Removing a string description. The method does nothing if the string description identified by the given start sequence is not known to this TokenizerProperties instance. The method may throw an java.lang.IllegalArgumentException if the given string start is null or empty.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_REMOVED to all registered listeners (see TokenizerProperties.addTokenizerPropertyListener ) if a string is actually removed.
Parameters:
  start - the starting sequence of a string
throws:
  IllegalArgumentException - when null or an empty string is passed



removeTokenizerPropertyListener
public void removeTokenizerPropertyListener(TokenizerPropertyListener listener)(Code)
Removing a listener from the list of registered TokenizerPropertyListener instances. If the given listener is null or unknown, nothing is done.
Parameters:
  listener - the TokenizerPropertyListener to deregister
See Also:   TokenizerProperties.addTokenizerPropertyListener



removeWhitespaces
public void removeWhitespaces(String whitespaces) throws IllegalArgumentException(Code)
Removing whitespaces from the existing set. This is a convenience method to modify the whitespace set without having to reconstruct the probably major part of the whitespaces (for instance the TokenizerProperties.DEFAULT_WHITESPACES set). Especially, this method can be used to remove a known single whitespace without bothering about the other whitespaces
Whitespaces that are not known, are ignored.
For more information see TokenizerProperties.setWhitespaces .
Parameters:
  whitespaces - whitespaces to remove from the whitespace set
throws:
  IllegalArgumentException - when null is passed or incompleteranges are specified (e.g. "a-")
See Also:   TokenizerProperties.getWhitespaces
See Also:   TokenizerProperties.setWhitespaces
See Also:   TokenizerProperties.addWhitespaces



setParseFlags
public void setParseFlags(int flags)(Code)
Setting the control flags of the TokenizerProperties. Use a combination of the Flags for the parameter.
This method sets the parse flags globally for all Tokenizer objects sharing this TokenizerProperties instance. Some flags can be set for single tokenizers separately.
When adding a property like a keyword without explicitely specifying flags, these properties are handled with the flags that were effective at the time of adding.
The method fires a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_MODIFIED each time it is called with different flag masks. The passed TokenizerProperty has the type TokenizerProperty.PARSE_FLAG_MASK .
Parameters:
  flags - the parser control flags



setSeparators
public void setSeparators(String separators) throws IllegalArgumentException(Code)
Setting the separator set. This set may contain ranges. A range is a character (lower limit) followed by a '-' (minus) followed by a second character (upper limit). A range of "a-z" means: all characters in the UNICODE character set between and including 'a' and 'z'. The character '-' itself should be preceded by an escape character. Ranges should be used whenever possible since they speed up the parsing process.
Separators are characters that are significant for the syntax. A sequence of separators is NOT equal to one single separator. Thats the difference to whitespaces.
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_ADDED or TokenizerPropertyEvent.PROPERTY_MODIFIED to all registered listeners (see TokenizerProperties.addTokenizerPropertyListener ).
The method accepts an empty string to describe "no separators".
Parameters:
  separators - the set of separating characters
throws:
  IllegalArgumentException - when null is passed or incompleteranges are specified (e.g. "[-")
See Also:   TokenizerProperties.getSeparators



setWhitespaces
public void setWhitespaces(String whitespaces) throws IllegalArgumentException(Code)
Setting the whitespace character set of the tokenizer. Implementations should be able to operate on ranges like "a-z" when more than two whitespace characters are neighbours in the UNICODE character set.
Whitespaces are sequences that have the same syntactical meaning as one single whitespace character would have. That means " " (many spaces) is the same as " " (one space).
An implementation of this interface should fire a TokenizerPropertyEvent of type TokenizerPropertyEvent.PROPERTY_ADDED or TokenizerPropertyEvent.PROPERTY_MODIFIED to all registered listeners (see TokenizerProperties.addTokenizerPropertyListener ).
The method accepts an empty string to describe "no whitespaces".
Parameters:
  whitespaces - the whitespace set
throws:
  IllegalArgumentException - when null is passed or incompleteranges are specified (e.g. "a-")
See Also:   TokenizerProperties.getWhitespaces
See Also:   TokenizerProperties.addWhitespaces
See Also:   TokenizerProperties.removeWhitespaces



specialSequenceExists
public boolean specialSequenceExists(String specSeq)(Code)
Checks if the given special sequence is known to the TokenizerProperties. The method accepts both empty and null strings for specSeq by returning false.
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. The method accepts both empty and null strings for start by returning false.
Note that there is no choice of parsing flags (different to the TokenizerProperties.addString(String,String,String,Object,int) method), since it makes generally no sense to "overload" properties. A string might be introduced by the starting case-insensitive sequence STR, but there shouldn't be a case-sensitive start str.
Parameters:
  start - the starting sequence of a string true if the string is registered, false otherwise



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.