com.ebmwebsourcing.easybox.impl
Class AbstractJaxbXmlObjectImpl<Model extends AbstractJaxbModelObject>

java.lang.Object
  extended by com.ebmwebsourcing.easybox.impl.AbstractXmlObjectNodeImpl<Model>
      extended by com.ebmwebsourcing.easybox.impl.AbstractXmlObjectImpl<Model>
          extended by com.ebmwebsourcing.easybox.impl.AbstractJaxbXmlObjectImpl<Model>
All Implemented Interfaces:
com.ebmwebsourcing.easybox.api.XmlObject, com.ebmwebsourcing.easybox.api.XmlObjectNode, java.lang.Comparable<com.ebmwebsourcing.easybox.api.XmlObjectNode>

public abstract class AbstractJaxbXmlObjectImpl<Model extends AbstractJaxbModelObject>
extends AbstractXmlObjectImpl<Model>


Field Summary
protected static javax.xml.namespace.QName ANY_QNAME
           
 
Fields inherited from interface com.ebmwebsourcing.easybox.api.XmlObject
EMPTY_ARRAY
 
Constructor Summary
protected AbstractJaxbXmlObjectImpl(com.ebmwebsourcing.easybox.api.XmlContext xmlContext, Model jaxbModel)
           
 
Method Summary
protected
<Object> void
addToAny(java.util.List<Object> jaxbChildrenList, com.ebmwebsourcing.easybox.api.XmlObject childXmlObject)
          Add a new implementation of XmlObject to any list.
protected
<J> void
addToChildren(java.util.List<J> jaxbChildrenList, com.ebmwebsourcing.easybox.api.XmlObjectNode childXmlObject)
          Add a new implementation of XmlObject to underlying model children list.
protected  void clearChildren(java.util.List<?> jaxbChildrenList, java.lang.Class<?> filterClass, javax.xml.namespace.QName filterQName)
          Clear objects of a given class from underlying JAXB children list.
protected  com.ebmwebsourcing.easybox.api.XmlObject[] createChildrenArray(java.util.List<?> jaxbChildrenList, java.lang.Class<?> filterClass, javax.xml.namespace.QName filterQName)
           
protected
<X extends com.ebmwebsourcing.easybox.api.XmlObjectNode>
X[]
createChildrenArray(java.util.List<?> jaxbChildrenList, java.lang.Class<?> filterClass, javax.xml.namespace.QName filterQName, java.lang.Class<X> xmlObjectInterfaceClass)
          Create XmlObject children array for a parent XmlObject and an underlying JAXB filter class.
protected  Model createCompliantModel()
           
protected
<X extends com.ebmwebsourcing.easybox.api.with.WithName>
X
getChildByName(X[] children, java.lang.String name)
          Get an XmlObject child by its name.
 com.ebmwebsourcing.easybox.api.XmlObjectNode[] getXmlObjectAdoptedChildren()
           
 java.util.Map<javax.xml.namespace.QName,java.lang.Object> getXmlObjectAttributes()
           
 org.w3c.dom.Node getXmlObjectDOMNode()
           
 com.ebmwebsourcing.easybox.api.XmlObjectNode[] getXmlObjectNaturalChildren()
           
 javax.xml.namespace.QName getXmlObjectQName()
           
protected  void removeFromChildren(java.util.List<?> jaxbChildrenList, com.ebmwebsourcing.easybox.api.XmlObjectNode xmlObjectChild)
           
protected  void setChild(com.ebmwebsourcing.easybox.api.XmlObject child, java.lang.Class<? extends com.ebmwebsourcing.easybox.api.XmlObject> xmlObjectInterfaceClass)
           
 void setXmlObjectQName(javax.xml.namespace.QName qname)
           
 java.lang.String toString()
           
 
Methods inherited from class com.ebmwebsourcing.easybox.impl.AbstractXmlObjectImpl
adaptModelObjectIfNecessary, adoptChild, adoptChild, doCreateAdoptableChild, duplicateXmlObject, duplicateXmlObjectAs, equals, getCompliantModelClass, getXmlObjectBaseURI, getXmlObjectInScopeNamespaces, getXmlObjectValue, onAdoptiveParentChange, onNaturalParentChange
 
Methods inherited from class com.ebmwebsourcing.easybox.impl.AbstractXmlObjectNodeImpl
compareTo, getModelObject, getUserData, getXmlContext, getXmlObjectAncestors, getXmlObjectBaseIndexes, getXmlObjectBaseRoot, getXmlObjectBaseXPath, getXmlObjectChildren, getXmlObjectDescendants, getXmlObjectFollowing, getXmlObjectFollowingSibling, getXmlObjectFollowingSiblings, getXmlObjectIndex, getXmlObjectParent, getXmlObjectPreceding, getXmlObjectPrecedingOrAncestor, getXmlObjectPrecedingSibling, getXmlObjectPrecedingSiblings, getXmlObjectRoot, getXmlObjectTextContent, hashCode, hasUserData, setModelObject, setUserData
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ebmwebsourcing.easybox.api.XmlObject
getXmlContext
 
Methods inherited from interface com.ebmwebsourcing.easybox.api.XmlObjectNode
getUserData, getXmlObjectAncestors, getXmlObjectBaseIndexes, getXmlObjectBaseRoot, getXmlObjectBaseXPath, getXmlObjectChildren, getXmlObjectDescendants, getXmlObjectFollowing, getXmlObjectFollowingSibling, getXmlObjectFollowingSiblings, getXmlObjectIndex, getXmlObjectParent, getXmlObjectPreceding, getXmlObjectPrecedingOrAncestor, getXmlObjectPrecedingSibling, getXmlObjectPrecedingSiblings, getXmlObjectRoot, getXmlObjectTextContent, hasUserData, setUserData
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

ANY_QNAME

protected static final javax.xml.namespace.QName ANY_QNAME
Constructor Detail

AbstractJaxbXmlObjectImpl

protected AbstractJaxbXmlObjectImpl(com.ebmwebsourcing.easybox.api.XmlContext xmlContext,
                                    Model jaxbModel)
Method Detail

getXmlObjectQName

public javax.xml.namespace.QName getXmlObjectQName()

setXmlObjectQName

public void setXmlObjectQName(javax.xml.namespace.QName qname)

createCompliantModel

protected Model createCompliantModel()
Specified by:
createCompliantModel in class AbstractXmlObjectNodeImpl<Model extends AbstractJaxbModelObject>

addToChildren

protected final <J> void addToChildren(java.util.List<J> jaxbChildrenList,
                                       com.ebmwebsourcing.easybox.api.XmlObjectNode childXmlObject)
Add a new implementation of XmlObject to underlying model children list.

Type Parameters:
J - Type of JAXB children.
Parameters:
jaxbChildrenList - List of underlying JAXB children.
xmlObjectImplChild - XmlObject child to add.

addToAny

protected final <Object> void addToAny(java.util.List<Object> jaxbChildrenList,
                                       com.ebmwebsourcing.easybox.api.XmlObject childXmlObject)
Add a new implementation of XmlObject to any list.

Type Parameters:
Object - Type of JAXB children.
Parameters:
jaxbChildrenList - List of underlying JAXB children.
xmlObjectImplChild - XmlObject child to add.

setChild

protected final void setChild(com.ebmwebsourcing.easybox.api.XmlObject child,
                              java.lang.Class<? extends com.ebmwebsourcing.easybox.api.XmlObject> xmlObjectInterfaceClass)

clearChildren

protected final void clearChildren(java.util.List<?> jaxbChildrenList,
                                   java.lang.Class<?> filterClass,
                                   javax.xml.namespace.QName filterQName)
Clear objects of a given class from underlying JAXB children list.

Parameters:
jaxbChildrenList - List of underlying JAXB children.
filterClass - Class of model objects to remove from list.
filterQName - Filter QName, or ANY_QNAME if not applicable.

getChildByName

protected final <X extends com.ebmwebsourcing.easybox.api.with.WithName> X getChildByName(X[] children,
                                                                                          java.lang.String name)
Get an XmlObject child by its name.

Type Parameters:
X - Type of desired child.
Parameters:
children - Array of XmlObject children.
name - Searched name.
Returns:
Found XmlObject child, or null if not found.

getXmlObjectAdoptedChildren

public com.ebmwebsourcing.easybox.api.XmlObjectNode[] getXmlObjectAdoptedChildren()
Specified by:
getXmlObjectAdoptedChildren in interface com.ebmwebsourcing.easybox.api.XmlObject
Overrides:
getXmlObjectAdoptedChildren in class AbstractXmlObjectImpl<Model extends AbstractJaxbModelObject>

getXmlObjectNaturalChildren

public final com.ebmwebsourcing.easybox.api.XmlObjectNode[] getXmlObjectNaturalChildren()
Specified by:
getXmlObjectNaturalChildren in interface com.ebmwebsourcing.easybox.api.XmlObject
Overrides:
getXmlObjectNaturalChildren in class AbstractXmlObjectNodeImpl<Model extends AbstractJaxbModelObject>

getXmlObjectAttributes

public final java.util.Map<javax.xml.namespace.QName,java.lang.Object> getXmlObjectAttributes()
Specified by:
getXmlObjectAttributes in interface com.ebmwebsourcing.easybox.api.XmlObject
Overrides:
getXmlObjectAttributes in class AbstractXmlObjectImpl<Model extends AbstractJaxbModelObject>

createChildrenArray

protected final <X extends com.ebmwebsourcing.easybox.api.XmlObjectNode> X[] createChildrenArray(java.util.List<?> jaxbChildrenList,
                                                                                                 java.lang.Class<?> filterClass,
                                                                                                 javax.xml.namespace.QName filterQName,
                                                                                                 java.lang.Class<X> xmlObjectInterfaceClass)
Create XmlObject children array for a parent XmlObject and an underlying JAXB filter class.

Type Parameters:
X - Desired XmlObject interface type for created children.
Parameters:
jaxbChildrenList - Model children list.
filterClass - Filter class to only consider a JAXB specific class of children (it often happens that JAXB mixes children types in a single internal list).
filterQName - Filter QName, or ANY_QNAME if not applicable.
xmlObjectInterfaceClass - Desired XmlObject interface class for created children.
parent - Parent XmlObject for created children.
Returns:
Array containing properly filtered JAXB children, wrapped as XmlObject.

createChildrenArray

protected final com.ebmwebsourcing.easybox.api.XmlObject[] createChildrenArray(java.util.List<?> jaxbChildrenList,
                                                                               java.lang.Class<?> filterClass,
                                                                               javax.xml.namespace.QName filterQName)

removeFromChildren

protected final void removeFromChildren(java.util.List<?> jaxbChildrenList,
                                        com.ebmwebsourcing.easybox.api.XmlObjectNode xmlObjectChild)

getXmlObjectDOMNode

public org.w3c.dom.Node getXmlObjectDOMNode()

toString

public final java.lang.String toString()
Overrides:
toString in class AbstractXmlObjectImpl<Model extends AbstractJaxbModelObject>


Copyright © 2011 Petals Link. All Rights Reserved.