Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.schema.types
Class FieldImpl

java.lang.Object
  extended by org.nuxeo.ecm.core.schema.types.FieldImpl
All Implemented Interfaces:
Serializable, Field

public class FieldImpl
extends Object
implements Field

Author:
Bogdan Stefanescu
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.nuxeo.ecm.core.schema.types.Field
CONSTANT, NILLABLE
 
Constructor Summary
FieldImpl(QName name, TypeRef<? extends Type> declaringType, TypeRef<? extends Type> type)
           
FieldImpl(QName name, TypeRef<? extends Type> declaringType, TypeRef<? extends Type> type, String defaultValue, int flags)
           
FieldImpl(QName name, Type declaringType, Type type)
           
 
Method Summary
 ComplexType getDeclaringType()
          Gets the complex type that declared this field.
 Object getDefaultValue()
          Gets this field default value or null if none.
 int getMaxLength()
          Gets the maximum length for this field.
 int getMaxOccurs()
          Gets the maximum number this field may occurs in the owner type.
 int getMinOccurs()
          Gets the minimum number this field may occurs in the owner type.
 QName getName()
          Gets the field name.
 Type getType()
          Gets the field type.
 boolean isConstant()
          Checks whether this field is constant (is read only).
 boolean isNillable()
          Checks whether this field is nillable (can have null values).
 void setConstant(boolean isConstant)
          Sets the constant flag.
 void setDefaultValue(String value)
          Sets the default value of this field.
 void setMaxLength(int length)
          Sets the maximum length for this field.
 void setMaxOccurs(int max)
          Sets max number of occurrences for this field.
 void setMinOccurs(int min)
          Sets min number of occurrences for this field.
 void setNillable(boolean isNillable)
          Sets the nillable flag.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FieldImpl

public FieldImpl(QName name,
                 Type declaringType,
                 Type type)

FieldImpl

public FieldImpl(QName name,
                 TypeRef<? extends Type> declaringType,
                 TypeRef<? extends Type> type)

FieldImpl

public FieldImpl(QName name,
                 TypeRef<? extends Type> declaringType,
                 TypeRef<? extends Type> type,
                 String defaultValue,
                 int flags)
Method Detail

getDeclaringType

public ComplexType getDeclaringType()
Description copied from interface: Field
Gets the complex type that declared this field.

The declaring type may differ from the complex type owning this field.

For example, in the case of a derived complex type, the field is owned by both the derived type and the base type, but it's declared only by the base type.

Specified by:
getDeclaringType in interface Field
Returns:
the complex that declared this field

getName

public QName getName()
Description copied from interface: Field
Gets the field name.

Specified by:
getName in interface Field
Returns:
the field name

getType

public Type getType()
Description copied from interface: Field
Gets the field type.

Specified by:
getType in interface Field
Returns:
the field type

getDefaultValue

public Object getDefaultValue()
Description copied from interface: Field
Gets this field default value or null if none.

Specified by:
getDefaultValue in interface Field
Returns:
the default value if any was specified, null otherwise

isNillable

public boolean isNillable()
Description copied from interface: Field
Checks whether this field is nillable (can have null values).

Specified by:
isNillable in interface Field
Returns:
true if the field can have null values

isConstant

public boolean isConstant()
Description copied from interface: Field
Checks whether this field is constant (is read only).

Specified by:
isConstant in interface Field
Returns:
true if the field is constant false otherwise

setDefaultValue

public void setDefaultValue(String value)
Description copied from interface: Field
Sets the default value of this field.

Specified by:
setDefaultValue in interface Field
Parameters:
value - the value to set

setNillable

public void setNillable(boolean isNillable)
Description copied from interface: Field
Sets the nillable flag.

Specified by:
setNillable in interface Field

setConstant

public void setConstant(boolean isConstant)
Description copied from interface: Field
Sets the constant flag.

Specified by:
setConstant in interface Field

getMaxOccurs

public int getMaxOccurs()
Description copied from interface: Field
Gets the maximum number this field may occurs in the owner type.

By default this is 1. -1 is returned if not a maximum limit is imposed.

Specified by:
getMaxOccurs in interface Field
Returns:
the max occurrences

getMinOccurs

public int getMinOccurs()
Description copied from interface: Field
Gets the minimum number this field may occurs in the owner type.

By default this is 1.

Specified by:
getMinOccurs in interface Field
Returns:
the min occurrences

setMaxOccurs

public void setMaxOccurs(int max)
Description copied from interface: Field
Sets max number of occurrences for this field.

Specified by:
setMaxOccurs in interface Field
Parameters:
max - max number of occurrences

setMinOccurs

public void setMinOccurs(int min)
Description copied from interface: Field
Sets min number of occurrences for this field.

Specified by:
setMinOccurs in interface Field
Parameters:
min - min number of occurrences

getMaxLength

public int getMaxLength()
Description copied from interface: Field
Gets the maximum length for this field.

Value -1 means no constraint.

Specified by:
getMaxLength in interface Field
Returns:
the length

setMaxLength

public void setMaxLength(int length)
Description copied from interface: Field
Sets the maximum length for this field.

Specified by:
setMaxLength in interface Field
Parameters:
length - the length, or -1 for no constraint

toString

public String toString()
Overrides:
toString in class Object

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.