Class XSType

    • Constructor Detail

      • XSType

        public XSType()
    • Method Detail

      • isEnumerated

        public final boolean isEnumerated()
        Returns true if this XSType represents an enumerated type.
        Returns:
        True if this XSType represents an enumerated type.
      • setAsEnumerated

        public final void setAsEnumerated​(boolean enumerated)
        Sets the enumerated flag for this XSClass.
        Parameters:
        enumerated - A boolean indicating whether or not this XSClass represents an enumerated type.
      • getName

        public abstract java.lang.String getName()
        Returns the name of this XSType.
        Returns:
        The name of this XSType.
      • getType

        public abstract short getType()
        Returns the type of this XSType.
        Returns:
        the type of this XSType.
      • isPrimitive

        public abstract boolean isPrimitive()
        Returns true if this XSType represents a primitive type.
        Returns:
        True if this XSType represents a primitive type.
      • isDateTime

        public abstract boolean isDateTime()
        Returns true if the XSType represents an XML Schema date/time type.
        Returns:
        True if the XSType represents an XML Schema date/time type.
      • isCollection

        public boolean isCollection()
        Returns true if this XSType represents a collection.
        Returns:
        True if this XSType represents a collection.
      • getJType

        public abstract JType getJType()
        Returns the JType that this XSType represents.
        Returns:
        The JType that this XSType represents.
      • newInstanceCode

        public abstract java.lang.String newInstanceCode()
        Returns the Java code neccessary to create a new instance of the JType associated with this XSType.
        Returns:
        The Java code neccessary to create a new instance.
      • createToJavaObjectCode

        public abstract java.lang.String createToJavaObjectCode​(java.lang.String variableName)
        Returns the string necessary to convert an instance of this XSType to an Object. This method is really only useful for primitive types.
        Parameters:
        variableName - The name of the instance variable.
        Returns:
        The String necessary to convert an instance of this XSType to an Object.
      • createFromJavaObjectCode

        public abstract java.lang.String createFromJavaObjectCode​(java.lang.String variableName)
        Returns the string necessary to convert an Object to an instance of this XSType. This method is really only useful for primitive types.
        Parameters:
        variableName - The name of the Object.
        Returns:
        The String necessary to convert an Object to an instance of this XSType.
      • createDefaultValueWithString

        public java.lang.String createDefaultValueWithString​(java.lang.String variableName)
        Creates source code for an additional constructor that deals with default values as specified in the XML schema instance.
        Parameters:
        variableName - Name of the constructor argument.
        Returns:
        Source code for dealing with default values.
      • setFacets

        public final void setFacets​(SimpleType simpleType)
        Reads and sets the facets for XSType.
        Parameters:
        simpleType - The SimpleType containing the facets.
      • setFacet

        protected abstract void setFacet​(Facet facet)
        Set the given facet for XSType if applicable.
        Parameters:
        facet - The facet to set for XSType.
      • validationCode

        public abstract void validationCode​(JSourceCode jsc,
                                            java.lang.String fixedValue,
                                            java.lang.String validatorInstanceName)
        Creates the validation code for an instance of this XSType. If necessary the validation code should create a newly configured TypeValidator, that should then be added to a FieldValidator instance whose name is provided.
        Parameters:
        jsc - The JSourceCode to fill in.
        fixedValue - A fixed value to use if any.
        validatorInstanceName - The name of the FieldValidator that the configured TypeValidator should be added to.