public class

Field

extends Object
implements Serializable
java.lang.Object
   ↳ com.esri.core.map.Field

Class Overview

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

Summary

Constants
int esriFieldTypeBlob define an esri Blob field.
int esriFieldTypeDate define an esri Date field.
int esriFieldTypeDouble define an esri double field.
int esriFieldTypeGUID define an esri GUID field.
int esriFieldTypeGeometry define an esri geometry field.
int esriFieldTypeGlobalID define an esri Gloval ID field.
int esriFieldTypeInteger define an esri integer field.
int esriFieldTypeOID define an esri Object ID field.
int esriFieldTypeRaster define an esri Raster field.
int esriFieldTypeSingle define an esri single field.
int esriFieldTypeSmallInteger define an esri small integer field.
int esriFieldTypeString define an esri String field.
int esriFieldTypeXML define an esri Raster field.
Public Constructors
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.
Public Methods
static Field fromJson(JsonParser parser)
Decodes objects from JSON representation.
static List<Field> fromJson(String fieldsJson)
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.
static String toJson(Field field)
Serializing the Field object into Json String.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int esriFieldTypeBlob

define an esri Blob field.

Constant Value: 90 (0x0000005a)

public static final int esriFieldTypeDate

define an esri Date field.

Constant Value: 50 (0x00000032)

public static final int esriFieldTypeDouble

define an esri double field.

Constant Value: 30 (0x0000001e)

public static final int esriFieldTypeGUID

define an esri GUID field.

Constant Value: 110 (0x0000006e)

public static final int esriFieldTypeGeometry

define an esri geometry field.

Constant Value: 70 (0x00000046)

public static final int esriFieldTypeGlobalID

define an esri Gloval ID field.

Constant Value: 100 (0x00000064)

public static final int esriFieldTypeInteger

define an esri integer field.

Constant Value: 10 (0x0000000a)

public static final int esriFieldTypeOID

define an esri Object ID field.

Constant Value: 80 (0x00000050)

public static final int esriFieldTypeRaster

define an esri Raster field.

Constant Value: 120 (0x00000078)

public static final int esriFieldTypeSingle

define an esri single field.

Constant Value: 40 (0x00000028)

public static final int esriFieldTypeSmallInteger

define an esri small integer field.

Constant Value: 20 (0x00000014)

public static final int esriFieldTypeString

define an esri String field.

Constant Value: 60 (0x0000003c)

public static final int esriFieldTypeXML

define an esri Raster field.

Constant Value: 130 (0x00000082)

Public Constructors

public Field ()

Instantiates an empty Field.

public Field (String name, String alias, String type)

Instantiates a Field with the given values.

Parameters
name String: the name of the field.
alias String: the alias of the field.
type String: the data type.
Throws
Exception the exception

public Field (String name, String alias, String type, Domain domain)

Instantiates a Field with the given values.

Parameters
name String: the name of the field.
alias String: the alias of the field.
type String: the data type.
domain Domain: the domain of the field.
Throws
Exception the exception

Public Methods

public static Field fromJson (JsonParser parser)

Decodes objects from JSON representation.

Parameters
parser JsonParser: the Jackson parser holding the JSON data.
Returns
Field the decoded object from JSON representation.
Throws
Exception the exception

public static List<Field> fromJson (String fieldsJson)

Parameters
fieldsJson String
Returns
List<Field>
Throws
Exception
Exception

public String getAlias ()

Gets the alias of the Field.

Returns
String Returns the alias.

public Domain getDomain ()

Gets the domain of the Field.

Returns
Domain Returns the domain.

public int getFieldType ()

Gets the type of the Field.

Returns
int Returns the type.

public int getLength ()

Gets the length of the Field.

Returns
int Returns the length.

public String getName ()

Gets the name of the Field.

Returns
String Returns the name.

public boolean isEditable ()

Gets the editable of the Field.

Returns
boolean Returns the editable.

public boolean isNullable ()

Returns
boolean the nullable

public static String toEsriFieldType (int esriFieldType)

Returns the String representation for the given field integer constant.

Parameters
esriFieldType int: constants integer
Returns
String String predefined esri field type.

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 String: eg: {esriFieldTypeInteger esriFieldTypeInteger, etc}
Returns
int true an constant integer

public static String toJson (Field field)

Serializing the Field object into Json String.

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

public String toString ()

Returns
String