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 (null
if none).private String
Value name as used in code.private boolean
Repeated value flag.private String
'create-type' attribute value (null
if none).private boolean
Element representation forced flag.private String
'factory' attribute value (null
if none).private String
'item-name' attribute value (null
if none).private String
'item-type' attribute value (null
if none).private String
Name for item elements in collection.private String
Type of item values in collection.private boolean
Primitive value flag.private Boolean
'required' attribute value (null
if none).private String
Stated type, as used in code.private Integer
Style used for representation (null
if unspecified and derived from type).private String
Type used when working with the value (actual type from customization, if supplied, or stated type).private String
Element or attribute name from customization (null
if none).static final StringArray
Enumeration 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
ConstructorsModifierConstructorDescriptionprotected
SharedValueBase
(SharedNestingBase parent) Constructor.protected
SharedValueBase
(SharedNestingBase parent, String name) Constructor with name known. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
convertMemberNameCase
(String name) Convert case of member name derived from name used in code.protected void
Complete 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.int
getStyle()
Get style code to apply to value.private String
Style get text method.Get working type of member.Get XML element or attribute name from customization.boolean
Check if collection member.boolean
Check if element required.boolean
Check if value is required.protected void
setBaseName
(String name) Set value name as used in code.protected void
Set element required.protected void
setItemName
(String name) Set item name.protected void
setItemType
(String type) Set item type.protected void
Set style code to apply to value.void
setXmlName
(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 (null
if unspecified and derived from type). -
m_xmlName
Element or attribute name from customization (null
if none). -
m_actualType
'actual-type' attribute value (null
if none). -
m_createType
'create-type' attribute value (null
if none). -
m_factoryMethod
'factory' attribute value (null
if none). -
m_required
'required' attribute value (null
if none). -
m_itemType
'item-type' attribute value (null
if none). -
m_itemName
'item-name' attribute value (null
if 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_valueStyleEnum
enumeration
-
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 (
null
if 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 (
null
if none)
-
getCreateType
Get 'create-type' attribute value.- Returns:
- type used for creating new instance (
null
if none)
-
getFactoryMethod
Get 'factory' attribute value.- Returns:
- method used for creating new instance (
null
if none)
-
isRequired
public boolean isRequired()Check if value is required.- Returns:
true
if required,false
if 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:
true
if element required,false
if 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:
true
if collection,false
if 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 (null
if unspecified)style
- representation style (null
if unspecified)
-