public abstract class ModelObjectHandler extends Object
Constructor and Description |
---|
ModelObjectHandler() |
Modifier and Type | Method and Description |
---|---|
protected Node |
addNode(Node parentNode,
String nodeName,
String xmiUuid,
String primaryNodeType)
If the element or name attribute URI is empty, the primary node type is used as the name.
|
protected Node |
addNode(Node parentNode,
XmiElement element,
String nameAttributeUri,
String primaryNodeType)
If the element or name attribute URI is empty, the primary node type is used as the name.
|
protected void |
addPropertyValue(Node node,
String propertyName,
String newValue) |
protected void |
addPropertyValue(Node node,
String propertyName,
Value newValue) |
protected Sequencer.Context |
getContext() |
protected ModelExtensionDefinitionHelper |
getMedHelper() |
protected String |
getQName(XmiPart xmiPart) |
protected org.modeshape.sequencer.teiid.model.ModelReader |
getReader() |
protected ReferenceResolver |
getResolver() |
protected VdbModel |
getVdbModel() |
protected abstract void |
process(XmiElement element,
Node parentNode) |
protected void |
setBooleanProperty(Node node,
String jcrPropertyName,
String value)
If the value is
null or empty the property is not set. |
protected void |
setContext(Sequencer.Context context)
This method should only be called by the framework loading model object handlers.
|
protected void |
setProperty(Node node,
String propertyName,
String propertyValue)
Sets the specified, single-valued, property only if the value is not
null and not empty. |
protected void |
setReader(org.modeshape.sequencer.teiid.model.ModelReader reader)
This method should only be called by the framework loading model object handlers.
|
protected void |
setResolver(ReferenceResolver resolver)
This method should only be called by the framework loading model object handlers.
|
protected void |
setVdbModel(VdbModel vdbModel)
This method should only be called by the framework loading model object handlers.
|
protected static final Logger LOGGER
protected Node addNode(Node parentNode, String nodeName, String xmiUuid, String primaryNodeType) throws Exception
parentNode
- the parent node where the child node is being added (cannot be null
)nodeName
- the name to use to create the child node (can be null
)xmiUuid
- the value of the XMI UUID property (can be null
or empty)primaryNodeType
- the primary node type to use when creating the new node (cannot be null
or empty)null
)Exception
- if there is a problem creating the nodeprotected Node addNode(Node parentNode, XmiElement element, String nameAttributeUri, String primaryNodeType) throws Exception
parentNode
- the parent node where the child node is being added (cannot be null
)element
- the XMI element to use to create the child node (can be null
)nameAttributeUri
- the URI of the name property (can be null
or empty)primaryNodeType
- the primary node type to use when creating the new node (cannot be null
or empty)null
)Exception
- if there is a problem creating the nodeprotected void addPropertyValue(Node node, String propertyName, String newValue) throws Exception
node
- the node whose multi-valued property a value is being added to (cannot be null
)propertyName
- the multi-valued property name (cannot be null
or empty)newValue
- the value being added (cannot be null
or empty)Exception
- if there is a problem adding the property valueprotected void addPropertyValue(Node node, String propertyName, Value newValue) throws Exception
node
- the node whose multi-valued property a value is being added to (cannot be null
)propertyName
- the multi-valued property name (cannot be null
or empty)newValue
- the value being added (cannot be null
or empty)Exception
- if there is a problem adding the property valueprotected Sequencer.Context getContext()
null
)protected ModelExtensionDefinitionHelper getMedHelper()
null
)protected String getQName(XmiPart xmiPart)
xmiPart
- the XMI part whose qualified name is being requested (cannot be null
)null
or empty)protected org.modeshape.sequencer.teiid.model.ModelReader getReader()
null
)protected ReferenceResolver getResolver()
null
)protected VdbModel getVdbModel()
null
if model did not come from a VDB)protected abstract void process(XmiElement element, Node parentNode) throws Exception
element
- the element being processed (cannot be null
)parentNode
- the parent node to use if a node is created for the element (cannot be null
)Exception
- if there is a problem processing the XMI elementprotected void setBooleanProperty(Node node, String jcrPropertyName, String value) throws Exception
null
or empty the property is not set.node
- the node whose boolean property is being set (cannot be null
)value
- the property value (can be null
or empty)jcrPropertyName
- the JCR property name (cannot be null
or empty)Exception
- if there is a problem setting the propertyprotected void setContext(Sequencer.Context context)
context
- the sequencer context being set (never null
)protected void setProperty(Node node, String propertyName, String propertyValue) throws Exception
null
and not empty.node
- the node whose property is being set (cannot be null
)propertyName
- the name of the property being set (cannot be null
)propertyValue
- the proposed property value (can be null
or empty)Exception
- if there is a problem setting the propertyprotected void setReader(org.modeshape.sequencer.teiid.model.ModelReader reader)
reader
- the model reader being set (never null
)protected void setResolver(ReferenceResolver resolver)
resolver
- the reference resolver used during sequencing (cannot be null
)protected void setVdbModel(VdbModel vdbModel)
vdbModel
- the VDB model being sequenced (can be null
if model is not from a VDB)Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.