Class JavaType

java.lang.Object
org.jibx.schema.codegen.JavaType

public class JavaType extends Object
Java types corresponding to schema types. The schema type list here should always match that in SchemaTypes. As a special case, an instance of this class is also used to represent the special <any> schema component.
Author:
Dennis M. Sosnoski
  • Field Details

    • s_schemaTypesMap

      private static final Map s_schemaTypesMap
      Predefined schema simple type correspondences (note not all are defined yet).
    • s_anyType

      public static final JavaType s_anyType
      <any> schema component type.
    • s_anyAttributeType

      public static final JavaType s_anyAttributeType
      <anyAttribute> schema component type.
    • m_schemaName

      private final String m_schemaName
      Schema type local name (may be needed for special handling in binding - ID and IDREF, in particular).
    • m_primitiveName

      private final String m_primitiveName
      Fully qualified primitive type name (null if none).
    • m_fqName

      private final String m_fqName
      Fully qualified object type name (non-null).
    • m_format

      private final String m_format
      JiBX format name (for types requiring special handling, null otherwise).
    • m_serializerMethod

      private final String m_serializerMethod
      Method to convert instance of type to a text string.
    • m_deserializerMethod

      private final String m_deserializerMethod
      Method to convert text string to instance of type.
    • m_checkMethod

      private final String m_checkMethod
      Method to check if a text string matches the format for this type (null if unused).
  • Constructor Details

    • JavaType

      public JavaType(String slname, String pname, String fqname, String format, String ser, String dser, String check)
      Constructor supporting special handling. This uses a string value for any types without specific Java equivalents defined.
      Parameters:
      slname - schema type local name
      pname - primitive type name (null if none)
      fqname - object type fully-qualified name (non-null)
      format - JiBX format name (null if none)
      ser - fully-qualified serializer class and method name (null if none)
      dser - fully-qualified deserializer class and method name (null if none)
      check - fully-qualified check class and method name (null if none)
    • JavaType

      private JavaType(String slname, String pname, String fqname)
      Basic constructor.
      Parameters:
      slname - schema type local name
      pname - primitive type name (null if none)
      fqname - object type fully-qualified name
  • Method Details

    • addType

      private static void addType(String lname, String fqname, Map map)
      Helper method for adding object-only types to map.
      Parameters:
      lname - schema type local name
      fqname - fully-qualified java object type name
    • addType

      private static void addType(String lname, String pname, String fqname, Map map)
      Helper method for adding types without check methods to map.
      Parameters:
      lname - schema type local name
      pname - primitive type name (null if object type)
      fqname - fully-qualified java object type name
    • addType

      private static void addType(String lname, String pname, String fqname, String check, Map map)
      Helper method for creating instances and adding them to map.
      Parameters:
      lname - schema type local name
      pname - primitive type name (null if object type)
      fqname - fully-qualified java object type name (null if primitive type)
      check - check method name (null if none)
    • getTypeMap

      public static Map getTypeMap()
      Get map from schema type local name to Java type.
      Returns:
      map
    • getSchemaName

      public String getSchemaName()
      Get schema type local name. This is only required because the binding generation needs to implement special handling for ID and IDREF values.
      Returns:
      schema type local name
    • getClassName

      public String getClassName()
      Get fully-qualified object type name.
      Returns:
      fully-qualified name
    • getPrimitiveName

      public String getPrimitiveName()
      Get primitive type name.
      Returns:
      primitive type, null if none
    • getFormat

      public String getFormat()
      Get format.
      Returns:
      format
    • getSerializerMethod

      public String getSerializerMethod()
      Get serializer method name.
      Returns:
      name (null if none)
    • getDeserializerMethod

      public String getDeserializerMethod()
      Get deserializer method name.
      Returns:
      name (null if none)
    • getCheckMethod

      public String getCheckMethod()
      Get check method name.
      Returns:
      name (null if none)