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


java.lang.Object
   org.geotools.feature.FeatureTypes
      org.geotools.feature.FeatureTypeBuilder

All known Subclasses:   org.geotools.feature.FeatureTypeFactory,
FeatureTypeBuilder
abstract public class FeatureTypeBuilder extends FeatureTypes implements Factory(Code)
A schema builder, because FeatureTypes are meant to be immutable, this object is mutable.

The basic idea for usage is that you configure the builder to whatever state is desired, setting properties and adding AttributeTypes. When the desired state is acheived, the expected FeatureType can be retrieved by calling
getFeatureType()

Repeated calls to getFeatureType will return the same FeatureType given that no calls which modify the state of the factory are made.

Here's an example of how to use this:

 
 FeatureTypeBuilder build = FeatureTypeFactory.newInstance();  
 build.addType(...);
 build.setName(...);  
 build.setNamespace(...);  
 FeatureType type = build.getFeatureType(); 
 
There are also a set of convenience methods for creation of FeatureTypes. These are the various newFeatureType methods.


author:
   Ian Schneider
version:
   $Id: FeatureTypeBuilder.java 25008 2007-04-04 02:17:19Z jgarnett $


Field Summary
 Maphints
     Implementation hints - since this is a builder all hints are passed onto the FeatureType.

Constructor Summary
public  FeatureTypeBuilder()
     An empty public constructor.
public  FeatureTypeBuilder(Map hints)
     An empty public constructor.

Method Summary
abstract protected  voidadd(AttributeType type)
    
abstract protected  voidadd(int idx, AttributeType type)
    
protected  voidaddBaseTypes(Set types)
    
final public  voidaddType(AttributeType type)
     A the given AttributeType to this factory.
final public  voidaddType(int idx, AttributeType type)
     Insert the given type at the index specified.
final public  voidaddTypes(AttributeType[] types)
     Add an array of AttributeTypes to this factory.
protected  voidcheck(AttributeType type)
     Checks to see if this factory already contains the type.
final public  booleancontains(AttributeType type)
     Check to see if this factory contains the given AttributeType.
abstract protected  FeatureTypecreateFeatureType()
    
abstract public  AttributeTypeget(int idx)
    
abstract public  intgetAttributeCount()
    
final protected  SetgetBuiltinTypes()
    
final public  GeometryAttributeTypegetDefaultGeometry()
     Return the AttributeType currently used as the defaultGeometry property for the FeatureType this factory will create.
final public  FeatureTypegetFeatureType()
     Get a FeatureType which reflects the state of this factory.
public  MapgetImplementationHints()
     Returns the implementation hints.
final public  StringgetName()
     Get the current configuration of the name of this factory. The current name.
final public  URIgetNamespace()
     Get the current configuration of the namespace of this factory. The current namespace.
final public  java.util.CollectiongetSuperTypes()
     Obtain the super types of this factory.
public  voidimportType(FeatureType type, boolean strict)
     Import all of the AttributeTypes from the given FeatureType into this factory.
public  voidimportType(FeatureType type)
    
final public  booleanisAbstract()
    
public static  FeatureTypeFactorynewInstance(String typeName)
     Create a new FeatureTypeFactory with the given typeName.
Parameters:
  name - The typeName of the feature to create.
abstract protected  AttributeTyperemove(AttributeType type)
    
abstract protected  AttributeTyperemove(int idx)
    
final public  voidremoveAll()
     Remove all the AttributeTypes in this factory.
final public  voidremoveType(AttributeType type)
     Remove the given type from this factory.
final public  voidremoveType(int idx)
     Remove the AttributeType at the given index.
abstract protected  AttributeTypeset(int idx, AttributeType type)
    
final public  voidsetAbstract(boolean a)
     Configure this factory to produce an abstract type.
final public  voidsetDefaultGeometry(GeometryAttributeType defaultGeometry)
     Sets the defaultGeometry of this factory.
public  voidsetName(String name)
     Set the name of the FeatureType this factory will produce.
Parameters:
  name - The new name.
public  voidsetNamespace(URI namespace)
     Set the namespace of the FeatureType this factory will produce.
Parameters:
  namespace - The new namespace.
final public  voidsetSuperTypes(java.util.Collection types)
     Set the super types of this factory.
final public  voidsetType(int idx, AttributeType type)
     Set the AttributeType at the given index.
final public  voidswap(int idx1, int idx2)
     Swap the AttributeTypes at the given locations.
public  StringtoString()
     Returns a string representation of this factory.

Field Detail
hints
Map hints(Code)
Implementation hints - since this is a builder all hints are passed onto the FeatureType.




Constructor Detail
FeatureTypeBuilder
public FeatureTypeBuilder()(Code)
An empty public constructor. Subclasses should not provide a constructor.



FeatureTypeBuilder
public FeatureTypeBuilder(Map hints)(Code)
An empty public constructor. Subclasses should not provide a constructor.




Method Detail
add
abstract protected void add(AttributeType type) throws IllegalArgumentException(Code)
DOCUMENT ME!
Parameters:
  type -
throws:
  IllegalArgumentException -



add
abstract protected void add(int idx, AttributeType type) throws ArrayIndexOutOfBoundsException, IllegalArgumentException(Code)
DOCUMENT ME!
Parameters:
  idx -
Parameters:
  type -
throws:
  ArrayIndexOutOfBoundsException -
throws:
  IllegalArgumentException -



addBaseTypes
protected void addBaseTypes(Set types)(Code)



addType
final public void addType(AttributeType type) throws NullPointerException, IllegalArgumentException(Code)
A the given AttributeType to this factory.
Parameters:
  type - The type to add.
throws:
  NullPointerException - If the type is null.
throws:
  IllegalArgumentException - If another type exists with the samename.



addType
final public void addType(int idx, AttributeType type) throws NullPointerException, IllegalArgumentException, ArrayIndexOutOfBoundsException(Code)
Insert the given type at the index specified.
Parameters:
  idx - The index to insert at.
Parameters:
  type - The AttributeType to insert.
throws:
  NullPointerException - If the type is null.
throws:
  IllegalArgumentException - If the AttributeType is not allowed.
throws:
  ArrayIndexOutOfBoundsException - If the index is out of range.



addTypes
final public void addTypes(AttributeType[] types) throws NullPointerException, IllegalArgumentException(Code)
Add an array of AttributeTypes to this factory.
Parameters:
  types - The types or a null array.
throws:
  NullPointerException - If any of the types are null.
throws:
  IllegalArgumentException - If there are naming problems.



check
protected void check(AttributeType type)(Code)
Checks to see if this factory already contains the type.
Parameters:
  type -
throws:
  IllegalArgumentException - DOCUMENT ME!



contains
final public boolean contains(AttributeType type)(Code)
Check to see if this factory contains the given AttributeType. The comparison is done by name.
Parameters:
  type - The AttributeType to search for by name. true if a like-named AttributeType exists,false otherwise.



createFeatureType
abstract protected FeatureType createFeatureType() throws SchemaException(Code)
DOCUMENT ME!



get
abstract public AttributeType get(int idx) throws ArrayIndexOutOfBoundsException(Code)
DOCUMENT ME!
Parameters:
  idx -
throws:
  ArrayIndexOutOfBoundsException -



getAttributeCount
abstract public int getAttributeCount()(Code)
DOCUMENT ME!



getBuiltinTypes
final protected Set getBuiltinTypes()(Code)



getDefaultGeometry
final public GeometryAttributeType getDefaultGeometry()(Code)
Return the AttributeType currently used as the defaultGeometry property for the FeatureType this factory will create. The AttributeType representing the defaultGeometry or null.



getFeatureType
final public FeatureType getFeatureType() throws SchemaException(Code)
Get a FeatureType which reflects the state of this factory. Any modifications to the state of the factory (adding, removing, or reordering any AttributeTypes or changing any other properties - isNillable,name,etc.), will cause the factory to "retool" itself. If the factory has not changed since a call to this method, the return value will be the same FeatureType which the previous method returned. Otherwise, a new FeatureType will be created. The featureType reflecting the current factory state.
throws:
  SchemaException - if name is null or blank



getImplementationHints
public Map getImplementationHints()(Code)
Returns the implementation hints. The default implementation returns en empty map.

Since the building of a FeatureType involves the collaboration of may Factory classes (that may be discovered over the course of the build process) we are forced to indicate that *all* hints are used.

Strictly this is a Builder (not a factory) and has no need declair which hints are used (as one can never *keep* this builder in a factory registery. (It is stateful and cannot be used concurrently for example).




getName
final public String getName()(Code)
Get the current configuration of the name of this factory. The current name. May be null.



getNamespace
final public URI getNamespace()(Code)
Get the current configuration of the namespace of this factory. The current namespace. May be null.



getSuperTypes
final public java.util.Collection getSuperTypes()(Code)
Obtain the super types of this factory. Any user types will be appended to the built in types of this factory. A Collection representing the super types of the FeatureTypethis factory will create.



importType
public void importType(FeatureType type, boolean strict) throws IllegalArgumentException(Code)
Import all of the AttributeTypes from the given FeatureType into this factory.

If strict is true, non-uniquely named AttributeTypes will throw an exception.

If strict is false, these will be silently ignored, but not added.

No other information is imported.


Parameters:
  type - The FeatureType to import from.
Parameters:
  strict - Enforce namespace restrictions.
throws:
  IllegalArgumentException - If strict is true and there are namingproblems.



importType
public void importType(FeatureType type)(Code)
A convienence method for importing AttributeTypes, simply calls
importType(type,false)
Parameters:
  type - The type to import.



isAbstract
final public boolean isAbstract()(Code)
Is this factory configured to be abstract? True if it is, false if it aint.



newInstance
public static FeatureTypeFactory newInstance(String typeName) throws FactoryConfigurationError(Code)
Create a new FeatureTypeFactory with the given typeName.
Parameters:
  name - The typeName of the feature to create. A new FeatureTypeFactory instance.
throws:
  FactoryConfigurationError - If there exists a configuration error.



remove
abstract protected AttributeType remove(AttributeType type)(Code)
DOCUMENT ME!
Parameters:
  type -



remove
abstract protected AttributeType remove(int idx) throws ArrayIndexOutOfBoundsException(Code)
DOCUMENT ME!
Parameters:
  idx -
throws:
  ArrayIndexOutOfBoundsException -



removeAll
final public void removeAll()(Code)
Remove all the AttributeTypes in this factory.



removeType
final public void removeType(AttributeType type) throws NullPointerException(Code)
Remove the given type from this factory.
Parameters:
  type - The type to remove.
throws:
  NullPointerException - If the type is null.



removeType
final public void removeType(int idx) throws ArrayIndexOutOfBoundsException(Code)
Remove the AttributeType at the given index.
Parameters:
  idx - The index to remove at.
throws:
  ArrayIndexOutOfBoundsException - If the index is out of bounds.



set
abstract protected AttributeType set(int idx, AttributeType type) throws ArrayIndexOutOfBoundsException, IllegalArgumentException(Code)
DOCUMENT ME!
Parameters:
  idx -
Parameters:
  type -
throws:
  ArrayIndexOutOfBoundsException -
throws:
  IllegalArgumentException -



setAbstract
final public void setAbstract(boolean a)(Code)
Configure this factory to produce an abstract type.
Parameters:
  a - True or false.



setDefaultGeometry
final public void setDefaultGeometry(GeometryAttributeType defaultGeometry) throws IllegalArgumentException(Code)
Sets the defaultGeometry of this factory. If the defaultGeometry AttributeType does not exist as an AttributeType within this factory, it is added. This will overwrite the existing defaultGeometry, yet not remove it from the existing AttributeTypes.
Parameters:
  defaultGeometry - The AttributeType to use as the defaultGeometry.May be null.
throws:
  IllegalArgumentException - if the type is not a geometry.



setName
public void setName(String name)(Code)
Set the name of the FeatureType this factory will produce.
Parameters:
  name - The new name. May be null.



setNamespace
public void setNamespace(URI namespace)(Code)
Set the namespace of the FeatureType this factory will produce.
Parameters:
  namespace - The new namespace. May be null.



setSuperTypes
final public void setSuperTypes(java.util.Collection types)(Code)
Set the super types of this factory. The types will be copied into a Set.
Parameters:
  types - A Collection of types.



setType
final public void setType(int idx, AttributeType type) throws IllegalArgumentException, NullPointerException, ArrayIndexOutOfBoundsException(Code)
Set the AttributeType at the given index. Overwrites the existing type.
Parameters:
  idx - The index to use.
Parameters:
  type - The type to use.
throws:
  IllegalArgumentException - If the type is not good.
throws:
  NullPointerException - if they type passed in is null
throws:
  ArrayIndexOutOfBoundsException - if the index is out of bounds.



swap
final public void swap(int idx1, int idx2) throws ArrayIndexOutOfBoundsException(Code)
Swap the AttributeTypes at the given locations.
Parameters:
  idx1 - The index of the first.
Parameters:
  idx2 - The index of the second.
throws:
  ArrayIndexOutOfBoundsException - if either index is not in thearray bounds.



toString
public String toString()(Code)
Returns a string representation of this factory. The string representing this factory.



Fields inherited from org.geotools.feature.FeatureTypes
final public static int ANY_LENGTH(Code)(Java Doc)
final public static URI DEFAULT_NAMESPACE(Code)(Java Doc)

Methods inherited from org.geotools.feature.FeatureTypes
public static Set ancestors(FeatureType featureType)(Code)(Java Doc)
public static boolean equals(FeatureType typeA, FeatureType typeB)(Code)(Java Doc)
public static boolean equals(AttributeType attributesA, AttributeType attributesB)(Code)(Java Doc)
public static boolean equals(AttributeType a, AttributeType b)(Code)(Java Doc)
public static boolean equalsAncestors(FeatureType typeA, FeatureType typeB)(Code)(Java Doc)
public static boolean equalsId(FeatureType typeA, FeatureType typeB)(Code)(Java Doc)
public static int getFieldLength(AttributeType type)(Code)(Java Doc)
public static boolean isDecendedFrom(FeatureType featureType, URI namespace, String typeName)(Code)(Java Doc)
public static boolean isDecendedFrom(FeatureType featureType, FeatureType isParentType)(Code)(Java Doc)
public static FeatureType newFeatureType(AttributeType[] types, String name, URI ns, boolean isAbstract, FeatureType[] superTypes) throws FactoryConfigurationError, SchemaException(Code)(Java Doc)
public static FeatureType newFeatureType(AttributeType[] types, String name, URI ns, boolean isAbstract, FeatureType[] superTypes, AttributeType defaultGeometry) throws FactoryConfigurationError, SchemaException(Code)(Java Doc)
public static FeatureType newFeatureType(AttributeType[] types, String name, URI ns, boolean isAbstract, FeatureType[] superTypes, GeometryAttributeType defaultGeometry) throws FactoryConfigurationError, SchemaException(Code)(Java Doc)
public static FeatureType newFeatureType(AttributeType[] types, String name, URI ns, boolean isAbstract) throws FactoryConfigurationError, SchemaException(Code)(Java Doc)
public static FeatureType newFeatureType(AttributeType[] types, String name, URI ns) throws FactoryConfigurationError, SchemaException(Code)(Java Doc)
public static FeatureType newFeatureType(AttributeType[] types, String name) throws FactoryConfigurationError, SchemaException(Code)(Java Doc)
public static FeatureType transform(FeatureType schema, CoordinateReferenceSystem crs) throws SchemaException(Code)(Java Doc)
public static FeatureType transform(FeatureType schema, CoordinateReferenceSystem crs, boolean forceOnlyMissing) throws SchemaException(Code)(Java Doc)
public static Feature transform(Feature feature, FeatureType schema, MathTransform transform) throws MismatchedDimensionException, TransformException, IllegalAttributeException(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.