Java Doc for Scanner.java in  » Scripting » jacl » org » codehaus » janino » 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 » Scripting » jacl » org.codehaus.janino 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.codehaus.janino.Scanner

Scanner
public class Scanner (Code)
Splits up a character stream into tokens and returns them as java.lang.String String objects.

The optionalFileName parameter passed to many constructors should point


Inner Class :abstract public class Token
Inner Class :public class KeywordToken extends Token
Inner Class :public class IdentifierToken extends Token
Inner Class :final public class LiteralToken extends Token
Inner Class :public class OperatorToken extends Token
Inner Class :public class EOFToken extends Token
Inner Class :public class ScanException extends LocatedException
Inner Class :public static class LocatedException extends Exception

Field Summary
final public static  IntegerMAGIC_INTEGER
     This value represents the "magic" literal "2147483648" which is only allowed in a negated context.
final public static  LongMAGIC_LONG
     This value represents the "magic" literal "9223372036854775808L" which is only allowed in a negated context.

Constructor Summary
public  Scanner(String fileName)
     Set up a scanner that reads tokens from the given file in the default charset.
public  Scanner(String fileName, String encoding)
     Set up a scanner that reads tokens from the given file in the given encoding.
public  Scanner(File file)
     Set up a scanner that reads tokens from the given file in the platform default encoding.
public  Scanner(File file, String optionalEncoding)
     Set up a scanner that reads tokens from the given file in the given encoding.
public  Scanner(String optionalFileName, InputStream is)
     Set up a scanner that reads tokens from the given InputStream in the platform default encoding.
public  Scanner(String optionalFileName, InputStream is, String optionalEncoding)
     Set up a scanner that reads tokens from the given InputStream with the given optionalEncoding (null means platform default encoding).

The optionalFileName is used for reporting errors during compilation and for source level debugging, and should name an existing file.

public  Scanner(String optionalFileName, Reader in)
     Set up a scanner that reads tokens from the given Reader .

The optionalFileName is used for reporting errors during compilation and for source level debugging, and should name an existing file.

public  Scanner(String optionalFileName, Reader in, short initialLineNumber, short initialColumnNumber)
     Creates a Scanner that counts lines and columns from non-default initial values.

Method Summary
public  voidclose()
     Closes the character source (file, InputStream , Reader ) associated with this object.
public  Stringdoc()
     Get the text of the doc comment (a.k.a.
public  StringgetFileName()
     Return the file name optionally passed to the constructor.
public static  StringliteralValueToString(Object v)
    
public  Locationlocation()
     Returns the Location of the next token.
public  Tokenpeek()
     Peek the next token, but don't remove it from the input.
public  TokenpeekNextButOne()
     Peek the next but one token, neither remove the next nor the next but one token from the input.

This makes parsing so much easier, e.g.

public  Tokenread()
     Read the next token from the input.
public  voidsetWarningHandler(WarningHandler optionalWarningHandler)
     By default, warnings are discarded, but an application my install a WarningHandler .

Notice that there is no Scanner.setErrorHandler() method, but scan errors always throw a ScanException .


Field Detail
MAGIC_INTEGER
final public static Integer MAGIC_INTEGER(Code)
This value represents the "magic" literal "2147483648" which is only allowed in a negated context.



MAGIC_LONG
final public static Long MAGIC_LONG(Code)
This value represents the "magic" literal "9223372036854775808L" which is only allowed in a negated context.




Constructor Detail
Scanner
public Scanner(String fileName) throws ScanException, IOException(Code)
Set up a scanner that reads tokens from the given file in the default charset.

This method is deprecated because it leaves the input file open.




Scanner
public Scanner(String fileName, String encoding) throws ScanException, IOException(Code)
Set up a scanner that reads tokens from the given file in the given encoding.

This method is deprecated because it leaves the input file open.




Scanner
public Scanner(File file) throws ScanException, IOException(Code)
Set up a scanner that reads tokens from the given file in the platform default encoding.

This method is deprecated because it leaves the input file open.




Scanner
public Scanner(File file, String optionalEncoding) throws ScanException, IOException(Code)
Set up a scanner that reads tokens from the given file in the given encoding.

This method is deprecated because it leaves the input file open.




Scanner
public Scanner(String optionalFileName, InputStream is) throws ScanException, IOException(Code)
Set up a scanner that reads tokens from the given InputStream in the platform default encoding.

The fileName is solely used for reporting in thrown exceptions.
Parameters:
  optionalFileName -
Parameters:
  is -
throws:
  ScanException -
throws:
  IOException -




Scanner
public Scanner(String optionalFileName, InputStream is, String optionalEncoding) throws ScanException, IOException(Code)
Set up a scanner that reads tokens from the given InputStream with the given optionalEncoding (null means platform default encoding).

The optionalFileName is used for reporting errors during compilation and for source level debugging, and should name an existing file. If null is passed, and the system property org.codehaus.janino.source_debugging.enable is set to "true", then a temporary file in org.codehaus.janino.source_debugging.dir or the system's default temp dir is created in order to make the source code available to a debugger.




Scanner
public Scanner(String optionalFileName, Reader in) throws ScanException, IOException(Code)
Set up a scanner that reads tokens from the given Reader .

The optionalFileName is used for reporting errors during compilation and for source level debugging, and should name an existing file. If null is passed, and the system property org.codehaus.janino.source_debugging.enable is set to "true", then a temporary file in org.codehaus.janino.source_debugging.dir or the system's default temp dir is created in order to make the source code available to a debugger.




Scanner
public Scanner(String optionalFileName, Reader in, short initialLineNumber, short initialColumnNumber) throws ScanException, IOException(Code)
Creates a Scanner that counts lines and columns from non-default initial values.




Method Detail
close
public void close() throws IOException(Code)
Closes the character source (file, InputStream , Reader ) associated with this object. The results of future calls to Scanner.peek() and Scanner.read() are undefined.

This method is deprecated, because the concept described above is confusing. An application should close the underlying InputStream or Reader itself.




doc
public String doc()(Code)
Get the text of the doc comment (a.k.a. "JAVADOC comment") preceeding the next token. null if the next token is not preceeded by a doc comment



getFileName
public String getFileName()(Code)
Return the file name optionally passed to the constructor.



literalValueToString
public static String literalValueToString(Object v)(Code)



location
public Location location()(Code)
Returns the Location of the next token.



peek
public Token peek()(Code)
Peek the next token, but don't remove it from the input.



peekNextButOne
public Token peekNextButOne() throws ScanException, IOException(Code)
Peek the next but one token, neither remove the next nor the next but one token from the input.

This makes parsing so much easier, e.g. for class literals like Map.class.




read
public Token read() throws ScanException, IOException(Code)
Read the next token from the input.



setWarningHandler
public void setWarningHandler(WarningHandler optionalWarningHandler)(Code)
By default, warnings are discarded, but an application my install a WarningHandler .

Notice that there is no Scanner.setErrorHandler() method, but scan errors always throw a ScanException . The reason being is that there is no reasonable way to recover from scan errors and continue scanning, so there is no need to install a custom scan error handler.
Parameters:
  optionalWarningHandler - null to indicate that no warnings be issued




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.