Java Doc for AbstractConsole.java in  » GIS » GeoTools-2.4.1 » org » geotools » referencing » wkt » 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 » GIS » GeoTools 2.4.1 » org.geotools.referencing.wkt 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.geotools.referencing.wkt.AbstractConsole

All known Subclasses:   org.geotools.referencing.Console,
AbstractConsole
abstract public class AbstractConsole implements Runnable(Code)
Base class for application performing operations on WKT objects from the command line. Instructions are usually read from the and results sent to the , but those streams can be redirected. The set of allowed instructions depends on the subclass used.
since:
   2.1
version:
   $Id: AbstractConsole.java 27848 2007-11-12 13:10:32Z desruisseaux $
author:
   Martin Desruisseaux


Field Summary
final protected  PrintWritererr
     The error stream, usually the .
final protected  LineNumberReaderin
     The input stream, usually the .
final protected  StringlineSeparator
     The line separator, usually the system default.
final protected  Writerout
     The output stream, usually the .
final protected  Formatparser
     The WKT parser, usually a Preprocessor object.

Constructor Summary
public  AbstractConsole(Format parser)
     Creates a new console instance using , , and the system default line separator.
public  AbstractConsole(Format parser, LineNumberReader in)
     Creates a new console instance using the specified input stream.
public  AbstractConsole(Format parser, LineNumberReader in, Writer out, PrintWriter err, String lineSeparator)
     Creates a new console instance using the specified streams and line separator.

Method Summary
public  voidaddDefinition(String name, String value)
     Adds a predefined Well Know Text (WKT).
abstract protected  voidexecute(String instruction)
     Execute the specified instruction.
public  voidexecuteAll()
     Executes all instructions (like AbstractConsole.run ), but stop at the first error.
public  StringgetPrompt()
     Returns the command-line prompt, or null if there is none.
public  voidloadDefinitions(LineNumberReader in)
     Load all definitions from the specified stream.
public  ObjectparseObject(String text, Class type)
     Parses the specified text.
public  voidprintDefinitions()
     Prints to the a table of all definitions.
protected  voidreportError(Exception exception)
     Print an exception message to the .
public  voidrun()
     Process instructions from the specified at construction time.
public  voidsetPrompt(String prompt)
     Set the command-line prompt, or null for none.
public  voidstop()
     Stops the AbstractConsole.run method.

Field Detail
err
final protected PrintWriter err(Code)
The error stream, usually the .



in
final protected LineNumberReader in(Code)
The input stream, usually the .



lineSeparator
final protected String lineSeparator(Code)
The line separator, usually the system default.



out
final protected Writer out(Code)
The output stream, usually the .



parser
final protected Format parser(Code)
The WKT parser, usually a Preprocessor object.




Constructor Detail
AbstractConsole
public AbstractConsole(Format parser)(Code)
Creates a new console instance using , , and the system default line separator.
Parameters:
  parser - The WKT parser, usually a Preprocessor object.



AbstractConsole
public AbstractConsole(Format parser, LineNumberReader in)(Code)
Creates a new console instance using the specified input stream.
Parameters:
  parser - The WKT parser, usually a Preprocessor object.
Parameters:
  in - The input stream.



AbstractConsole
public AbstractConsole(Format parser, LineNumberReader in, Writer out, PrintWriter err, String lineSeparator)(Code)
Creates a new console instance using the specified streams and line separator.
Parameters:
  parser - The WKT parser, usually a Preprocessor object.
Parameters:
  in - The input stream.
Parameters:
  out - The output stream.
Parameters:
  err - The error stream.
Parameters:
  lineSeparator - The line separator.




Method Detail
addDefinition
public void addDefinition(String name, String value) throws ParseException(Code)
Adds a predefined Well Know Text (WKT). The value argument given to this method can contains itself other definitions specified in some previous calls to this method. This method do nothing if the is not an instance of Preprocessor .
Parameters:
  name - The name for the definition to be added.
Parameters:
  value - The Well Know Text (WKT) represented by the name.
throws:
  IllegalArgumentException - if the name is invalid.
throws:
  ParseException - if the WKT can't be parsed.



execute
abstract protected void execute(String instruction) throws Exception(Code)
Execute the specified instruction.
Parameters:
  instruction - The instruction to execute.
throws:
  Exception - if the instruction failed.



executeAll
public void executeAll() throws Exception(Code)
Executes all instructions (like AbstractConsole.run ), but stop at the first error.
throws:
  Exception - if an instruction failed.



getPrompt
public String getPrompt()(Code)
Returns the command-line prompt, or null if there is none.



loadDefinitions
public void loadDefinitions(LineNumberReader in) throws IOException, ParseException(Code)
Load all definitions from the specified stream. Definitions are key-value pairs in the form name = wkt (without the SET keyword). The result is the same than invoking the SET instruction for each line in the specified stream. This method is used for loading predefined objects like the database used by org.geotools.referencing.factory.PropertyAuthorityFactory .
Parameters:
  in - The input stream.
throws:
  IOException - if an input operation failed.
throws:
  ParseException - if a well know text (WKT) can't be parsed.



parseObject
public Object parseObject(String text, Class type) throws ParseException, FactoryException(Code)
Parses the specified text. The default implementation delegates the work to the .
Parameters:
  text - The text, as a name, a WKT to parse, or an authority code.
Parameters:
  type - The expected type for the object to be parsed (usually a.class or.class). The object.
throws:
  ParseException - if parsing the specified WKT failed.
throws:
  FactoryException - if the object is not of the expected type.



printDefinitions
public void printDefinitions() throws IOException(Code)
Prints to the a table of all definitions. The content of this table is inferred from the values given to the AbstractConsole.addDefinition method. This method print nothing if the is not an instance of Preprocessor .
throws:
  IOException - if an error occured while writting to the output stream.



reportError
protected void reportError(Exception exception)(Code)
Print an exception message to the . The error message includes the line number, and the column where the failure occured in the exception is an instance of ParseException .
Parameters:
  exception - The exception to report.



run
public void run()(Code)
Process instructions from the specified at construction time. All lines are read until the end of stream ( [Ctrl-Z] for input from the keyboard), or until AbstractConsole.stop() is invoked. Non-empty and non-comment lines are given to the AbstractConsole.execute method. Errors are catched and printed to the .



setPrompt
public void setPrompt(String prompt)(Code)
Set the command-line prompt, or null for none.



stop
public void stop()(Code)
Stops the AbstractConsole.run method. This method can been invoked from any thread. If a line is in process, it will be finished before the AbstractConsole.run method stops.



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.