Class XSType

java.lang.Object
org.exolab.castor.builder.types.XSType
Direct Known Subclasses:
AbstractPatternFacet, XSClass, XSListType

public abstract class XSType extends Object
The base XML Schema Type class.
Version:
$Revision: 7943 $ $Date: 2005-03-05 06:42:06 -0700 (Sat, 05 Mar 2005) $
Author:
Keith Visco, Ralf Joachim
  • Field Details

  • Constructor Details

    • XSType

      public XSType()
  • Method Details

    • 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 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 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 String createToJavaObjectCode(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 String createFromJavaObjectCode(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 String createDefaultValueWithString(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, String fixedValue, 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.