org.modeshape.sequencer.teiid.model

## Class ModelObjectHandler

- java.lang.Object
- - org.modeshape.sequencer.teiid.model.ModelObjectHandler

- Direct Known Subclasses:
    CoreModelObjectHandler, DiagramModelObjectHandler, JdbcModelObjectHandler, RelationalModelObjectHandler, TransformationModelObjectHandler

      public abstract class ModelObjectHandler
      extends Object

  Base implementation of a model object handler.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static Logger` | `LOGGER`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ModelObjectHandler()`

  - ### Method Summary

    Methods
    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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### LOGGER

          protected static final Logger LOGGER

  - ### Constructor Detail

    - #### ModelObjectHandler

          public ModelObjectHandler()

  - ### Method Detail

    - #### addNode

          protected Node addNode(Node parentNode,
                     String nodeName,
                     String xmiUuid,
                     String primaryNodeType)
                          throws Exception

      If the element or name attribute URI is empty, the primary node type is used as the name.
      Parameters:
        `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)
      Returns:
        the new node (never `null`)
      Throws:
        `Exception` - if there is a problem creating the node

    - #### addNode

          protected Node addNode(Node parentNode,
                     XmiElement element,
                     String nameAttributeUri,
                     String primaryNodeType)
                          throws Exception

      If the element or name attribute URI is empty, the primary node type is used as the name.
      Parameters:
        `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)
      Returns:
        the new node (never `null`)
      Throws:
        `Exception` - if there is a problem creating the node

    - #### addPropertyValue

          protected void addPropertyValue(Node node,
                              String propertyName,
                              String newValue)
                                   throws Exception

      Parameters:
        `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)
      Throws:
        `Exception` - if there is a problem adding the property value

    - #### addPropertyValue

          protected void addPropertyValue(Node node,
                              String propertyName,
                              Value newValue)
                                   throws Exception

      Parameters:
        `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)
      Throws:
        `Exception` - if there is a problem adding the property value

    - #### getContext

          protected Sequencer.Context getContext()

      Returns:
        context the sequencer context (never `null`)

    - #### getMedHelper

          protected ModelExtensionDefinitionHelper getMedHelper()

      Returns:
        the MED helper (never `null`)

    - #### getQName

          protected String getQName(XmiPart xmiPart)

      Parameters:
        `xmiPart` - the XMI part whose qualified name is being requested (cannot be `null`)
      Returns:
        the qualified name obtained from the part (never `null` or empty)

    - #### getReader

          protected org.modeshape.sequencer.teiid.model.ModelReader getReader()

      Returns:
        reader the model reader (never `null`)

    - #### getResolver

          protected ReferenceResolver getResolver()

      Returns:
        the reference resolver (never `null`)

    - #### getVdbModel

          protected VdbModel getVdbModel()

      Returns:
        vdbModel the VDB model (can be `null` if model did not come from a VDB)

    - #### process

          protected abstract void process(XmiElement element,
                     Node parentNode)
                                   throws Exception

      Parameters:
        `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`)
      Throws:
        `Exception` - if there is a problem processing the XMI element

    - #### setBooleanProperty

          protected void setBooleanProperty(Node node,
                                String jcrPropertyName,
                                String value)
                                     throws Exception

      If the value is `null` or empty the property is not set.
      Parameters:
        `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)
      Throws:
        `Exception` - if there is a problem setting the property

    - #### setContext

          protected void setContext(Sequencer.Context context)

      This method should only be called by the framework loading model object handlers.
      Parameters:
        `context` - the sequencer context being set (never `null`)

    - #### setProperty

          protected void setProperty(Node node,
                         String propertyName,
                         String propertyValue)
                              throws Exception

      Sets the specified, single-valued, property only if the value is not `null` and not empty.
      Parameters:
        `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)
      Throws:
        `Exception` - if there is a problem setting the property

    - #### setReader

          protected void setReader(org.modeshape.sequencer.teiid.model.ModelReader reader)

      This method should only be called by the framework loading model object handlers.
      Parameters:
        `reader` - the model reader being set (never `null`)

    - #### setResolver

          protected void setResolver(ReferenceResolver resolver)

      This method should only be called by the framework loading model object handlers.
      Parameters:
        `resolver` - the reference resolver used during sequencing (cannot be `null`)

    - #### setVdbModel

          protected void setVdbModel(VdbModel vdbModel)

      This method should only be called by the framework loading model object handlers.
      Parameters:
        `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.