Java Doc for Preprocessor.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
   java.text.Format
      org.geotools.referencing.wkt.Preprocessor

Preprocessor
public class Preprocessor extends Format (Code)
A parser that performs string replacements before to delegate the work to an other parser. String replacements are specified through calls to the Preprocessor.addDefinition addDefinition method. In the example below, the WGS84 string in the call is expanded into the full GEOGCS["WGS84", ... string before to be parsed.
("WGS84", "GEOGCS[\"WGS84\", DATUM[ ...etc... ]]
("PROJCS[\"Mercator_1SP\", WGS84, PROJECTION[
...etc... ]]")

since:
   2.1
version:
   $Id: Preprocessor.java 22295 2006-10-20 00:58:17Z desruisseaux $
author:
   Martin Desruisseaux


Field Summary
transient  intoffset
     The initial offset of the line in process of being parsed.
final protected  Formatparser
     The WKT parser, usually a Parser object.

Constructor Summary
public  Preprocessor(Format parser)
     Creates a new preprocessor that delegates the work to the specified parser.

Method Summary
public  voidaddDefinition(String name, String value)
     Adds a predefined Well Know Text (WKT).
public  StringBufferformat(Object object, StringBuffer toAppendTo, FieldPosition position)
     Formats the specified object.
public  SetgetDefinitionNames()
     Returns an unmodifiable set which contains all definition's names given to the (name, ...) method.
public  ObjectparseObject(String wkt, ParsePosition position)
     Parses the specified Well Know Text starting at the specified position. The default implementation delegates the work to Preprocessor.parseObject(String) parseObject (wkt.substring(position.getIndex())).
Parameters:
  wkt - The text to parse.
Parameters:
  position - The index of the first character to parse.
public  ObjectparseObject(String wkt)
     Parses the specified Well Know Text without restriction on the expected type. The default implementation delegates the work to Preprocessor.parseObject(String,Class) parseObject (wkt, Object.class).
Parameters:
  wkt - The text to parse.
public  ObjectparseObject(String text, Class type)
     Parses the specified text and ensure that the resulting object is of the specified type. The text can be any of the following:
  • A name declared in some previous call to (name, ...).
  • A Well Know Text, which may contains itself shortcuts declared in previous call to addDefinition .
public  voidprintDefinitions(Writer out)
     Prints to the specified stream a table of all definitions.
public  voidremoveDefinition(String name)
     Removes a definition set in some previous call to (name, ...).

Field Detail
offset
transient int offset(Code)
The initial offset of the line in process of being parsed. This is a helper field for use by AbstractConsole only, in order to produce more accurate information in case of ParseException . This field has no impact on the object returned as a result of successful parsing.



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




Constructor Detail
Preprocessor
public Preprocessor(Format parser)(Code)
Creates a new preprocessor that delegates the work to the specified parser.
Parameters:
  parser - The WKT parser, usually a Parser object.




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.
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.



format
public StringBuffer format(Object object, StringBuffer toAppendTo, FieldPosition position)(Code)
Formats the specified object. This method delegates the work to the given at construction time.
Parameters:
  object - The object to format.
Parameters:
  toAppendTo - Where the text is to be appended.
Parameters:
  position - Identification of a field in the formatted text. The string buffer passed in as toAppendTo ,with formatted text appended



getDefinitionNames
public Set getDefinitionNames()(Code)
Returns an unmodifiable set which contains all definition's names given to the (name, ...) method. The elements in this set are sorted in alphabetical order.



parseObject
public Object parseObject(String wkt, ParsePosition position)(Code)
Parses the specified Well Know Text starting at the specified position. The default implementation delegates the work to Preprocessor.parseObject(String) parseObject (wkt.substring(position.getIndex())).
Parameters:
  wkt - The text to parse.
Parameters:
  position - The index of the first character to parse. The parsed object, or null in case of failure.



parseObject
public Object parseObject(String wkt) throws ParseException(Code)
Parses the specified Well Know Text without restriction on the expected type. The default implementation delegates the work to Preprocessor.parseObject(String,Class) parseObject (wkt, Object.class).
Parameters:
  wkt - The text to parse. The parsed object.
throws:
  ParseException - if the text can't be parsed.



parseObject
public Object parseObject(String text, Class type) throws ParseException, FactoryException(Code)
Parses the specified text and ensure that the resulting object is of the specified type. The text can be any of the following:
  • A name declared in some previous call to (name, ...).
  • A Well Know Text, which may contains itself shortcuts declared in previous call to addDefinition . This text is given to the underlying Preprocessor.parser .
  • Any services provided by subclasses. For example a subclass way recognize some authority code like EPSG:6326 .

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(Writer out) throws IOException(Code)
Prints to the specified stream a table of all definitions. The content of this table is inferred from the values given to the Preprocessor.addDefinition method.
Parameters:
  out - writer The output stream where to write the table.
throws:
  IOException - if an error occured while writting to the output stream.



removeDefinition
public void removeDefinition(String name)(Code)
Removes a definition set in some previous call to (name, ...).
Parameters:
  name - The name of the definition to remove.



Methods inherited from java.text.Format
public Object clone()(Code)(Java Doc)
final public String format(Object obj)(Code)(Java Doc)
abstract public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos)(Code)(Java Doc)
public AttributedCharacterIterator formatToCharacterIterator(Object obj)(Code)(Java Doc)
abstract public Object parseObject(String source, ParsePosition pos)(Code)(Java Doc)
public Object parseObject(String source) throws ParseException(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.