Package org.jibx.custom.classes
Class SharedValueBase
- java.lang.Object
-
- org.jibx.custom.classes.CustomBase
-
- org.jibx.custom.classes.SharedValueBase
-
- Direct Known Subclasses:
ValueCustom,ValueCustom
public class SharedValueBase extends CustomBase
Base class for all value customization information. This includes inherited values shared with customization extensions (in particular, the WSDL extensions). TODO: should this include more of the WSDL ValueCustom extensions? Look into how type mappings are handled in the BindGen code (uses bound type in WSDL)- Author:
- Dennis M. Sosnoski
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringm_actualType'actual-type' attribute value (nullif none).private java.lang.Stringm_baseNameValue name as used in code.private booleanm_collectionRepeated value flag.private java.lang.Stringm_createType'create-type' attribute value (nullif none).private booleanm_elementForcedElement representation forced flag.private java.lang.Stringm_factoryMethod'factory' attribute value (nullif none).private java.lang.Stringm_itemName'item-name' attribute value (nullif none).private java.lang.Stringm_itemType'item-type' attribute value (nullif none).private java.lang.Stringm_itemWorkingNameName for item elements in collection.private java.lang.Stringm_itemWorkingTypeType of item values in collection.private booleanm_primitivePrimitive value flag.private java.lang.Booleanm_required'required' attribute value (nullif none).private java.lang.Stringm_statedTypeStated type, as used in code.private java.lang.Integerm_styleStyle used for representation (nullif unspecified and derived from type).private java.lang.Stringm_workingTypeType used when working with the value (actual type from customization, if supplied, or stated type).private java.lang.Stringm_xmlNameElement or attribute name from customization (nullif none).static StringArrays_allowedAttributesEnumeration of allowed attribute names-
Fields inherited from class org.jibx.custom.classes.CustomBase
CAMEL_CASE_NAMES, DERIVE_BY_PACKAGE, DERIVE_FIXED, DERIVE_NONE, DOTTED_NAMES, HYPHENATED_NAMES, REQUIRE_ALL, REQUIRE_NONE, REQUIRE_OBJECTS, REQUIRE_PRIMITIVES, s_namespaceStyleEnum, s_nameStyleEnum, s_requireEnum, UNDERSCORED_NAMES, UPPER_CAMEL_CASE_NAMES
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSharedValueBase(SharedNestingBase parent)Constructor.protectedSharedValueBase(SharedNestingBase parent, java.lang.String name)Constructor with name known.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.StringconvertMemberNameCase(java.lang.String name)Convert case of member name derived from name used in code.protected voidfillType(IClass info, java.lang.Boolean req, java.lang.Integer style)Complete customization information based on supplied type.java.lang.StringgetActualType()Get 'actual-type' attribute value.java.lang.StringgetBaseName()Get value name as used in code.ClassCustomgetClassCustom()Convenience method to access the containing class customization element.java.lang.StringgetCreateType()Get 'create-type' attribute value.java.lang.StringgetFactoryMethod()Get 'factory' attribute value.java.lang.StringgetItemName()Get item element name.java.lang.StringgetItemType()Get item type.java.lang.StringgetStatedType()Get stated type of value, as declared in code.intgetStyle()Get style code to apply to value.private java.lang.StringgetStyleText()Style get text method.java.lang.StringgetWorkingType()Get working type of member.java.lang.StringgetXmlName()Get XML element or attribute name from customization.booleanisCollection()Check if collection member.booleanisElementForced()Check if element required.booleanisRequired()Check if value is required.protected voidsetBaseName(java.lang.String name)Set value name as used in code.protected voidsetElementForced()Set element required.protected voidsetItemName(java.lang.String name)Set item name.protected voidsetItemType(java.lang.String type)Set item type.protected voidsetStyle(java.lang.Integer style)Set style code to apply to value.voidsetXmlName(java.lang.String name)Set XML element or attribute name from customization.-
Methods inherited from class org.jibx.custom.classes.CustomBase
convertName, deriveItemName, deriveNamespace, getContainingObject, getGlobal, getParent, packageOfType, packageToNamespace, validateAttributes
-
-
-
-
Field Detail
-
s_allowedAttributes
public static final StringArray s_allowedAttributes
Enumeration of allowed attribute names
-
m_baseName
private java.lang.String m_baseName
Value name as used in code.
-
m_elementForced
private boolean m_elementForced
Element representation forced flag.
-
m_statedType
private java.lang.String m_statedType
Stated type, as used in code.
-
m_workingType
private java.lang.String m_workingType
Type used when working with the value (actual type from customization, if supplied, or stated type).
-
m_itemWorkingType
private java.lang.String m_itemWorkingType
Type of item values in collection.
-
m_itemWorkingName
private java.lang.String m_itemWorkingName
Name for item elements in collection.
-
m_primitive
private boolean m_primitive
Primitive value flag.
-
m_collection
private boolean m_collection
Repeated value flag.
-
m_style
private java.lang.Integer m_style
Style used for representation (nullif unspecified and derived from type).
-
m_xmlName
private java.lang.String m_xmlName
Element or attribute name from customization (nullif none).
-
m_actualType
private java.lang.String m_actualType
'actual-type' attribute value (nullif none).
-
m_createType
private java.lang.String m_createType
'create-type' attribute value (nullif none).
-
m_factoryMethod
private java.lang.String m_factoryMethod
'factory' attribute value (nullif none).
-
m_required
private java.lang.Boolean m_required
'required' attribute value (nullif none).
-
m_itemType
private java.lang.String m_itemType
'item-type' attribute value (nullif none).
-
m_itemName
private java.lang.String m_itemName
'item-name' attribute value (nullif none).
-
-
Constructor Detail
-
SharedValueBase
protected SharedValueBase(SharedNestingBase parent)
Constructor.- Parameters:
parent-
-
SharedValueBase
protected SharedValueBase(SharedNestingBase parent, java.lang.String name)
Constructor with name known.- Parameters:
parent-name-
-
-
Method Detail
-
getClassCustom
public ClassCustom getClassCustom()
Convenience method to access the containing class customization element.- Returns:
- class customization
-
getBaseName
public java.lang.String getBaseName()
Get value name as used in code. This is the actual name with any prefix or suffix stripped and the initial letter converted to lowercase unless the second letter is uppercase.- Returns:
- name
-
setBaseName
protected void setBaseName(java.lang.String name)
Set value name as used in code. This is only for use by subclasses.- Parameters:
name-- See Also:
getBaseName()
-
getStatedType
public java.lang.String getStatedType()
Get stated type of value, as declared in code.- Returns:
- stated type
-
getWorkingType
public java.lang.String getWorkingType()
Get working type of member. This is the actual type from customization, if supplied, or stated type- Returns:
- working type
-
convertMemberNameCase
public static java.lang.String convertMemberNameCase(java.lang.String name)
Convert case of member name derived from name used in code. If the supplied name starts with an uppercase letter followed by a lowercase letter, the initial letter is converted to lowercase in order to obtain a standard form of the name.- Parameters:
name-- Returns:
- converted name
-
getStyle
public int getStyle()
Get style code to apply to value.- Returns:
- value from
NestingBase.s_valueStyleEnumenumeration
-
setStyle
protected void setStyle(java.lang.Integer style)
Set style code to apply to value. This method is only intended for use by subclasses.- Parameters:
style-
-
getXmlName
public java.lang.String getXmlName()
Get XML element or attribute name from customization.- Returns:
- name (
nullif none)
-
setXmlName
public void setXmlName(java.lang.String name)
Set XML element or attribute name from customization. This method is only intended for use by subclasses.- Parameters:
name-
-
getActualType
public java.lang.String getActualType()
Get 'actual-type' attribute value.- Returns:
- member actual type (
nullif none)
-
getCreateType
public java.lang.String getCreateType()
Get 'create-type' attribute value.- Returns:
- type used for creating new instance (
nullif none)
-
getFactoryMethod
public java.lang.String getFactoryMethod()
Get 'factory' attribute value.- Returns:
- method used for creating new instance (
nullif none)
-
isRequired
public boolean isRequired()
Check if value is required.- Returns:
trueif required,falseif not
-
isElementForced
public boolean isElementForced()
Check if element required. This is really only relevant when the value represents a collection of child elements, since it means a wrapper element is needed.- Returns:
trueif element required,falseif not
-
setElementForced
protected void setElementForced()
Set element required. This method is only intended for use by subclasses.
-
getStyleText
private java.lang.String getStyleText()
Style get text method. This is intended for use during marshalling. TODO: add validation- Returns:
- text
-
isCollection
public boolean isCollection()
Check if collection member.- Returns:
trueif collection,falseif not
-
getItemType
public java.lang.String getItemType()
Get item type.- Returns:
- item type
-
setItemType
protected void setItemType(java.lang.String type)
Set item type. This method is intended only for use by subclasses.- Parameters:
type-
-
getItemName
public java.lang.String getItemName()
Get item element name.- Returns:
- item name
-
setItemName
protected void setItemName(java.lang.String name)
Set item name. This method is intended only for use by subclasses.- Parameters:
name-
-
fillType
protected void fillType(IClass info, java.lang.Boolean req, java.lang.Integer style)
Complete customization information based on supplied type. If the type information has not previously been set, this will set it. It will also derive the appropriate XML name, if not previously set. This method is only intended for use by subclasses.- Parameters:
info- value type informationreq- required member flag (nullif unspecified)style- representation style (nullif unspecified)
-
-