Package org.jibx.schema.codegen.custom
Class SchemaRootBase.ExtensionUnmarshaller
- java.lang.Object
-
- org.jibx.schema.codegen.custom.SchemaRootBase.ExtensionUnmarshaller
-
- All Implemented Interfaces:
IUnmarshaller
- Direct Known Subclasses:
SchemaRootBase.ClassDecoratorUnmarshaller
,SchemaRootBase.NameConverterUnmarshaller
- Enclosing class:
- SchemaRootBase
public abstract static class SchemaRootBase.ExtensionUnmarshaller extends java.lang.Object implements IUnmarshaller
Unmarshaller for extension elements. This expects to find a 'class' attribute giving the name of the class to be created, along with other attributes used to set properties on an instance of the class. The latter attributes are handled by converting the attribute name into a field (with an 'm_' prefix) or method (with a 'set' prefix) name, then storing the value to that field or method.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
m_name
-
Constructor Summary
Constructors Constructor Description ExtensionUnmarshaller(java.lang.String name)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract java.lang.Object
createInstance(java.lang.String cname, UnmarshallingContext ctx)
Instance creation method.boolean
isPresent(IUnmarshallingContext ictx)
Check for element present.java.lang.Object
unmarshal(java.lang.Object obj, IUnmarshallingContext ictx)
Unmarshal instance of element.
-
-
-
Method Detail
-
createInstance
protected abstract java.lang.Object createInstance(java.lang.String cname, UnmarshallingContext ctx)
Instance creation method. This is called by theunmarshal(Object, IUnmarshallingContext)
method to create the actual object instance to be handled. Subclasses must implement this method to create the instance and perform any appropriate initialization.- Parameters:
cname
- class name from element (null
if not supplied)ctx
- unmarshalling context- Returns:
- object instance to be unmarshalled, or
null
if error
-
isPresent
public boolean isPresent(IUnmarshallingContext ictx) throws JiBXException
Check for element present.- Specified by:
isPresent
in interfaceIUnmarshaller
- Parameters:
ictx
-- Returns:
true
if present,false
if not- Throws:
JiBXException
- on error
-
unmarshal
public java.lang.Object unmarshal(java.lang.Object obj, IUnmarshallingContext ictx) throws JiBXException
Unmarshal instance of element. This ignores the 'class' attribute, if present, since that's intended for use by the subclass.- Specified by:
unmarshal
in interfaceIUnmarshaller
- Parameters:
obj
- ignored (new instance always created)ictx
-- Returns:
- unmarshalled instance
- Throws:
JiBXException
- on error
-
-