org.vfny.geoserver.global.dto
Class AttributeTypeInfoDTO

java.lang.Object
  extended byorg.vfny.geoserver.global.dto.AttributeTypeInfoDTO
All Implemented Interfaces:
java.lang.Cloneable, DataTransferObject

public class AttributeTypeInfoDTO
extends java.lang.Object
implements DataTransferObject

Represents most of a xs:element for an XMLSchema.

we have three types of information to store, Schema defined types, references and extentions on types. If the type represented is either a reference or a Schema defined type then isRef should be true.

Non-complex types are of the form:

For complex types such as {element name='test'}{xs:complexContent}{xs:extension base="gml:AbstractFeatureType"}{xs:sequence}{xs:element name="id" type="xs:string" minOccurs="0"/}{xs:element ref="gml:pointProperty" minOccurs="0"/}{/xs:sequence}{/xs:extension}{/xs:complexContent}{/element} The type contains a similar XML fragment.

minOccurs, maxOccurs and nillable are all attributes for all cases. There is more stuff in the XMLSchema spec but we don't care.


Constructor Summary
AttributeTypeInfoDTO()
          AttributeTypeInfoDTO constructor.
AttributeTypeInfoDTO(AttributeTypeInfoDTO dto)
          AttributeTypeInfoDTO constructor.
 
Method Summary
 java.lang.Object clone()
          Implement clone.
 boolean equals(java.lang.Object obj)
          Implement equals.
 int getMaxOccurs()
          getMaxOccurs purpose.
 int getMinOccurs()
          getMinOccurs purpose.
 java.lang.String getName()
          getName purpose.
 java.lang.String getType()
          getType purpose.
 int hashCode()
          Implement hashCode.
 boolean isComplex()
          isRef purpose.
 boolean isNillable()
          isNillable purpose.
 void setComplex(boolean b)
          setRef purpose.
 void setMaxOccurs(int i)
          setMaxOccurs purpose.
 void setMinOccurs(int i)
          setMinOccurs purpose.
 void setName(java.lang.String string)
          setName purpose.
 void setNillable(boolean b)
          setNillable purpose.
 void setType(java.lang.String string)
          setType purpose.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeTypeInfoDTO

public AttributeTypeInfoDTO()
AttributeTypeInfoDTO constructor.

Default constructor, does nothing


AttributeTypeInfoDTO

public AttributeTypeInfoDTO(AttributeTypeInfoDTO dto)
AttributeTypeInfoDTO constructor.

Copies the data from the specified DTO to this one.

Parameters:
dto - AttributeTypeInfoDTO The data source to copy from.
Method Detail

equals

public boolean equals(java.lang.Object obj)
Implement equals.

true when the data contained inside the objects is the same.

Specified by:
equals in interface DataTransferObject
Parameters:
obj - an instance of AttributeTypeInfoDTO to compare
Returns:
true when they are the same, false otherwise
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Implement hashCode.

The hashcode for this object.

Specified by:
hashCode in interface DataTransferObject
Returns:
a hashcode value.
See Also:
Object.hashCode()

clone

public java.lang.Object clone()
Implement clone.

An instance of AttributeTypeInfoDTO which is the same as this one.

Specified by:
clone in interface DataTransferObject
Returns:
Object a copy of this object.
See Also:
Object.clone()

isComplex

public boolean isComplex()
isRef purpose.

Returns is this is a reference element type or a document defined type.

Returns:
true when either a ref or XMLSchema type.

getMaxOccurs

public int getMaxOccurs()
getMaxOccurs purpose.

The max number of occurences for this element.

Returns:
max number of occurences

getMinOccurs

public int getMinOccurs()
getMinOccurs purpose.

the min number of occurences for this element

Returns:
min number of occurences

getName

public java.lang.String getName()
getName purpose.

returns the element name

Returns:
the element name

isNillable

public boolean isNillable()
isNillable purpose.

Description ...

Returns:

getType

public java.lang.String getType()
getType purpose.

returns the element type. This is an XML fragment if isRef() returns false.

Returns:
the element type. This is an XML fragment if isRef() returns false.

setComplex

public void setComplex(boolean b)
setRef purpose.

Sets whether this is a reference type element or not

Parameters:
b - true when this is a reference type element.

setMaxOccurs

public void setMaxOccurs(int i)
setMaxOccurs purpose.

Stores the max occurs for the element

Parameters:
i - the max occurs for the element

setMinOccurs

public void setMinOccurs(int i)
setMinOccurs purpose.

Stores the min occurs for the element

Parameters:
i - the min occurs for the element

setName

public void setName(java.lang.String string)
setName purpose.

Stores the name for the element

Parameters:
string - the name for the element

setNillable

public void setNillable(boolean b)
setNillable purpose.

Stores if this element is nillable

Parameters:
b - true when this element is nillable

setType

public void setType(java.lang.String string)
setType purpose.

Stores the type for this element. This is an XML fragment when isRef() returns false.

Parameters:
string - type for this element. This is an XML fragment when isRef() returns false.