Java Doc for StandardTokenizer.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) 


java.lang.Object
   de.susebox.jtopas.AbstractTokenizer
      de.susebox.jtopas.StandardTokenizer

StandardTokenizer
public class StandardTokenizer extends AbstractTokenizer implements Tokenizer,TokenizerPropertyListener(Code)

This is the mainstream Tokenizer . It implements the Tokenizer interface in a straightforward approach without too specialized parse optimizations.

Beside the Tokenizer interface, the class StandardTokenizer provides some basic features for cascading (nested) tokenizers. Consider the usual HTML pages found today in the WWW. Most of them are a mixture of regular HTML, cascading style sheets (CSS) and embedded JavaScript. These different languages use different syntaxes, so one needs varous tokenizers on the same input stream.

This Tokenizer implementation is not synchronized. Take care when using with multible threads.


See Also:   Tokenizer
See Also:   TokenizerProperties
author:
   Heiko Blau


Field Summary
protected  CharSequenceTokenizerSource_charSequenceTokenizerSource
     If a CharSequenceTokenizerSource is used, this member is set to it.
protected  AbstractDataProvider_dataProvider
     The de.susebox.jtopas.spi.DataProvider instance for this object.
protected  boolean_hasBeenRead
     Flag used in conjunction with the StandardTokenizer._charSequenceTokenizerSource .
protected  char[]_inputBuffer
     This buffer holds the currently read data.
protected  int_rangeStart
     Mapping of index 0 of StandardTokenizer._inputBuffer to the absolute start of the input stream.

Constructor Summary
public  StandardTokenizer()
     Default constructor that sets the tokenizer control flags as it would be approbriate for C/C++ and Java.
public  StandardTokenizer(TokenizerProperties properties)
     Contructing a StandardTokenizer with a backing TokenizerProperties instance.

Method Summary
public  voidclose()
     Closing this tokenizer frees resources.
protected  DataProvidergetDataProvider(int startPos, int length)
     Implements the abstract method of the base class.
public  intgetRangeStart()
     This method returns the absolute offset in characters to the start of the parsed stream.
protected  intreadMoreData()
     This method organizes the input buffer.
public  voidsetSource(TokenizerSource source)
     Additionally to the common behaviour implemented in #de.susebox.jtopas.AbstractTokenizer#setSource , this method ajusts the state speicific to the StandardTokenizer class.

Field Detail
_charSequenceTokenizerSource
protected CharSequenceTokenizerSource _charSequenceTokenizerSource(Code)
If a CharSequenceTokenizerSource is used, this member is set to it.



_dataProvider
protected AbstractDataProvider _dataProvider(Code)
The de.susebox.jtopas.spi.DataProvider instance for this object. This instance is kept due to a significant performance boost compared with construction of a DataProvider every time StandardTokenizer.getDataProvider is called.



_hasBeenRead
protected boolean _hasBeenRead(Code)
Flag used in conjunction with the StandardTokenizer._charSequenceTokenizerSource .



_inputBuffer
protected char[] _inputBuffer(Code)
This buffer holds the currently read data. Dont use a buffered reader, since we do buffering here.



_rangeStart
protected int _rangeStart(Code)
Mapping of index 0 of StandardTokenizer._inputBuffer to the absolute start of the input stream.




Constructor Detail
StandardTokenizer
public StandardTokenizer()(Code)
Default constructor that sets the tokenizer control flags as it would be approbriate for C/C++ and Java. Found token images are copied. No line nor column informations are provided. Nested comments are not allowed.
The tokenizer will use the TokenizerProperties.DEFAULT_WHITESPACES and TokenizerProperties.DEFAULT_SEPARATORS for whitespace and separator handling.



StandardTokenizer
public StandardTokenizer(TokenizerProperties properties)(Code)
Contructing a StandardTokenizer with a backing TokenizerProperties instance.
Parameters:
  properties - an TokenizerProperties object containing the settings for the tokenizing process




Method Detail
close
public void close()(Code)
Closing this tokenizer frees resources.



getDataProvider
protected DataProvider getDataProvider(int startPos, int length)(Code)
Implements the abstract method of the base class.
Parameters:
  startPos - position in the input data
Parameters:
  length - number of characters



getRangeStart
public int getRangeStart()(Code)
This method returns the absolute offset in characters to the start of the parsed stream. See the method description in Tokenizer . the absolute offset of the current text window in characters from the start of the data source of the Tokenizer
See Also:   StandardTokenizer.getReadPosition



readMoreData
protected int readMoreData() throws TokenizerException(Code)
This method organizes the input buffer. It moves the current text window if nessecary or allocates more space, if data should be kept completely (see the TokenizerProperties.F_KEEP_DATA flag). Its main purpose is to call the TokenizerSource.read method. number of read bytes or -1 if an end-of-file condition occured
throws:
  TokenizerException - wrapped exceptions from the TokenizerSource.read method



setSource
public void setSource(TokenizerSource source)(Code)
Additionally to the common behaviour implemented in #de.susebox.jtopas.AbstractTokenizer#setSource , this method ajusts the state speicific to the StandardTokenizer class.
Parameters:
  source - a TokenizerSource to read data from



Fields inherited from de.susebox.jtopas.AbstractTokenizer
final protected static int VALID_FLAGS_MASK(Code)(Java Doc)
protected AbstractTokenizer _baseTokenizer(Code)(Java Doc)
protected int _columnNumber(Code)(Java Doc)
protected int _currentReadPos(Code)(Java Doc)
protected int _currentWritePos(Code)(Java Doc)
protected StandardTokenizerProperties _defaultProperties(Code)(Java Doc)
protected int _flags(Code)(Java Doc)
protected int _lineNumber(Code)(Java Doc)
protected AbstractTokenizer _nextTokenizer(Code)(Java Doc)
protected AbstractTokenizer _prevTokenizer(Code)(Java Doc)
protected Token[] _scannedToken(Code)(Java Doc)

Methods inherited from de.susebox.jtopas.AbstractTokenizer
public void addTokenizer(AbstractTokenizer tokenizer) throws TokenizerException(Code)(Java Doc)
protected void adjustLineAndColumn(int type, int length)(Code)(Java Doc)
public void changeParseFlags(int flags, int mask) throws TokenizerException(Code)(Java Doc)
public void close()(Code)(Java Doc)
protected int comparePrefix(int offset, String prefix, boolean noCase) throws TokenizerException(Code)(Java Doc)
protected int completeBlockComment(TokenizerProperty prop) throws TokenizerException(Code)(Java Doc)
protected TokenizerProperty completeBoundedToken(Token token) throws TokenizerException(Code)(Java Doc)
protected int completeLineComment(TokenizerProperty prop) throws TokenizerException(Code)(Java Doc)
protected int completeString(TokenizerProperty prop) throws TokenizerException(Code)(Java Doc)
protected int completeWhitespace() throws TokenizerException(Code)(Java Doc)
public String currentImage() throws TokenizerException(Code)(Java Doc)
public Token currentToken() throws TokenizerException(Code)(Java Doc)
public int currentlyAvailable()(Code)(Java Doc)
protected DataProvider getBaseDataProvider(int startPos, int length)(Code)(Java Doc)
protected AbstractTokenizer getBaseTokenizer()(Code)(Java Doc)
public char getChar(int pos) throws IndexOutOfBoundsException(Code)(Java Doc)
public int getColumnNumber()(Code)(Java Doc)
public int getCurrentColumn()(Code)(Java Doc)
public int getCurrentLine()(Code)(Java Doc)
abstract protected DataProvider getDataProvider(int startPos, int length)(Code)(Java Doc)
public de.susebox.jtopas.spi.KeywordHandler getKeywordHandler()(Code)(Java Doc)
public int getLineNumber()(Code)(Java Doc)
public int getParseFlags()(Code)(Java Doc)
public de.susebox.jtopas.spi.PatternHandler getPatternHandler()(Code)(Java Doc)
public int getReadPosition()(Code)(Java Doc)
public de.susebox.jtopas.spi.SeparatorHandler getSeparatorHandler()(Code)(Java Doc)
public de.susebox.jtopas.spi.SequenceHandler getSequenceHandler()(Code)(Java Doc)
public TokenizerSource getSource()(Code)(Java Doc)
public String getText(int start, int len) throws IndexOutOfBoundsException(Code)(Java Doc)
public TokenizerProperties getTokenizerProperties()(Code)(Java Doc)
public de.susebox.jtopas.spi.WhitespaceHandler getWhitespaceHandler()(Code)(Java Doc)
public boolean hasMoreToken()(Code)(Java Doc)
protected boolean isEOF(int offset) throws TokenizerException(Code)(Java Doc)
protected boolean isFlagSet(int flag)(Code)(Java Doc)
protected boolean isFlagSet(TokenizerProperty prop, int flag)(Code)(Java Doc)
protected TokenizerProperty isKeyword(int startingAtPos, int length) throws TokenizerException(Code)(Java Doc)
protected boolean isPattern(int offset, boolean freePatternOnly) throws TokenizerException(Code)(Java Doc)
protected boolean isSeparator(int offset) throws TokenizerException(Code)(Java Doc)
protected boolean isSpecialSequence(int offset) throws TokenizerException(Code)(Java Doc)
protected boolean isWhitespace(char testChar)(Code)(Java Doc)
protected boolean isWhitespace(int offset) throws TokenizerException(Code)(Java Doc)
public String nextImage() throws TokenizerException(Code)(Java Doc)
public Token nextToken() throws TokenizerException(Code)(Java Doc)
public void propertyChanged(TokenizerPropertyEvent event)(Code)(Java Doc)
public int readMore() throws TokenizerException(Code)(Java Doc)
abstract protected int readMoreData() throws TokenizerException(Code)(Java Doc)
protected int readMoreDataFromBase() throws TokenizerException(Code)(Java Doc)
protected int readWhitespaces(int startingAtPos, int maxChars) throws TokenizerException(Code)(Java Doc)
public void setKeywordHandler(de.susebox.jtopas.spi.KeywordHandler handler)(Code)(Java Doc)
public void setPatternHandler(de.susebox.jtopas.spi.PatternHandler handler)(Code)(Java Doc)
public void setReadPositionAbsolute(int position) throws IndexOutOfBoundsException(Code)(Java Doc)
public void setReadPositionRelative(int offset) throws IndexOutOfBoundsException(Code)(Java Doc)
public void setSeparatorHandler(de.susebox.jtopas.spi.SeparatorHandler handler)(Code)(Java Doc)
public void setSequenceHandler(de.susebox.jtopas.spi.SequenceHandler handler)(Code)(Java Doc)
public void setSource(TokenizerSource source)(Code)(Java Doc)
public void setSource(Reader reader)(Code)(Java Doc)
public void setTokenizerProperties(TokenizerProperties props) throws NullPointerException(Code)(Java Doc)
public void setWhitespaceHandler(de.susebox.jtopas.spi.WhitespaceHandler handler)(Code)(Java Doc)
protected String[] splitBlockComment(TokenizerProperty prop, String image)(Code)(Java Doc)
protected String[] splitIntoLines(String image)(Code)(Java Doc)
protected String[] splitString(TokenizerProperty prop, String image)(Code)(Java Doc)
public void switchTo(AbstractTokenizer tokenizer) throws TokenizerException(Code)(Java Doc)
protected void synchronizeAll() throws TokenizerException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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