public class ClassCustom extends NestingBase implements IApply
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ELEMENT_NAME
Element name in XML customization file.
|
static int |
FORM_ABSTRACT_MAPPING |
static int |
FORM_CONCRETE_MAPPING |
static int |
FORM_DEFAULT |
static int |
FORM_STRING |
private java.util.ArrayList |
m_children |
private IClass |
m_classInformation |
private java.lang.String |
m_createType |
private java.lang.String |
m_deserializer |
private java.lang.String |
m_elementName |
private QName |
m_elementQName |
private java.lang.String |
m_enumValueMethod |
private java.lang.String[] |
m_excludes |
private java.lang.String |
m_factoryMethod |
private int |
m_form |
private java.lang.String[] |
m_includes |
private boolean |
m_isApplied |
private InsertionOrderedMap |
m_memberMap |
private java.lang.String |
m_name |
private java.lang.String[] |
m_optionals |
private java.lang.String[] |
m_requireds |
private java.lang.String |
m_serializer |
private java.lang.String |
m_typeName |
private QName |
m_typeQName |
private boolean |
m_useSuper |
static StringArray |
s_allowedAttributes
Enumeration of allowed attribute names
|
static EnumSet |
s_representationEnum |
ATTRIBUTE_STYLE_INTEGER, ATTRIBUTE_VALUE_STYLE, ELEMENT_STYLE_INTEGER, ELEMENT_VALUE_STYLE, s_valueStyleEnum
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 and Description |
---|
ClassCustom(NestingBase parent,
java.lang.String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addChild(CustomBase child)
Add child.
|
void |
apply(IClassLocator icl)
Apply customizations to class to fill out members.
|
private static void |
classifyNames(java.lang.String[] names,
java.util.Set elems,
java.util.Set attrs)
Classify an array of names as elements or attributes, based on leading flag characters ('@' for an attribute,
'<' for an element).
|
private java.lang.String |
findPropertyType(IClassItem gmeth,
IClassItem smeth,
IClassLocator icl)
Find the most specific type for a property based on the access methods.
|
java.util.List |
getChildren()
Get list of children.
|
IClass |
getClassInformation()
Get actual class information.
|
java.lang.String |
getCreateType()
Get the type name to be used when creating an instance of this class.
|
java.lang.String |
getDeserializer()
Get deserializer method.
|
java.lang.String |
getElementName()
Get the element name to be used for this class in a concrete mapping.
|
QName |
getElementQName()
Get the qualified element name to be used for this class in a concrete mapping.
|
java.lang.String |
getEnumValueMethod()
Get the method used to retrieve the text value for an enum class.
|
java.lang.String[] |
getExcludes()
Get list of names to be excluded from class representation.
|
java.lang.String |
getFactoryMethod()
Get the factory method to be used when creating an instance of this class.
|
int |
getForm()
Get the representation code.
|
private java.lang.String |
getFormText()
Form get text method.
|
java.lang.String[] |
getIncludes()
Get list of names to be included in class representation.
|
ValueCustom |
getMember(java.lang.String name)
Get customization information for a member by name.
|
java.util.Collection |
getMembers()
Get collection of members in class.
|
java.lang.String |
getName()
Get fully-qualified class name.
|
java.lang.String |
getSerializer()
Get serializer method.
|
java.lang.String |
getSimpleName()
Get simple class name.
|
java.lang.String |
getTypeName()
Get the type name to be used for this class in an abstract mapping.
|
QName |
getTypeQName()
Get the qualified type name to be used for this class in an abstract mapping.
|
boolean |
isAbstractMappingForced()
Check if abstract mapping required for class.
|
boolean |
isConcreteClass()
Check if this is a directly instantiable class (not an interface, and not abstract)
|
boolean |
isConcreteMappingForced()
Check if concrete mapping required for class.
|
boolean |
isSimpleValue()
Check if class represents a simple text value.
|
boolean |
isUseSuper()
Check for superclass to be included in binding.
|
private java.util.Map |
mapFields(IClassItem[] fields,
java.lang.String[] prefs,
java.lang.String[] suffs,
java.util.Set inclset,
java.util.Set exclset)
Build map from member names to fields.
|
private java.util.Map |
mapPropertyReadMethods(IClassItem[] methods,
java.util.Set inclset,
java.util.Set exclset)
Build map from member names to read access methods.
|
private java.util.Map |
mapPropertyWriteMethods(IClassItem[] methods,
java.util.Set inclset,
java.util.Set exclset)
Build map from member names to write access methods.
|
private void |
preSet(IUnmarshallingContext uctx)
Make sure all attributes are defined.
|
void |
setCreateType(java.lang.String type)
Set the type name to be used when creating an instance of this class.
|
private void |
setFormText(java.lang.String text,
IUnmarshallingContext ictx)
Form set text method.
|
private static java.lang.String[] |
stripNames(java.lang.String[] names)
Utility method to strip any leading non-alphanumeric characters from an array of name strings.
|
getStripPrefixes, getStripSuffixes, getValueStyle, isForceMapping, isForceStructureNames, isMapAbstract, isPropertyAccess, isWrapCollections, setMapAbstract, setValueStyle
convertName, getFormatterClass, getNamespace, getNamespaceStyle, getNameStyle, getSpecifiedNamespace, isObjectRequired, isPrimitiveRequired, isUseJavaDocs, setNamespace, setNamespaceStyle, setNameStyle
convertName, deriveItemName, deriveNamespace, getContainingObject, getGlobal, getParent, packageOfType, packageToNamespace, validateAttributes
public static final StringArray s_allowedAttributes
public static final java.lang.String ELEMENT_NAME
public static final int FORM_DEFAULT
public static final int FORM_CONCRETE_MAPPING
public static final int FORM_ABSTRACT_MAPPING
public static final int FORM_STRING
public static final EnumSet s_representationEnum
private java.lang.String m_name
private java.lang.String m_elementName
private java.lang.String m_typeName
private java.lang.String m_createType
private java.lang.String m_factoryMethod
private java.lang.String m_enumValueMethod
private int m_form
private java.lang.String[] m_includes
private java.lang.String[] m_excludes
private boolean m_useSuper
private java.lang.String[] m_requireds
private java.lang.String[] m_optionals
private java.lang.String m_serializer
private java.lang.String m_deserializer
private final java.util.ArrayList m_children
private boolean m_isApplied
private QName m_typeQName
private QName m_elementQName
private IClass m_classInformation
private InsertionOrderedMap m_memberMap
ClassCustom(NestingBase parent, java.lang.String name)
parent
- name
- class simple name (without package)private void preSet(IUnmarshallingContext uctx)
uctx
- unmarshalling contextpublic java.lang.String getName()
public java.lang.String getSimpleName()
public java.lang.String getElementName()
public QName getElementQName()
public java.lang.String getTypeName()
public java.lang.String getCreateType()
public void setCreateType(java.lang.String type)
type
- public java.lang.String getSerializer()
public java.lang.String getDeserializer()
public java.lang.String getEnumValueMethod()
public java.lang.String getFactoryMethod()
public QName getTypeQName()
public int getForm()
s_representationEnum
enumerationpublic java.lang.String[] getExcludes()
null
if none)public java.lang.String[] getIncludes()
null
if none)public boolean isUseSuper()
true
if superclass included, false
if notpublic boolean isConcreteClass()
true
if instantiable, false
if notpublic boolean isSimpleValue()
public boolean isAbstractMappingForced()
public boolean isConcreteMappingForced()
public java.util.List getChildren()
protected void addChild(CustomBase child)
child
- private void setFormText(java.lang.String text, IUnmarshallingContext ictx)
text
- ictx
- private java.lang.String getFormText()
private java.util.Map mapPropertyReadMethods(IClassItem[] methods, java.util.Set inclset, java.util.Set exclset)
methods
- inclset
- set of member names to be included (null
if not specified)exclset
- set of member names to be excluded (null
if not specified, ignored if inclset is
non-null
)private java.util.Map mapPropertyWriteMethods(IClassItem[] methods, java.util.Set inclset, java.util.Set exclset)
methods
- inclset
- set of member names to be included (null
if not specified)exclset
- set of member names to be excluded (null
if not specified, ignored if inclset is
non-null
)private java.util.Map mapFields(IClassItem[] fields, java.lang.String[] prefs, java.lang.String[] suffs, java.util.Set inclset, java.util.Set exclset)
fields
- prefs
- prefixes to be stripped in deriving namessuffs
- suffixes to be stripped in deriving namesinclset
- set of member names to be included (null
if not specified)exclset
- set of member names to be excluded (null
if not specified, ignored if inclset is
non-null
)private java.lang.String findPropertyType(IClassItem gmeth, IClassItem smeth, IClassLocator icl)
gmeth
- read access method (null
if not defined)smeth
- write access method (null
if not defined)icl
- private static java.lang.String[] stripNames(java.lang.String[] names)
names
- (null
if none)null
if none)private static void classifyNames(java.lang.String[] names, java.util.Set elems, java.util.Set attrs)
names
- (null
if none)elems
- set of element namesattrs
- set of attribute namespublic void apply(IClassLocator icl)
public ValueCustom getMember(java.lang.String name)
apply(IClassLocator)
.name
- null
if nonepublic IClass getClassInformation()
apply(IClassLocator)
.public java.util.Collection getMembers()