Class Facet

  • All Implemented Interfaces:
    EventListener, IGProp<GProp<?>[]>, IPropCnr, java.lang.Cloneable
    Direct Known Subclasses:
    EditorFacet

    public class Facet
    extends SchemaComponent
    The Restriction Schema property container for Simple Type.

    The Facets for simple type/content that are supported:

     Constraint      Description
     --------------  -------------------------------------------------------------------------------------------------------
     enumeration     Defines a list of acceptable values
     fractionDigits  Specifies the maximum number of decimal places allowed. Must be equal to or greater than zero
     length          Specifies the exact number of characters or list items allowed. Must be equal to or greater than zero
     maxExclusive    Specifies the upper bounds for numeric values (the value must be less than this value)
     maxInclusive    Specifies the upper bounds for numeric values (the value must be less than or equal to this value)
     maxLength       Specifies the maximum number of characters or list items allowed. Must be equal to or greater than zero
     minExclusive    Specifies the lower bounds for numeric values (the value must be greater than this value)
     minInclusive    Specifies the lower bounds for numeric values (the value must be greater than or equal to this value)
     minLength       Specifies the minimum number of characters or list items allowed. Must be equal to or greater than zero
     pattern         Defines the exact sequence of characters that are acceptable
     totalDigits     Specifies the maximum number of digits allowed. Must be greater than zero
     whiteSpace      Specifies how white space (line feeds, tabs, spaces, and carriage returns) is handled
     

    Syntax:

     [restriction
     id=ID
     base=QName
     any attributes
     ]
    
     Content for simpleType:
     (annotation?,(simpleType?,(minExclusive|minInclusive|
     maxExclusive|maxInclusive|totalDigits|fractionDigits|
     length|minLength|maxLength|enumeration|whiteSpace|pattern)*))
    
     Content for simpleContent:
     (annotation?,(simpleType?,(minExclusive |minInclusive|
     maxExclusive|maxInclusive|totalDigits|fractionDigits|
     length|minLength|maxLength|enumeration|whiteSpace|pattern)*)?,
     ((attribute|attributeGroup)*,anyAttribute?)) *
    
     [/restriction]
     
    Author:
    Christopher Mindus
    • Field Detail

      • FACET_LENGTH

        public static final java.lang.String FACET_LENGTH
        Facet string for integer value: length.
        See Also:
        Constant Field Values
      • FACET_MINLENGTH

        public static final java.lang.String FACET_MINLENGTH
        Facet string for integer value: minLength.
        See Also:
        Constant Field Values
      • FACET_MAXLENGTH

        public static final java.lang.String FACET_MAXLENGTH
        Facet string for integer value: maxLength.
        See Also:
        Constant Field Values
      • FACET_TOTALDIGITS

        public static final java.lang.String FACET_TOTALDIGITS
        Facet string for integer value: totalDigits.
        See Also:
        Constant Field Values
      • FACET_FRACTIONDIGITS

        public static final java.lang.String FACET_FRACTIONDIGITS
        Facet string for integer value: fractionDigits.
        See Also:
        Constant Field Values
      • FACET_MININCLUSIVE

        public static final java.lang.String FACET_MININCLUSIVE
        Facet string for integer value: minInclusive.
        See Also:
        Constant Field Values
      • FACET_MAXINCLUSIVE

        public static final java.lang.String FACET_MAXINCLUSIVE
        Facet string for integer value: maxInclusive.
        See Also:
        Constant Field Values
      • FACET_MINEXCLUSIVE

        public static final java.lang.String FACET_MINEXCLUSIVE
        Facet string for integer value: minExclusive.
        See Also:
        Constant Field Values
      • FACET_MAXEXCLUSIVE

        public static final java.lang.String FACET_MAXEXCLUSIVE
        Facet string for integer value: maxExclusive.
        See Also:
        Constant Field Values
      • FACET_ENUMERATION

        public static final java.lang.String FACET_ENUMERATION
        Facet string for string value: enumeration.
        See Also:
        Constant Field Values
      • FACET_PATTERN

        public static final java.lang.String FACET_PATTERN
        Facet string for string value: pattern.
        See Also:
        Constant Field Values
      • FACET_WHITESPACE

        public static final java.lang.String FACET_WHITESPACE
        Facet string for string value: whiteSpace.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Facet

        public Facet()
        Creates a new unnamed Restriction property.
      • Facet

        public Facet​(Atom atom)
        Creates a new named Restriction property.
        Parameters:
        atom - The name.
    • Method Detail

      • hasStringValue

        public static boolean hasStringValue​(java.lang.String facet)
        Checks if the value is stored in a String for a facet.
        Parameters:
        facet - The facet to test.
        Returns:
        true if the value is a String, otherwise false (if numeric or unknown).
      • hasIntegerValue

        public static boolean hasIntegerValue​(java.lang.String facet)
        Checks if the value is stored in a Integer for a facet.
        Parameters:
        facet - The facet to test.
        Returns:
        true if the value is a Integer, otherwise false (if string or unknown).
      • getFacetInteger

        public java.lang.Integer getFacetInteger()
        Gets the facet Integer value.
        Returns:
        The value, or null if not present or unknown facet.
      • getFacetString

        public java.lang.String getFacetString()
        Gets the facet String value.
        Returns:
        The value, or null if not present or unknown facet.
      • isFixed

        public boolean isFixed()
        Returns true if this facet is "fixed".
        Returns:
        true or false.
      • buildMessage

        public void buildMessage​(IMessageBuilder messageBuilder,
                                 javax.xml.soap.SOAPElement parent,
                                 javax.xml.soap.SOAPElement current,
                                 boolean isProduction)
        Builds the SOAP message to send it. Facets do not build anything, they are used for validation and formatting.
        Specified by:
        buildMessage in class SchemaComponent
        Parameters:
        messageBuilder - The message builder.
        parent - The parent element.
        current - The current element, null if not already created.
        isProduction - Flag indicating the data is "production data" as opposed to sample/template.