Class Types
This is a set of utility methods used when implementing types.
This set of classes captures the all important how does it work questions, particularly with respect to super types.
- Author:
- Jody Garnett (Refractions Research), Justin Deoliveira (The Open Planning Project)
-
Field Summary
Fields inherited from class Types
DECLARED_NAMESPACES_MAP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanReturns true if the type is eitherxs:anyTypeor is derived fromxs:anyTypeby extension and has mixed content.static booleanisElement(ComplexType type, Name att) Return true if an attribute from a type is an element.static booleanisGeometryType(AttributeType type) static booleanReturn true if the type is either a simple type or has a simple type as its supertype.Methods inherited from class Types
assertNameAssignable, assertOrderAssignable, degloseName, descriptor, descriptor, descriptor, descriptors, descriptors, descriptors, equals, findDescriptor, findDescriptor, fromNames, fromTypeNames, isSuperType, isValid, names, parse, parse, toNames, toPrefixedName, toQName, toQName, toTypeName, toTypeNames, typeName, typeName, typeName, validate, validate, validate, validate, validate, validate, validate, validate, validate
-
Constructor Details
-
Types
public Types()
-
-
Method Details
-
isElement
Return true if an attribute from a type is an element.- Parameters:
type- The type to search in.att- The attribute name.- Returns:
- True if the attribute exists in the type and is an element.
-
isSimpleContentType
Return true if the type is either a simple type or has a simple type as its supertype. In particular, complex types with simple content will return true. -
isGeometryType
-
canHaveTextContent
Returns true if the type is eitherxs:anyTypeor is derived fromxs:anyTypeby extension and has mixed content.Example:
<complexType name="TestType"> <complexContent> <extension base="anyType"> <attribute name="attr1" type="string" /> </extension> </complexContent> </complexType>
-