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)
    • Constructor Detail

      • Types

        public Types()
    • 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 either xs:anyType or is derived from xs:anyType by extension and has mixed content.

        Example:

          <complexType name="TestType">
            <complexContent>
              <extension base="anyType">
                <attribute name="attr1" type="string" />
              </extension>
            </complexContent>
          </complexType>