Package org.jibx.schema.codegen
Class JavaType
java.lang.Object
org.jibx.schema.codegen.JavaType
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final String
Method to check if a text string matches the format for this type (null
if unused).private final String
Method to convert text string to instance of type.private final String
JiBX format name (for types requiring special handling,null
otherwise).private final String
Fully qualified object type name (non-null
).private final String
Fully qualified primitive type name (null
if none).private final String
Schema type local name (may be needed for special handling in binding - ID and IDREF, in particular).private final String
Method to convert instance of type to a text string.static final JavaType
<anyAttribute> schema component type.static final JavaType
<any> schema component type.private static final Map
Predefined schema simple type correspondences (note not all are defined yet). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
Helper method for creating instances and adding them to map.private static void
Helper method for adding types without check methods to map.private static void
Helper method for adding object-only types to map.Get check method name.Get fully-qualified object type name.Get deserializer method name.Get format.Get primitive type name.Get schema type local name.Get serializer method name.static Map
Get map from schema type local name to Java type.
-
Field Details
-
s_schemaTypesMap
Predefined schema simple type correspondences (note not all are defined yet). -
s_anyType
<any> schema component type. -
s_anyAttributeType
<anyAttribute> schema component type. -
m_schemaName
Schema type local name (may be needed for special handling in binding - ID and IDREF, in particular). -
m_primitiveName
Fully qualified primitive type name (null
if none). -
m_fqName
Fully qualified object type name (non-null
). -
m_format
JiBX format name (for types requiring special handling,null
otherwise). -
m_serializerMethod
Method to convert instance of type to a text string. -
m_deserializerMethod
Method to convert text string to instance of type. -
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 namepname
- 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
Basic constructor.- Parameters:
slname
- schema type local namepname
- primitive type name (null
if none)fqname
- object type fully-qualified name
-
-
Method Details
-
addType
Helper method for adding object-only types to map.- Parameters:
lname
- schema type local namefqname
- fully-qualified java object type name
-
addType
Helper method for adding types without check methods to map.- Parameters:
lname
- schema type local namepname
- primitive type name (null
if object type)fqname
- fully-qualified java object type name
-
addType
Helper method for creating instances and adding them to map.- Parameters:
lname
- schema type local namepname
- 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
Get map from schema type local name to Java type.- Returns:
- map
-
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
Get fully-qualified object type name.- Returns:
- fully-qualified name
-
getPrimitiveName
Get primitive type name.- Returns:
- primitive type,
null
if none
-
getFormat
Get format.- Returns:
- format
-
getSerializerMethod
Get serializer method name.- Returns:
- name (
null
if none)
-
getDeserializerMethod
Get deserializer method name.- Returns:
- name (
null
if none)
-
getCheckMethod
Get check method name.- Returns:
- name (
null
if none)
-