Class XmlSchemaTypeInfo
java.lang.Object
org.apache.ws.commons.schema.walker.XmlSchemaTypeInfo
Represents an element's or attribute's type, meaning either a
XmlSchemaBaseSimpleType with facets, a union or list of them, or a
complex type.
Also maintains a QName representing a type the user recognizes. Users
attempting to convert from one schema to another may use this to track which
types in XML Schema map to their own schema types.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhat the data in thisXmlSchemaTypeInforepresents. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate XmlSchemaBaseSimpleTypeprivate List<XmlSchemaTypeInfo> private booleanprivate XmlSchemaTypeInfo.Typeprivate QName -
Constructor Summary
ConstructorsConstructorDescriptionXmlSchemaTypeInfo(boolean isMixed) Constructs a complex type whose value may or may not be mixed.XmlSchemaTypeInfo(List<XmlSchemaTypeInfo> unionTypes) Constructs a union with the set of valid types a value adhering to the union must conform to.XmlSchemaTypeInfo(List<XmlSchemaTypeInfo> unionTypes, HashMap<XmlSchemaRestriction.Type, List<XmlSchemaRestriction>> facets) Constructs a union with the set of valid types the a value adhering to the union must conform to, along with any constraining facets on the union itself.XmlSchemaTypeInfo(XmlSchemaBaseSimpleType baseSimpleType) Constructs an atomic type with theXmlSchemaBaseSimpleTypeconforming values must adhere to.XmlSchemaTypeInfo(XmlSchemaBaseSimpleType baseSimpleType, HashMap<XmlSchemaRestriction.Type, List<XmlSchemaRestriction>> facets) Constructs an atomic type with theXmlSchemaBaseSimpleTypeconforming values must adhere to, along with any additional constraining facets.XmlSchemaTypeInfo(XmlSchemaTypeInfo listType) Constructs a newXmlSchemaTypeInforepresenting a list of otherXmlSchemaTypeInfos.XmlSchemaTypeInfo(XmlSchemaTypeInfo listType, HashMap<XmlSchemaRestriction.Type, List<XmlSchemaRestriction>> facets) Constructs a list with facets. -
Method Summary
Modifier and TypeMethodDescriptionIf this represents an atomic type, returns the type.If this represents a list or a union, returns the set of children types.The set of constraining facets on the value, ornullif none.getType()The type represented by thisXmlSchemaTypeInfo.The corresponding user-defined type, ornullif none.booleanisMixed()If this is a complex type, returns whether its value is mixed.voidsetUserRecognizedType(QName userRecType) Sets the user-recognized type.toString()AStringrepresentation of thisXmlSchemaTypeInfo.
-
Field Details
-
type
-
facets
-
isMixed
private boolean isMixed -
baseSimpleType
-
userRecognizedType
-
childTypes
-
-
Constructor Details
-
XmlSchemaTypeInfo
Constructs a newXmlSchemaTypeInforepresenting a list of otherXmlSchemaTypeInfos. Lists are homogeneous, so only one type is necessary.Lists may be either of atomic types or unions of atomic types. Lists of lists are not allowed.
- Parameters:
listType- The list's type.
-
XmlSchemaTypeInfo
public XmlSchemaTypeInfo(XmlSchemaTypeInfo listType, HashMap<XmlSchemaRestriction.Type, List<XmlSchemaRestriction>> facets) Constructs a list with facets. Lists may be constrained by their length; meaning they may have aXmlSchemaRestriction.Type.LENGTHfacet, aXmlSchemaRestriction.Type.LENGTH_MINfacet, or aXmlSchemaRestriction.Type.LENGTH_MAXfacet (or bothLENGTH_MINandLENGTH_MAX).- Parameters:
listType- The list type.facets- Constraining facets on the list itself.
-
XmlSchemaTypeInfo
Constructs a union with the set of valid types a value adhering to the union must conform to.A union may either be of a set of atomic types or a set of list types, but not mixed between the two. A union of list types cannot be a type of a list.
- Parameters:
unionTypes- The set of types that a value may adhere to in order to conform to the union.
-
XmlSchemaTypeInfo
public XmlSchemaTypeInfo(List<XmlSchemaTypeInfo> unionTypes, HashMap<XmlSchemaRestriction.Type, List<XmlSchemaRestriction>> facets) Constructs a union with the set of valid types the a value adhering to the union must conform to, along with any constraining facets on the union itself.- Parameters:
unionTypes- The set of types that a value must adhere to.facets- Constraining facets on the union.
-
XmlSchemaTypeInfo
Constructs an atomic type with theXmlSchemaBaseSimpleTypeconforming values must adhere to.- Parameters:
baseSimpleType- The value type.
-
XmlSchemaTypeInfo
public XmlSchemaTypeInfo(XmlSchemaBaseSimpleType baseSimpleType, HashMap<XmlSchemaRestriction.Type, List<XmlSchemaRestriction>> facets) Constructs an atomic type with theXmlSchemaBaseSimpleTypeconforming values must adhere to, along with any additional constraining facets.- Parameters:
baseSimpleType- The value type.facets- The constraining facets on the value.
-
XmlSchemaTypeInfo
public XmlSchemaTypeInfo(boolean isMixed) Constructs a complex type whose value may or may not be mixed.- Parameters:
isMixed- Whether the element is a mixed type.
-
-
Method Details
-
getFacets
The set of constraining facets on the value, ornullif none. -
getBaseType
If this represents an atomic type, returns the type. If this is a complex type, returnsXmlSchemaBaseSimpleType.ANYTYPE. -
getType
The type represented by thisXmlSchemaTypeInfo. -
getChildTypes
If this represents a list or a union, returns the set of children types. (Lists will only have one child type.)Otherwise, returns
null. -
getUserRecognizedType
The corresponding user-defined type, ornullif none. -
isMixed
public boolean isMixed()If this is a complex type, returns whether its value is mixed. Otherwise, returnsfalse. -
setUserRecognizedType
Sets the user-recognized type.- Parameters:
userRecType- The user-recognized type.
-
toString
AStringrepresentation of thisXmlSchemaTypeInfo.
-