Class RestrictionSimpleTypeImpl

    • Field Detail

      • facets

        private final java.util.List<XSFacet> facets
    • Method Detail

      • addFacet

        public void addFacet​(XSFacet facet)
      • getDeclaredFacet

        public XSFacet getDeclaredFacet​(java.lang.String name)
        Description copied from interface: XSRestrictionSimpleType
        Gets the declared facet object of the given name.

        This method returns a facet object that is added in this type and does not recursively check the ancestors.

        For those facets that can have multiple values (pattern facets and enumeration facets), this method will return only the first one.

        Specified by:
        getDeclaredFacet in interface XSRestrictionSimpleType
        Returns:
        Null if the facet is not specified in the last step of derivation.
      • getDeclaredFacets

        public java.util.List<XSFacet> getDeclaredFacets​(java.lang.String name)
        Description copied from interface: XSRestrictionSimpleType
        Gets the declared facets of the given name. This method is for those facets (such as 'pattern') that can be specified multiple times on a simple type.
        Specified by:
        getDeclaredFacets in interface XSRestrictionSimpleType
        Returns:
        can be empty but never be null.
      • getFacet

        public XSFacet getFacet​(java.lang.String name)
        Description copied from interface: XSSimpleType
        Gets the effective facet object of the given name.

        For example, if a simple type "foo" is derived from xs:string by restriction with the "maxLength" facet and another simple type "bar" is derived from "foo" by restriction with another "maxLength" facet, this method will return the latter one, because that is the most restrictive, effective facet.

        For those facets that can have multiple values (pattern facets and enumeration facets), this method will return only the first one. TODO: allow clients to access all of them by some means.

        Specified by:
        getFacet in interface XSSimpleType
        Returns:
        If this datatype has a facet of the given name, return that object. If the facet is not specified anywhere in its derivation chain, null will be returned.
      • isPrimitive

        public boolean isPrimitive()
        Description copied from interface: XSSimpleType
        Returns true if this is a primitive built-in simple type (that directly derives from xs:anySimpleType, by definition.)
        Specified by:
        isPrimitive in interface XSSimpleType
        Overrides:
        isPrimitive in class SimpleTypeImpl