org.eclipse.emf.ecore.xmi.impl
Class DefaultDOMHandlerImpl

java.lang.Object
  extended by org.eclipse.emf.ecore.xmi.impl.DefaultDOMHandlerImpl
All Implemented Interfaces:
DOMHandler, DOMHelper

public class DefaultDOMHandlerImpl
extends java.lang.Object
implements DOMHandler, DOMHelper

Implementation of the default DOMHandler and DOMHelper

Since:
2.1.0

Field Summary
protected  ExtendedMetaData extendedMetaData
           
protected  java.util.HashMap<org.w3c.dom.Node,EObject> nodeToContainer
          store node to container. used only to record some text/cdata nodes
protected  java.util.HashMap<org.w3c.dom.Node,EStructuralFeature> nodeToFeature
          store node to containment feature mapping
protected  java.util.HashMap<org.w3c.dom.Node,java.lang.Object> nodeToObject
          store node to actual value mapping
 
Constructor Summary
DefaultDOMHandlerImpl()
           
 
Method Summary
 EObject getContainer(org.w3c.dom.Node node)
           
 DOMHelper getDOMHelper()
           
 EStructuralFeature getEStructuralFeature(org.w3c.dom.Node node)
           
 java.lang.Object getValue(org.w3c.dom.Node node)
           
 void recordValues(org.w3c.dom.Node node, EObject container, EStructuralFeature feature, java.lang.Object value)
          Record the DOM node and its corresponding EMF values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodeToObject

protected final java.util.HashMap<org.w3c.dom.Node,java.lang.Object> nodeToObject
store node to actual value mapping


nodeToFeature

protected final java.util.HashMap<org.w3c.dom.Node,EStructuralFeature> nodeToFeature
store node to containment feature mapping


nodeToContainer

protected final java.util.HashMap<org.w3c.dom.Node,EObject> nodeToContainer
store node to container. used only to record some text/cdata nodes


extendedMetaData

protected ExtendedMetaData extendedMetaData
Constructor Detail

DefaultDOMHandlerImpl

public DefaultDOMHandlerImpl()
Method Detail

getContainer

public EObject getContainer(org.w3c.dom.Node node)
Specified by:
getContainer in interface DOMHelper
Parameters:
node - the DOM node
Returns:
the EObject container that holds the DOM node.

getValue

public java.lang.Object getValue(org.w3c.dom.Node node)
Specified by:
getValue in interface DOMHelper
Parameters:
node - the attribute Attr or element Element node
Returns:
the corresponding EMF value, one of: EObject FeatureMap.Entry List or Java type (e.g. String

getEStructuralFeature

public EStructuralFeature getEStructuralFeature(org.w3c.dom.Node node)
Specified by:
getEStructuralFeature in interface DOMHelper
Parameters:
node - the DOM node
Returns:
the feature for the DOM node value.

recordValues

public void recordValues(org.w3c.dom.Node node,
                         EObject container,
                         EStructuralFeature feature,
                         java.lang.Object value)
Description copied from interface: DOMHandler
Record the DOM node and its corresponding EMF values.

Specified by:
recordValues in interface DOMHandler
Parameters:
node - the DOM node
container - the EObject which is the node's container
feature - the feature for DOM node value
value - the EMF value which is obtained by querying the value of the specified feature on the container EObject.eGet(EStructuralFeature); this value is used to create the node

getDOMHelper

public DOMHelper getDOMHelper()
Specified by:
getDOMHelper in interface DOMHandler

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.