public class FieldImpl extends Object implements Field
Constructor and Description |
---|
FieldImpl(QName name,
Type declaringType,
Type type) |
FieldImpl(QName name,
Type declaringType,
Type type,
String defaultValue,
int flags) |
FieldImpl(QName name,
Type declaringType,
Type type,
String defaultValue,
int flags,
Collection<Constraint> constraints) |
Modifier and Type | Method and Description |
---|---|
Set<Constraint> |
getConstraints() |
Type |
getDeclaringType()
Gets the complex type or list 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() |
public FieldImpl(QName name, Type declaringType, Type type, String defaultValue, int flags, Collection<Constraint> constraints)
public Type getDeclaringType()
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.
getDeclaringType
in interface Field
public Object getDefaultValue()
Field
getDefaultValue
in interface Field
public boolean isNillable()
Field
isNillable
in interface Field
public boolean isConstant()
Field
isConstant
in interface Field
public void setDefaultValue(String value)
Field
setDefaultValue
in interface Field
value
- the value to setpublic void setNillable(boolean isNillable)
Field
setNillable
in interface Field
public void setConstant(boolean isConstant)
Field
setConstant
in interface Field
public int getMaxOccurs()
Field
By default this is 1. -1 is returned if not a maximum limit is imposed.
getMaxOccurs
in interface Field
public int getMinOccurs()
Field
By default this is 1.
getMinOccurs
in interface Field
public void setMaxOccurs(int max)
Field
setMaxOccurs
in interface Field
max
- max number of occurrencespublic void setMinOccurs(int min)
Field
setMinOccurs
in interface Field
min
- min number of occurrencespublic int getMaxLength()
Field
Value -1 means no constraint.
getMaxLength
in interface Field
public void setMaxLength(int length)
Field
setMaxLength
in interface Field
length
- the length, or -1 for no constraintpublic Set<Constraint> getConstraints()
getConstraints
in interface Field
Copyright © 2018 Nuxeo. All rights reserved.