org.ofbiz.entity.model
Class ModelField

java.lang.Object
  extended by org.ofbiz.entity.model.ModelChild
      extended by org.ofbiz.entity.model.ModelField
All Implemented Interfaces:
java.io.Serializable

@ThreadSafe
public final class ModelField
extends ModelChild

An object that models the <field> element.

See Also:
Serialized Form

Method Summary
static ModelField create(ModelEntity modelEntity, DatabaseUtil.ColumnCheckInfo ccInfo, ModelFieldTypeReader modelFieldTypeReader)
          Returns a new ModelField instance, initialized with the specified values.
static ModelField create(ModelEntity modelEntity, org.w3c.dom.Element fieldElement, boolean isPk)
          Returns a new ModelField instance, initialized with the specified values.
static ModelField create(ModelEntity modelEntity, java.lang.String name, java.lang.String type, boolean isPk)
          Returns a new ModelField instance, initialized with the specified values.
static ModelField create(ModelEntity modelEntity, java.lang.String description, java.lang.String name, java.lang.String type, java.lang.String colName, java.lang.String colValue, java.lang.String fieldSet, boolean isNotNull, boolean isPk, boolean encrypt, boolean isAutoCreatedInternal, boolean enableAuditLog, java.util.List<java.lang.String> validators)
          Returns a new ModelField instance, initialized with the specified values.
 java.lang.String getColName()
          Returns the data source column name of this field.
 java.lang.String getColValue()
           
 boolean getEnableAuditLog()
          Returns true if this field is included in the entity audit log.
 boolean getEncrypt()
          Returns true if this field is encrypted.
 java.lang.String getFieldSet()
          Returns the field set name this field is a member of.
 boolean getIsAutoCreatedInternal()
          Returns true if this field was generated automatically by the entity engine.
 boolean getIsNotNull()
          Returns true if this field cannot contain null.
 boolean getIsPk()
          Returns true if this field is part of the primary key.
 java.lang.String getName()
          Returns the name of this field.
 java.lang.String getType()
          Returns the type of this field.
 java.util.List<java.lang.String> getValidators()
           
 java.lang.String toString()
           
 org.w3c.dom.Element toXmlElement(org.w3c.dom.Document document)
           
 
Methods inherited from class org.ofbiz.entity.model.ModelChild
getDescription, getModelEntity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

create

public static ModelField create(ModelEntity modelEntity,
                                java.lang.String name,
                                java.lang.String type,
                                boolean isPk)
Returns a new ModelField instance, initialized with the specified values.

Parameters:
modelEntity - The ModelEntity this field is a member of.
name - The field name.
type - The field type.
isPk - true if this field is part of the primary key.

create

public static ModelField create(ModelEntity modelEntity,
                                java.lang.String description,
                                java.lang.String name,
                                java.lang.String type,
                                java.lang.String colName,
                                java.lang.String colValue,
                                java.lang.String fieldSet,
                                boolean isNotNull,
                                boolean isPk,
                                boolean encrypt,
                                boolean isAutoCreatedInternal,
                                boolean enableAuditLog,
                                java.util.List<java.lang.String> validators)
Returns a new ModelField instance, initialized with the specified values.

Parameters:
modelEntity - The ModelEntity this field is a member of.
description - The field description.
name - The field name.
type - The field type.
colName - The data source column name for this field. Will be generated automatically if left empty.
colValue -
fieldSet - The field set name this field is a member of.
isNotNull - true if this field cannot contain a null value.
isPk - true if this field is part of the primary key.
encrypt - true if this field is encrypted.
isAutoCreatedInternal - true if this field was generated automatically by the entity engine.
enableAuditLog - true if this field is included in the entity audit log.
validators - The validators for this field.

create

public static ModelField create(ModelEntity modelEntity,
                                org.w3c.dom.Element fieldElement,
                                boolean isPk)
Returns a new ModelField instance, initialized with the specified values.

Parameters:
modelEntity - The ModelEntity this field is a member of.
fieldElement - The <field> element containing the values for this field.
isPk - true if this field is part of the primary key.

create

public static ModelField create(ModelEntity modelEntity,
                                DatabaseUtil.ColumnCheckInfo ccInfo,
                                ModelFieldTypeReader modelFieldTypeReader)
Returns a new ModelField instance, initialized with the specified values.

Parameters:
modelEntity - The ModelEntity this field is a member of.
ccInfo - The ColumnCheckInfo containing the values for this field.
modelFieldTypeReader -

getName

public java.lang.String getName()
Returns the name of this field.


getType

public java.lang.String getType()
Returns the type of this field.


getColName

public java.lang.String getColName()
Returns the data source column name of this field.


getColValue

public java.lang.String getColValue()

getIsPk

public boolean getIsPk()
Returns true if this field is part of the primary key.


getIsNotNull

public boolean getIsNotNull()
Returns true if this field cannot contain null.


getEncrypt

public boolean getEncrypt()
Returns true if this field is encrypted.


getEnableAuditLog

public boolean getEnableAuditLog()
Returns true if this field is included in the entity audit log.


getIsAutoCreatedInternal

public boolean getIsAutoCreatedInternal()
Returns true if this field was generated automatically by the entity engine.


getFieldSet

public java.lang.String getFieldSet()
Returns the field set name this field is a member of.


getValidators

public java.util.List<java.lang.String> getValidators()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toXmlElement

public org.w3c.dom.Element toXmlElement(org.w3c.dom.Document document)