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
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
FieldsModifier and TypeFieldDescriptionprivate String'actual-type' attribute value (nullif none).private StringValue name as used in code.private booleanRepeated value flag.private String'create-type' attribute value (nullif none).private booleanElement representation forced flag.private String'factory' attribute value (nullif none).private String'item-name' attribute value (nullif none).private String'item-type' attribute value (nullif none).private StringName for item elements in collection.private StringType of item values in collection.private booleanPrimitive value flag.private Boolean'required' attribute value (nullif none).private StringStated type, as used in code.private IntegerStyle used for representation (nullif unspecified and derived from type).private StringType used when working with the value (actual type from customization, if supplied, or stated type).private StringElement or attribute name from customization (nullif none).static final StringArrayEnumeration of allowed attribute namesFields 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
ConstructorsModifierConstructorDescriptionprotectedSharedValueBase(SharedNestingBase parent) Constructor.protectedSharedValueBase(SharedNestingBase parent, String name) Constructor with name known. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringconvertMemberNameCase(String name) Convert case of member name derived from name used in code.protected voidComplete customization information based on supplied type.Get 'actual-type' attribute value.Get value name as used in code.Convenience method to access the containing class customization element.Get 'create-type' attribute value.Get 'factory' attribute value.Get item element name.Get item type.Get stated type of value, as declared in code.intgetStyle()Get style code to apply to value.private StringStyle get text method.Get working type of member.Get XML element or attribute name from customization.booleanCheck if collection member.booleanCheck if element required.booleanCheck if value is required.protected voidsetBaseName(String name) Set value name as used in code.protected voidSet element required.protected voidsetItemName(String name) Set item name.protected voidsetItemType(String type) Set item type.protected voidSet style code to apply to value.voidsetXmlName(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 Details
-
s_allowedAttributes
Enumeration of allowed attribute names -
m_baseName
Value name as used in code. -
m_elementForced
private boolean m_elementForcedElement representation forced flag. -
m_statedType
Stated type, as used in code. -
m_workingType
Type used when working with the value (actual type from customization, if supplied, or stated type). -
m_itemWorkingType
Type of item values in collection. -
m_itemWorkingName
Name for item elements in collection. -
m_primitive
private boolean m_primitivePrimitive value flag. -
m_collection
private boolean m_collectionRepeated value flag. -
m_style
Style used for representation (nullif unspecified and derived from type). -
m_xmlName
Element or attribute name from customization (nullif none). -
m_actualType
'actual-type' attribute value (nullif none). -
m_createType
'create-type' attribute value (nullif none). -
m_factoryMethod
'factory' attribute value (nullif none). -
m_required
'required' attribute value (nullif none). -
m_itemType
'item-type' attribute value (nullif none). -
m_itemName
'item-name' attribute value (nullif none).
-
-
Constructor Details
-
Method Details
-
getClassCustom
Convenience method to access the containing class customization element.- Returns:
- class customization
-
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
Set value name as used in code. This is only for use by subclasses.- Parameters:
name-- See Also:
-
getStatedType
Get stated type of value, as declared in code.- Returns:
- stated type
-
getWorkingType
Get working type of member. This is the actual type from customization, if supplied, or stated type- Returns:
- working type
-
convertMemberNameCase
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
Set style code to apply to value. This method is only intended for use by subclasses.- Parameters:
style-
-
getXmlName
Get XML element or attribute name from customization.- Returns:
- name (
nullif none)
-
setXmlName
Set XML element or attribute name from customization. This method is only intended for use by subclasses.- Parameters:
name-
-
getActualType
Get 'actual-type' attribute value.- Returns:
- member actual type (
nullif none)
-
getCreateType
Get 'create-type' attribute value.- Returns:
- type used for creating new instance (
nullif none)
-
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
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
Get item type.- Returns:
- item type
-
setItemType
Set item type. This method is intended only for use by subclasses.- Parameters:
type-
-
getItemName
Get item element name.- Returns:
- item name
-
setItemName
Set item name. This method is intended only for use by subclasses.- Parameters:
name-
-
fillType
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)
-