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

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.eclipse.emf.ecore.xmi.impl.XMLHandler
          extended by org.eclipse.emf.ecore.xmi.impl.XMIHandler
All Implemented Interfaces:
XMLDefaultHandler, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.xml.sax.ext.LexicalHandler
Direct Known Subclasses:
SAXXMIHandler

public abstract class XMIHandler
extends XMLHandler

This class is a SAX handler for creating MOF2 objects from an XMI 2.0 file.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.xmi.impl.XMLHandler
XMLHandler.ManyReference, XMLHandler.MyEObjectStack, XMLHandler.MyStack<E>, XMLHandler.SingleReference
 
Field Summary
protected static java.lang.String ID_ATTRIB
           
protected static java.lang.String UUID_ATTRIB
           
protected static java.lang.String VERSION_ATTRIB
           
protected static java.lang.String XMI_ELEMENT_NAME
           
protected static java.lang.String XMI_ELEMENT_TYPE
           
protected static java.lang.String XMI_EXTENSION
           
protected static java.lang.String XMI_TYPE_ATTRIB
           
protected static java.lang.String XMI_UUID
           
 
Fields inherited from class org.eclipse.emf.ecore.xmi.impl.XMLHandler
anySimpleType, anyType, ARRAY_SIZE, attribs, capacity, contextFeature, DEBUG_DEMANDED_PACKAGES, deferIDREFResolution, deferredExtent, disableNotify, DOCUMENT_ROOT_TYPE, documentRoot, ecoreBuilder, elements, eObjectToExtensionMap, ERROR_TYPE, extendedMetaData, extent, externalURIToLocations, featuresToKinds, forwardManyReferences, forwardSingleReferences, helper, hrefAttribute, idAttribute, identifiers, isIDREF, isNamespaceAware, isRoot, isSimpleFeature, laxWildcardProcessing, locator, mixedTargets, needsPushContext, NIL_ATTRIB, NO_NAMESPACE_SCHEMA_LOCATION_ATTRIB, notFeatures, OBJECT_TYPE, objects, oldStyleProxyURIs, packageRegistry, positions, prefixesToFactories, processAnyXML, processSchemaLocations, recordAnyTypeNSDecls, recordUnknownFeature, REFERENCE_THRESHOLD, resolve, resourceEntityHandler, resourceSet, resourceURI, sameDocumentProxies, SCHEMA_LOCATION_ATTRIB, suppressDocumentRoot, text, TYPE_ATTRIB, types, UNKNOWN_FEATURE_TYPE, uriHandler, urisToLocations, useConfigurationCache, usedNullNamespacePackage, useNewMethods, xmlMap, xmlResource, xmlSchemaTypePackage
 
Constructor Summary
XMIHandler(XMLResource xmiResource, XMLHelper helper, java.util.Map<?,?> options)
          Constructor.
 
Method Summary
protected  EObject createDocumentRoot(java.lang.String prefix, java.lang.String uri, java.lang.String name, EFactory eFactory, boolean top)
           
protected  void createObject(EObject peekObject, EStructuralFeature feature)
          Create an object based on the given feature and attributes.
protected  void handleUnknownFeature(java.lang.String prefix, java.lang.String name, boolean isElement, EObject peekObject, java.lang.String value)
           
protected  boolean isTextFeatureValue(java.lang.Object type)
           
protected  void processElement(java.lang.String name, java.lang.String prefix, java.lang.String localName)
           
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String name, org.xml.sax.Attributes attributes)
           
 
Methods inherited from class org.eclipse.emf.ecore.xmi.impl.XMLHandler
characters, comment, createEcoreBuilder, createObject, createObjectByType, createObjectFromFactory, createObjectFromFeatureType, createObjectFromTypeName, createTopObject, endCDATA, endDocument, endDTD, endElement, endEntity, endPrefixMapping, error, error, fatalError, fatalError, getColumnNumber, getExtension, getFactoryForPrefix, getFeature, getFeature, getLineNumber, getLocation, getPackageForURI, getURIConverter, getXMLEncoding, getXSIType, growArrays, handleCDATA, handleComment, handleFeature, handleForwardReferences, handleForwardReferences, handleMissingPackage, handleMixedText, handleNamespaceAttribs, handleObjectAttribs, handleProcessingInstruction, handleProxy, handleSchemaLocation, handleTopLocations, handleXMLNSAttribute, handleXSINoNamespaceSchemaLocation, handleXSISchemaLocation, ignorableWhitespace, isError, isNull, notationDecl, prepare, processingInstruction, processObject, processSchemaLocations, processTopObject, recordHeaderInformation, recordNamespacesSchemaLocations, recordUnknownFeature, reportUnknownFeature, reset, resolveEntity, setAttributes, setAttribValue, setDocumentLocator, setExtendedMetaDataOption, setFeatureValue, setFeatureValue, setFeatureValues, setLocator, setValueFromId, skippedEntity, startCDATA, startDocument, startDTD, startElement, startEntity, startPrefixMapping, toXMIException, unparsedEntityDecl, validateCreateObjectFromFactory, validateCreateObjectFromFactory, validateCreateObjectFromFactory, warning, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XMI_ELEMENT_TYPE

protected static final java.lang.String XMI_ELEMENT_TYPE
See Also:
Constant Field Values

XMI_UUID

protected static final java.lang.String XMI_UUID
See Also:
Constant Field Values

XMI_EXTENSION

protected static final java.lang.String XMI_EXTENSION
See Also:
Constant Field Values

XMI_TYPE_ATTRIB

protected static final java.lang.String XMI_TYPE_ATTRIB
See Also:
Constant Field Values

ID_ATTRIB

protected static final java.lang.String ID_ATTRIB
See Also:
Constant Field Values

VERSION_ATTRIB

protected static final java.lang.String VERSION_ATTRIB
See Also:
Constant Field Values

UUID_ATTRIB

protected static final java.lang.String UUID_ATTRIB
See Also:
Constant Field Values

XMI_ELEMENT_NAME

protected static final java.lang.String XMI_ELEMENT_NAME
See Also:
Constant Field Values
Constructor Detail

XMIHandler

public XMIHandler(XMLResource xmiResource,
                  XMLHelper helper,
                  java.util.Map<?,?> options)
Constructor.

Method Detail

processElement

protected void processElement(java.lang.String name,
                              java.lang.String prefix,
                              java.lang.String localName)
Overrides:
processElement in class XMLHandler

isTextFeatureValue

protected boolean isTextFeatureValue(java.lang.Object type)
Overrides:
isTextFeatureValue in class XMLHandler

createDocumentRoot

protected EObject createDocumentRoot(java.lang.String prefix,
                                     java.lang.String uri,
                                     java.lang.String name,
                                     EFactory eFactory,
                                     boolean top)
Overrides:
createDocumentRoot in class XMLHandler

createObject

protected void createObject(EObject peekObject,
                            EStructuralFeature feature)
Description copied from class: XMLHandler
Create an object based on the given feature and attributes.

Overrides:
createObject in class XMLHandler

handleUnknownFeature

protected void handleUnknownFeature(java.lang.String prefix,
                                    java.lang.String name,
                                    boolean isElement,
                                    EObject peekObject,
                                    java.lang.String value)
Overrides:
handleUnknownFeature in class XMLHandler

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String name,
                         org.xml.sax.Attributes attributes)
                  throws org.xml.sax.SAXException
Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class XMLHandler
Throws:
org.xml.sax.SAXException

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