Class Types
-
public class Types extends 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 Constructor Description Types()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
canHaveTextContent(PropertyType type)
Returns true if the type is eitherxs:anyType
or is derived fromxs:anyType
by extension and has mixed content.static boolean
isElement(ComplexType type, Name att)
Return true if an attribute from a type is an element.static boolean
isGeometryType(AttributeType type)
static boolean
isSimpleContentType(PropertyType type)
Return 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
-
-
-
-
Method Detail
-
isElement
public static boolean isElement(ComplexType type, Name att)
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
public static boolean isSimpleContentType(PropertyType type)
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
public static boolean isGeometryType(AttributeType type)
-
canHaveTextContent
public static boolean canHaveTextContent(PropertyType type)
Returns true if the type is eitherxs:anyType
or is derived fromxs:anyType
by extension and has mixed content.Example:
<complexType name="TestType"> <complexContent> <extension base="anyType"> <attribute name="attr1" type="string" /> </extension> </complexContent> </complexType>
-
-