Package org.jibx.custom.classes
Class ValueCustom
java.lang.Object
org.jibx.custom.classes.CustomBase
org.jibx.custom.classes.SharedValueBase
org.jibx.custom.classes.ValueCustom
Member field or property customization information.
- Author:
- Dennis M. Sosnoski
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
'field' attribute value (null
if none).private String
'get-method' attribute value (null
if none).private boolean
Private property flag.private String
'property-name' attribute value (null
if none).private String
'set-method' attribute value (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
ValueCustom
(SharedNestingBase parent) Constructor.protected
ValueCustom
(SharedNestingBase parent, String name) Constructor with name known. -
Method Summary
Modifier and TypeMethodDescriptionprivate static ValueCustom
factory
(IUnmarshallingContext ictx) Factory method for creating instances during unmarshalling.(package private) void
fillDetails
(IClassItem field, IClassItem gmeth, IClassItem smeth, IClassLocator icl, Boolean req, Integer style) Complete customization information based on either field or access method information.(package private) void
fillDetails
(IClass info, Boolean req, Integer style) Complete customization information based on whatever field or access method information has been set.Get 'field' attribute value.Get 'get-method' attribute name.Get 'property-name' attribute value.Get 'set-method' attribute name.boolean
Check if a private member.boolean
Check if member represents a property.static String
memberNameFromField
(String name, String[] prefs, String[] suffs) Get the member name for a field from the field name.static String
Get the member name for a property from the read method name.static String
Get the member name for a property from the write method name.protected void
postSet()
Post-set method that handles checking attribute combinations and sets the actual member name.protected void
preSet
(IUnmarshallingContext uctx) Make sure all attributes are defined.private void
setAttribute
(String text, IUnmarshallingContext ictx) Set attribute name method.private void
setElement
(String text, IUnmarshallingContext ictx) Set element name method.Methods inherited from class org.jibx.custom.classes.SharedValueBase
convertMemberNameCase, fillType, getActualType, getBaseName, getClassCustom, getCreateType, getFactoryMethod, getItemName, getItemType, getStatedType, getStyle, getWorkingType, getXmlName, isCollection, isElementForced, isRequired, setBaseName, setElementForced, setItemName, setItemType, setStyle, setXmlName
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_private
private boolean m_privatePrivate property flag. -
m_fieldName
'field' attribute value (null
if none). -
m_getName
'get-method' attribute value (null
if none). -
m_setName
'set-method' attribute value (null
if none). -
m_propertyName
'property-name' attribute value (null
if none).
-
-
Constructor Details
-
Method Details
-
memberNameFromGetMethod
Get the member name for a property from the read method name. This means stripping off the leading "get" or "is" prefix, then case-converting the result.- Parameters:
name
-- Returns:
- member name
- See Also:
-
memberNameFromSetMethod
Get the member name for a property from the write method name. This means stripping off the leading "set" prefix, then case-converting the result.- Parameters:
name
-- Returns:
- member name
- See Also:
-
memberNameFromField
Get the member name for a field from the field name. This means stripping off and leading field name prefix and/or trailing suffix, then case-converting the result.- Parameters:
name
-prefs
- field prefixes to be strippedsuffs
- field suffixes to be stripped- Returns:
- member name
- See Also:
-
setElement
Set element name method. This is intended for use during unmarshalling, so it needs to allow for being called with anull
value. TODO: add validation- Parameters:
text
- (null
if attribute not present)ictx
-
-
setAttribute
Set attribute name method. This is intended for use during unmarshalling, so it needs to allow for being called with anull
value. TODO: add validation- Parameters:
text
- (null
if attribute not present)ictx
-
-
isProperty
public boolean isProperty()Check if member represents a property.- Returns:
true
-
isPrivate
public boolean isPrivate()Check if a private member.- Returns:
true
if private,false
if not
-
getFieldName
Get 'field' attribute value.- Returns:
- 'field' value (
null
if none)
-
getGetName
Get 'get-method' attribute name.- Returns:
- 'get' attribute name (
null
if none)
-
getSetName
Get 'set-method' attribute name.- Returns:
- 'set-method' attribute name (
null
if none)
-
getPropertyName
Get 'property-name' attribute value.- Returns:
- property name (
null
if none)
-
preSet
Make sure all attributes are defined.- Parameters:
uctx
- unmarshalling context
-
postSet
Post-set method that handles checking attribute combinations and sets the actual member name.- Throws:
JiBXException
-
fillDetails
void fillDetails(IClassItem field, IClassItem gmeth, IClassItem smeth, IClassLocator icl, Boolean req, Integer style) Complete customization information based on either field or access method information.- Parameters:
field
- (null
if none)gmeth
- read access method (null
if none)smeth
- write access method (null
if none)icl
- class locatorreq
- required member flag (null
if unknown)style
- representation style (null
if unspecified)
-
fillDetails
Complete customization information based on whatever field or access method information has been set.- Parameters:
info
- containing class informationreq
- required member flag (null
if unknown)style
- representation style (null
if unspecified)
-
factory
Factory method for creating instances during unmarshalling.- Parameters:
ictx
-- Returns:
- instance
-