public class CompositeTypeImpl extends ComplexTypeImpl implements CompositeType
F_UNSTRUCT_DEFAULT, F_UNSTRUCT_FALSE, F_UNSTRUCT_TRUE
EMPTY_SUPERTYPES, F_NOTNULL, F_READONLY
Constructor and Description |
---|
CompositeTypeImpl(CompositeType superType,
String schema,
String name,
String[] schemas) |
CompositeTypeImpl(TypeRef<? extends CompositeType> superType,
String schema,
String name,
String[] schemas) |
Modifier and Type | Method and Description |
---|---|
Field |
addField(QName name,
TypeRef<? extends Type> type)
Adds a field to this complex type.
|
void |
addSchema(Schema schema)
Adds a schema.
|
void |
addSchema(String schema)
Adds a schema.
|
Field |
getField(QName name)
Gets the field having the given name.
|
Field |
getField(String name)
Gets the field with the given name.
|
Collection<Field> |
getFields()
Gets all fields as a (field name, field type) map.
|
TypeRef<? extends CompositeType> |
getRef()
Gets a proxy (or reference to this type).
|
Schema |
getSchema(String name)
Gets the composite type schema given its name.
|
Schema |
getSchemaByPrefix(String prefix)
Finds the composite type schema given the schema prefix.
|
String[] |
getSchemaNames()
Gets the schema names of this type.
|
Collection<Schema> |
getSchemas()
Gets all the schemas (including inherited schemas) of this composite type.
|
boolean |
hasField(QName name)
Tests whether this type defines the given field name.
|
boolean |
hasField(String name)
Tests whether this type defines the given field name.
|
boolean |
hasSchema(String name)
Checks if this composite type has the given schema.
|
boolean |
hasSchemas()
Checks if this composite type has any schema defined.
|
boolean |
isComplexType()
Tests whether this type is a complex type.
|
boolean |
isCompositeType()
Tests whether this is a composite type.
|
boolean |
validate(Object object)
Tests whether the given object is of this type.
|
addField, addField, addField, canonicalXPath, convert, getFieldsCount, getNamespace, hasFields, isUnstructured, newInstance, toString
decode, encode, getName, getSchema, getSchemaName, getSuperType, getTypeHierarchy, isAny, isAnyType, isListType, isNotNull, isReadOnly, isSimpleType, isSuperTypeOf, setNotNull, setReadOnly
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
addField, addField, addField, getFieldsCount, getNamespace, hasFields, isUnstructured
convert, decode, encode, getName, getSchema, getSchemaName, getSuperType, getTypeHierarchy, isAnyType, isListType, isNotNull, isReadOnly, isSimpleType, isSuperTypeOf, newInstance
public CompositeTypeImpl(CompositeType superType, String schema, String name, String[] schemas)
public CompositeTypeImpl(TypeRef<? extends CompositeType> superType, String schema, String name, String[] schemas)
public final boolean hasSchemas()
CompositeType
hasSchemas
in interface CompositeType
public final void addSchema(String schema)
CompositeType
addSchema
in interface CompositeType
schema
- the schema name to addpublic final void addSchema(Schema schema)
CompositeType
addSchema
in interface CompositeType
schema
- the schema to addpublic final Schema getSchema(String name)
CompositeType
getSchema
in interface CompositeType
name
- the schema namepublic final Schema getSchemaByPrefix(String prefix)
CompositeType
getSchemaByPrefix
in interface CompositeType
prefix
- the schema prefixpublic final boolean hasSchema(String name)
CompositeType
hasSchema
in interface CompositeType
name
- the schema namepublic final String[] getSchemaNames()
CompositeType
getSchemaNames
in interface CompositeType
public final Collection<Schema> getSchemas()
CompositeType
getSchemas
in interface CompositeType
public final Field addField(QName name, TypeRef<? extends Type> type)
ComplexType
addField
in interface ComplexType
addField
in class ComplexTypeImpl
name
- the field nametype
- the field typepublic final Field getField(String name)
ComplexType
If the name is non-prefixed the first matching field is returned if any is found. If the name is prefixed then the right field is returned if any is found.
getField
in interface ComplexType
getField
in class ComplexTypeImpl
name
- the field namepublic final Field getField(QName name)
ComplexType
getField
in interface ComplexType
getField
in class ComplexTypeImpl
name
- the namepublic final boolean hasField(String name)
ComplexType
The name is supposed to be non prefixed.
hasField
in interface ComplexType
hasField
in class ComplexTypeImpl
name
- the field namepublic final boolean hasField(QName name)
ComplexType
hasField
in interface ComplexType
hasField
in class ComplexTypeImpl
name
- the field namepublic final Collection<Field> getFields()
ComplexType
getFields
in interface ComplexType
getFields
in class ComplexTypeImpl
public final boolean isComplexType()
Type
isComplexType
in interface Type
isComplexType
in class ComplexTypeImpl
public final boolean isCompositeType()
Type
isCompositeType
in interface Type
isCompositeType
in class AbstractType
public final boolean validate(Object object)
Type
validate
in interface Type
validate
in class ComplexTypeImpl
object
- the object to testpublic TypeRef<? extends CompositeType> getRef()
Type
getRef
in interface ComplexType
getRef
in interface CompositeType
getRef
in interface Type
getRef
in class ComplexTypeImpl
Copyright © 2012 Nuxeo SA. All Rights Reserved.