com.esri.core.map
Class Field

java.lang.Object
  extended by com.esri.core.map.Field
All Implemented Interfaces:
Serializable

public class Field
extends Object
implements Serializable

The Field class represents a field of a feature layer. It includes name, alias, type and domain information of the field. Domain is optional.

Since:
1.0
See Also:
Serialized Form

Field Summary
static int esriFieldTypeBlob
          define an esri Blob field.
static int esriFieldTypeDate
          define an esri Date field.
static int esriFieldTypeDouble
          define an esri double field.
static int esriFieldTypeGeometry
          define an esri geometry field.
static int esriFieldTypeGlobalID
          define an esri Gloval ID field.
static int esriFieldTypeGUID
          define an esri GUID field.
static int esriFieldTypeInteger
          define an esri integer field.
static int esriFieldTypeOID
          define an esri Object ID field.
static int esriFieldTypeRaster
          define an esri Raster field.
static int esriFieldTypeSingle
          define an esri single field.
static int esriFieldTypeSmallInteger
          define an esri small integer field.
static int esriFieldTypeString
          define an esri String field.
static int esriFieldTypeXML
          define an esri Raster field.
 
Constructor Summary
Field()
          Instantiates an empty Field.
Field(String name, String alias, String type)
          Instantiates a Field with the given values.
Field(String name, String alias, String type, Domain domain)
          Instantiates a Field with the given values.
 
Method Summary
static Field fromJson(org.codehaus.jackson.JsonParser parser)
          Decodes objects from JSON representation.
 String getAlias()
          Gets the alias of the Field.
 Domain getDomain()
          Gets the domain of the Field.
 int getFieldType()
          Gets the type of the Field.
 int getLength()
          Gets the length of the Field.
 String getName()
          Gets the name of the Field.
 boolean isEditable()
          Gets the editable of the Field.
 boolean isNullable()
           
static String toEsriFieldType(int esriFieldType)
          Returns the String representation for the given field integer constant.
static int toFieldType(String esriFieldType)
          Return the integer constant for the given field string type. return -1 if it is not valid.
static String toJson(Field field)
          Serializing the Field object into Json String.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

esriFieldTypeInteger

public static final int esriFieldTypeInteger
define an esri integer field.

See Also:
Constant Field Values

esriFieldTypeSmallInteger

public static final int esriFieldTypeSmallInteger
define an esri small integer field.

See Also:
Constant Field Values

esriFieldTypeDouble

public static final int esriFieldTypeDouble
define an esri double field.

See Also:
Constant Field Values

esriFieldTypeSingle

public static final int esriFieldTypeSingle
define an esri single field.

See Also:
Constant Field Values

esriFieldTypeDate

public static final int esriFieldTypeDate
define an esri Date field.

See Also:
Constant Field Values

esriFieldTypeString

public static final int esriFieldTypeString
define an esri String field.

See Also:
Constant Field Values

esriFieldTypeGeometry

public static final int esriFieldTypeGeometry
define an esri geometry field.

See Also:
Constant Field Values

esriFieldTypeOID

public static final int esriFieldTypeOID
define an esri Object ID field.

See Also:
Constant Field Values

esriFieldTypeBlob

public static final int esriFieldTypeBlob
define an esri Blob field.

See Also:
Constant Field Values

esriFieldTypeGlobalID

public static final int esriFieldTypeGlobalID
define an esri Gloval ID field.

See Also:
Constant Field Values

esriFieldTypeGUID

public static final int esriFieldTypeGUID
define an esri GUID field.

See Also:
Constant Field Values

esriFieldTypeRaster

public static final int esriFieldTypeRaster
define an esri Raster field.

See Also:
Constant Field Values

esriFieldTypeXML

public static final int esriFieldTypeXML
define an esri Raster field.

See Also:
Constant Field Values
Constructor Detail

Field

public Field()
Instantiates an empty Field.

Since:
1.0

Field

public Field(String name,
             String alias,
             String type)
      throws Exception
Instantiates a Field with the given values.

Parameters:
name - the name of the field.
alias - the alias of the field.
type - the data type.
Throws:
Exception - the exception
Since:
1.0

Field

public Field(String name,
             String alias,
             String type,
             Domain domain)
      throws Exception
Instantiates a Field with the given values.

Parameters:
name - the name of the field.
alias - the alias of the field.
type - the data type.
domain - the domain of the field.
Throws:
Exception - the exception
Since:
1.0
Method Detail

getName

public String getName()
Gets the name of the Field.

Returns:
Returns the name.
Since:
1.0

toString

public String toString()
Overrides:
toString in class Object

getAlias

public String getAlias()
Gets the alias of the Field.

Returns:
Returns the alias.
Since:
1.0

getFieldType

public int getFieldType()
Gets the type of the Field.

Returns:
Returns the type.
Since:
1.0

isEditable

public boolean isEditable()
Gets the editable of the Field.

Returns:
Returns the editable.
Since:
1.0

isNullable

public boolean isNullable()
Returns:
the nullable
Since:
10.1.1

getLength

public int getLength()
Gets the length of the Field.

Returns:
Returns the length.
Since:
1.0

getDomain

public Domain getDomain()
Gets the domain of the Field.

Returns:
Returns the domain.
Since:
1.0

fromJson

public static Field fromJson(org.codehaus.jackson.JsonParser parser)
                      throws Exception
Decodes objects from JSON representation.

Parameters:
parser - the Jackson parser holding the JSON data.
Returns:
the decoded object from JSON representation.
Throws:
Exception - the exception
Since:
1.0

toJson

public static String toJson(Field field)
                     throws Exception
Serializing the Field object into Json String.

Parameters:
field - a Field object.
Returns:
a Json String representing the field object.
Throws:
Exception - An exception thrown the object cannot be serialized into json string.
Since:
1.0

toFieldType

public static int toFieldType(String esriFieldType)
Return the integer constant for the given field string type. return -1 if it is not valid.

Parameters:
esriFieldType - eg: {esriFieldTypeInteger esriFieldTypeInteger, etc}
Returns:
true an constant integer
Since:
1.0

toEsriFieldType

public static String toEsriFieldType(int esriFieldType)
Returns the String representation for the given field integer constant.

Parameters:
esriFieldType - constants integer
Returns:
String predefined esri field type.
Since:
1.0


Copyright © 2012. All Rights Reserved.