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
-
public class ValueCustom extends SharedValueBase
Member field or property customization information.- Author:
- Dennis M. Sosnoski
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringm_fieldName'field' attribute value (nullif none).private java.lang.Stringm_getName'get-method' attribute value (nullif none).private booleanm_privatePrivate property flag.private java.lang.Stringm_propertyName'property-name' attribute value (nullif none).private java.lang.Stringm_setName'set-method' attribute value (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 protectedValueCustom(SharedNestingBase parent)Constructor.protectedValueCustom(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 private static ValueCustomfactory(IUnmarshallingContext ictx)Factory method for creating instances during unmarshalling.(package private) voidfillDetails(IClassItem field, IClassItem gmeth, IClassItem smeth, IClassLocator icl, java.lang.Boolean req, java.lang.Integer style)Complete customization information based on either field or access method information.(package private) voidfillDetails(IClass info, java.lang.Boolean req, java.lang.Integer style)Complete customization information based on whatever field or access method information has been set.java.lang.StringgetFieldName()Get 'field' attribute value.java.lang.StringgetGetName()Get 'get-method' attribute name.java.lang.StringgetPropertyName()Get 'property-name' attribute value.java.lang.StringgetSetName()Get 'set-method' attribute name.booleanisPrivate()Check if a private member.booleanisProperty()Check if member represents a property.static java.lang.StringmemberNameFromField(java.lang.String name, java.lang.String[] prefs, java.lang.String[] suffs)Get the member name for a field from the field name.static java.lang.StringmemberNameFromGetMethod(java.lang.String name)Get the member name for a property from the read method name.static java.lang.StringmemberNameFromSetMethod(java.lang.String name)Get the member name for a property from the write method name.protected voidpostSet()Post-set method that handles checking attribute combinations and sets the actual member name.protected voidpreSet(IUnmarshallingContext uctx)Make sure all attributes are defined.private voidsetAttribute(java.lang.String text, IUnmarshallingContext ictx)Set attribute name method.private voidsetElement(java.lang.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 Detail
-
s_allowedAttributes
public static final StringArray s_allowedAttributes
Enumeration of allowed attribute names
-
m_private
private boolean m_private
Private property flag.
-
m_fieldName
private java.lang.String m_fieldName
'field' attribute value (nullif none).
-
m_getName
private java.lang.String m_getName
'get-method' attribute value (nullif none).
-
m_setName
private java.lang.String m_setName
'set-method' attribute value (nullif none).
-
m_propertyName
private java.lang.String m_propertyName
'property-name' attribute value (nullif none).
-
-
Constructor Detail
-
ValueCustom
protected ValueCustom(SharedNestingBase parent)
Constructor.- Parameters:
parent-
-
ValueCustom
protected ValueCustom(SharedNestingBase parent, java.lang.String name)
Constructor with name known.- Parameters:
parent-name-
-
-
Method Detail
-
memberNameFromGetMethod
public static java.lang.String memberNameFromGetMethod(java.lang.String name)
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:
SharedValueBase.convertMemberNameCase(String),memberNameFromSetMethod(String),memberNameFromField(String, String[], String[])
-
memberNameFromSetMethod
public static java.lang.String memberNameFromSetMethod(java.lang.String name)
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:
SharedValueBase.convertMemberNameCase(String),memberNameFromGetMethod(String),memberNameFromField(String, String[], String[])
-
memberNameFromField
public static java.lang.String memberNameFromField(java.lang.String name, java.lang.String[] prefs, java.lang.String[] suffs)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:
SharedValueBase.convertMemberNameCase(String),memberNameFromGetMethod(String),memberNameFromSetMethod(String)
-
setElement
private void setElement(java.lang.String text, IUnmarshallingContext ictx)Set element name method. This is intended for use during unmarshalling, so it needs to allow for being called with anullvalue. TODO: add validation- Parameters:
text- (nullif attribute not present)ictx-
-
setAttribute
private void setAttribute(java.lang.String text, IUnmarshallingContext ictx)Set attribute name method. This is intended for use during unmarshalling, so it needs to allow for being called with anullvalue. TODO: add validation- Parameters:
text- (nullif 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:
trueif private,falseif not
-
getFieldName
public java.lang.String getFieldName()
Get 'field' attribute value.- Returns:
- 'field' value (
nullif none)
-
getGetName
public java.lang.String getGetName()
Get 'get-method' attribute name.- Returns:
- 'get' attribute name (
nullif none)
-
getSetName
public java.lang.String getSetName()
Get 'set-method' attribute name.- Returns:
- 'set-method' attribute name (
nullif none)
-
getPropertyName
public java.lang.String getPropertyName()
Get 'property-name' attribute value.- Returns:
- property name (
nullif none)
-
preSet
protected void preSet(IUnmarshallingContext uctx)
Make sure all attributes are defined.- Parameters:
uctx- unmarshalling context
-
postSet
protected void postSet() throws JiBXExceptionPost-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, java.lang.Boolean req, java.lang.Integer style)
Complete customization information based on either field or access method information.- Parameters:
field- (nullif none)gmeth- read access method (nullif none)smeth- write access method (nullif none)icl- class locatorreq- required member flag (nullif unknown)style- representation style (nullif unspecified)
-
fillDetails
void fillDetails(IClass info, java.lang.Boolean req, java.lang.Integer style)
Complete customization information based on whatever field or access method information has been set.- Parameters:
info- containing class informationreq- required member flag (nullif unknown)style- representation style (nullif unspecified)
-
factory
private static ValueCustom factory(IUnmarshallingContext ictx)
Factory method for creating instances during unmarshalling.- Parameters:
ictx-- Returns:
- instance
-
-