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 StringMethod to check if a text string matches the format for this type (nullif unused).private final StringMethod to convert text string to instance of type.private final StringJiBX format name (for types requiring special handling,nullotherwise).private final StringFully qualified object type name (non-null).private final StringFully qualified primitive type name (nullif none).private final StringSchema type local name (may be needed for special handling in binding - ID and IDREF, in particular).private final StringMethod 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 MapPredefined schema simple type correspondences (note not all are defined yet). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidHelper method for creating instances and adding them to map.private static voidHelper method for adding types without check methods to map.private static voidHelper 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 MapGet 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 (nullif none). -
m_fqName
Fully qualified object type name (non-null). -
m_format
JiBX format name (for types requiring special handling,nullotherwise). -
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 (nullif 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 (nullif none)fqname- object type fully-qualified name (non-null)format- JiBX format name (nullif none)ser- fully-qualified serializer class and method name (nullif none)dser- fully-qualified deserializer class and method name (nullif none)check- fully-qualified check class and method name (nullif none)
-
JavaType
Basic constructor.- Parameters:
slname- schema type local namepname- primitive type name (nullif 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 (nullif 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 (nullif object type)fqname- fully-qualified java object type name (nullif primitive type)check- check method name (nullif 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,
nullif none
-
getFormat
Get format.- Returns:
- format
-
getSerializerMethod
Get serializer method name.- Returns:
- name (
nullif none)
-
getDeserializerMethod
Get deserializer method name.- Returns:
- name (
nullif none)
-
getCheckMethod
Get check method name.- Returns:
- name (
nullif none)
-