Class ForwardingXMLHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.eclipse.emf.ecore.xmi.impl.XMLHandler
-
- org.eclipse.emf.compare.ide.internal.utils.ForwardingXMLHandler
-
- All Implemented Interfaces:
XMLDefaultHandler
,ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
,LexicalHandler
public class ForwardingXMLHandler extends XMLHandler
This implementation of anXMLHandler
will forward all calls to its delegate.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.xmi.impl.XMLHandler
XMLHandler.ManyReference, XMLHandler.MyEObjectStack, XMLHandler.MyStack<E extends Object>, XMLHandler.SingleReference
-
-
Field Summary
Fields Modifier and Type Field Description protected XMLHandler
delegate
The delegate to which we'll forward all calls.-
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, missingPackageHandler, 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, usePackageNsURIAsLocation, xmlMap, xmlResource, xmlSchemaTypePackage
-
-
Constructor Summary
Constructors Constructor Description ForwardingXMLHandler(XMLHandler delegate, XMLResource xmlResource, XMLHelper helper, Map<?,?> options)
Creates this forwarding handler given its delegate.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(char[] ch, int start, int length)
void
comment(char[] ch, int start, int length)
protected XMLHandler
delegate()
Returns the delegate instance that methods are forwarded to.void
endCDATA()
void
endDocument()
void
endDTD()
void
endElement(String uri, String localName, String name)
void
endEntity(String name)
void
endPrefixMapping(String prefix)
boolean
equals(Object obj)
void
error(XMIException e)
void
error(SAXParseException e)
void
fatalError(XMIException e)
void
fatalError(SAXParseException e)
protected String
getXSIType()
protected void
handleObjectAttribs(EObject obj)
int
hashCode()
void
ignorableWhitespace(char[] ch, int start, int length)
void
notationDecl(String name, String publicId, String systemId)
void
prepare(XMLResource resource, XMLHelper xmlHelper, Map<?,?> options)
void
processingInstruction(String target, String data)
protected static Object
reflectiveCall(String key, Object target, String methodName, Object... params)
Calls a given method through reflection after setting itaccessible
.void
reset()
InputSource
resolveEntity(String publicId, String systemId)
void
setDocumentLocator(Locator locator)
protected static void
setField(String fieldName, Object target, Object value)
Sets the given field through reflection after setting itaccessible
.void
skippedEntity(String name)
void
startCDATA()
void
startDocument()
void
startDTD(String name, String publicId, String systemId)
void
startElement(String uri, String localName, String name)
void
startElement(String uri, String localName, String qName, Attributes attributes)
void
startEntity(String name)
void
startPrefixMapping(String prefix, String uri)
String
toString()
void
unparsedEntityDecl(String name, String publicId, String systemId, String notationName)
void
warning(XMIException e)
void
warning(SAXParseException e)
-
Methods inherited from class org.eclipse.emf.ecore.xmi.impl.XMLHandler
createDocumentRoot, createEcoreBuilder, createObject, createObject, createObjectByType, createObjectFromFactory, createObjectFromFeatureType, createObjectFromTypeName, createTopObject, getColumnNumber, getExtension, getFactoryForPrefix, getFeature, getFeature, getLineNumber, getLocation, getPackageForURI, getURIConverter, getXMLEncoding, growArrays, handleCDATA, handleComment, handleFeature, handleForwardReferences, handleForwardReferences, handleMissingPackage, handleMixedText, handleNamespaceAttribs, handleProcessingInstruction, handleProxy, handleSchemaLocation, handleTopLocations, handleUnknownFeature, handleXMLNSAttribute, handleXSINoNamespaceSchemaLocation, handleXSISchemaLocation, isError, isNull, isTextFeatureValue, processElement, processObject, processSchemaLocations, processTopObject, recordHeaderInformation, recordNamespacesSchemaLocations, recordUnknownFeature, reportUnknownFeature, setAttributes, setAttribValue, setExtendedMetaDataOption, setFeatureValue, setFeatureValue, setFeatureValues, setLocator, setValueFromId, toXMIException, validateCreateObjectFromFactory, validateCreateObjectFromFactory, validateCreateObjectFromFactory
-
-
-
-
Field Detail
-
delegate
protected final XMLHandler delegate
The delegate to which we'll forward all calls.
-
-
Constructor Detail
-
ForwardingXMLHandler
public ForwardingXMLHandler(XMLHandler delegate, XMLResource xmlResource, XMLHelper helper, Map<?,?> options)
Creates this forwarding handler given its delegate. All other parameters are only used to call the mandatory super-constructor... but none should be of any use here.- Parameters:
delegate
- Our delegate XMLHandler.xmlResource
- The resource we'll be loading. Mandatory for the super-constructor, but we'll forward all calls todelegate
anyway.helper
- The xml helper to use. Mandatory for the super-constructor, but we'll forward all calls todelegate
anyway.options
- The load options that were specified. Mandatory for the super-constructor, but we'll forward all calls todelegate
anyway.
-
-
Method Detail
-
delegate
protected XMLHandler delegate()
Returns the delegate instance that methods are forwarded to.- Returns:
- The delegate instance that methods are forwarded to.
-
endDocument
public void endDocument()
- Specified by:
endDocument
in interfaceContentHandler
- Overrides:
endDocument
in classXMLHandler
- See Also:
XMLHandler.endDocument()
-
characters
public void characters(char[] ch, int start, int length)
- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classXMLHandler
- See Also:
XMLHandler.characters(char[], int, int)
-
comment
public void comment(char[] ch, int start, int length)
- Specified by:
comment
in interfaceLexicalHandler
- Overrides:
comment
in classXMLHandler
- See Also:
XMLHandler.comment(char[], int, int)
-
endCDATA
public void endCDATA()
- Specified by:
endCDATA
in interfaceLexicalHandler
- Overrides:
endCDATA
in classXMLHandler
- See Also:
XMLHandler.endCDATA()
-
endDTD
public void endDTD()
- Specified by:
endDTD
in interfaceLexicalHandler
- Overrides:
endDTD
in classXMLHandler
- See Also:
XMLHandler.endDTD()
-
endElement
public void endElement(String uri, String localName, String name)
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classXMLHandler
- See Also:
XMLHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
-
endEntity
public void endEntity(String name)
- Specified by:
endEntity
in interfaceLexicalHandler
- Overrides:
endEntity
in classXMLHandler
- See Also:
XMLHandler.endEntity(java.lang.String)
-
endPrefixMapping
public void endPrefixMapping(String prefix)
- Specified by:
endPrefixMapping
in interfaceContentHandler
- Overrides:
endPrefixMapping
in classXMLHandler
- See Also:
XMLHandler.endPrefixMapping(java.lang.String)
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classObject
- See Also:
Object.equals(java.lang.Object)
-
error
public void error(SAXParseException e) throws SAXException
- Specified by:
error
in interfaceErrorHandler
- Overrides:
error
in classXMLHandler
- Throws:
SAXException
- See Also:
XMLHandler.error(org.xml.sax.SAXParseException)
-
error
public void error(XMIException e)
- Overrides:
error
in classXMLHandler
- See Also:
XMLHandler.error(org.eclipse.emf.ecore.xmi.XMIException)
-
fatalError
public void fatalError(SAXParseException e) throws SAXException
- Specified by:
fatalError
in interfaceErrorHandler
- Overrides:
fatalError
in classXMLHandler
- Throws:
SAXException
- See Also:
XMLHandler.fatalError(org.xml.sax.SAXParseException)
-
fatalError
public void fatalError(XMIException e)
- Overrides:
fatalError
in classXMLHandler
- See Also:
XMLHandler.fatalError(org.eclipse.emf.ecore.xmi.XMIException)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classObject
- See Also:
Object.hashCode()
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
- Specified by:
ignorableWhitespace
in interfaceContentHandler
- Overrides:
ignorableWhitespace
in classXMLHandler
- Throws:
SAXException
- See Also:
XMLHandler.ignorableWhitespace(char[], int, int)
-
notationDecl
public void notationDecl(String name, String publicId, String systemId) throws SAXException
- Specified by:
notationDecl
in interfaceDTDHandler
- Overrides:
notationDecl
in classXMLHandler
- Throws:
SAXException
- See Also:
XMLHandler.notationDecl(java.lang.String, java.lang.String, java.lang.String)
-
prepare
public void prepare(XMLResource resource, XMLHelper xmlHelper, Map<?,?> options)
- Specified by:
prepare
in interfaceXMLDefaultHandler
- Overrides:
prepare
in classXMLHandler
- See Also:
XMLHandler.prepare(org.eclipse.emf.ecore.xmi.XMLResource, org.eclipse.emf.ecore.xmi.XMLHelper, java.util.Map)
-
processingInstruction
public void processingInstruction(String target, String data)
- Specified by:
processingInstruction
in interfaceContentHandler
- Overrides:
processingInstruction
in classXMLHandler
- See Also:
XMLHandler.processingInstruction(java.lang.String, java.lang.String)
-
reset
public void reset()
- Specified by:
reset
in interfaceXMLDefaultHandler
- Overrides:
reset
in classXMLHandler
- See Also:
XMLHandler.reset()
-
resolveEntity
public InputSource resolveEntity(String publicId, String systemId) throws SAXException
- Specified by:
resolveEntity
in interfaceEntityResolver
- Overrides:
resolveEntity
in classXMLHandler
- Throws:
SAXException
- See Also:
XMLHandler.resolveEntity(java.lang.String, java.lang.String)
-
setDocumentLocator
public void setDocumentLocator(Locator locator)
- Specified by:
setDocumentLocator
in interfaceContentHandler
- Overrides:
setDocumentLocator
in classXMLHandler
- See Also:
XMLHandler.setDocumentLocator(org.xml.sax.Locator)
-
skippedEntity
public void skippedEntity(String name) throws SAXException
- Specified by:
skippedEntity
in interfaceContentHandler
- Overrides:
skippedEntity
in classXMLHandler
- Throws:
SAXException
- See Also:
XMLHandler.skippedEntity(java.lang.String)
-
startCDATA
public void startCDATA()
- Specified by:
startCDATA
in interfaceLexicalHandler
- Overrides:
startCDATA
in classXMLHandler
- See Also:
XMLHandler.startCDATA()
-
startDocument
public void startDocument()
- Specified by:
startDocument
in interfaceContentHandler
- Overrides:
startDocument
in classXMLHandler
- See Also:
XMLHandler.startDocument()
-
startDTD
public void startDTD(String name, String publicId, String systemId)
- Specified by:
startDTD
in interfaceLexicalHandler
- Overrides:
startDTD
in classXMLHandler
- See Also:
XMLHandler.startDTD(java.lang.String, java.lang.String, java.lang.String)
-
startElement
public void startElement(String uri, String localName, String name)
- Overrides:
startElement
in classXMLHandler
- See Also:
XMLHandler.startElement(java.lang.String, java.lang.String, java.lang.String)
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classXMLHandler
- Throws:
SAXException
- See Also:
XMLHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
-
startEntity
public void startEntity(String name)
- Specified by:
startEntity
in interfaceLexicalHandler
- Overrides:
startEntity
in classXMLHandler
- See Also:
XMLHandler.startEntity(java.lang.String)
-
startPrefixMapping
public void startPrefixMapping(String prefix, String uri)
- Specified by:
startPrefixMapping
in interfaceContentHandler
- Overrides:
startPrefixMapping
in classXMLHandler
- See Also:
XMLHandler.startPrefixMapping(java.lang.String, java.lang.String)
-
toString
public String toString()
- Overrides:
toString
in classObject
- See Also:
Object.toString()
-
unparsedEntityDecl
public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException
- Specified by:
unparsedEntityDecl
in interfaceDTDHandler
- Overrides:
unparsedEntityDecl
in classXMLHandler
- Throws:
SAXException
- See Also:
XMLHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
-
warning
public void warning(SAXParseException e) throws SAXException
- Specified by:
warning
in interfaceErrorHandler
- Overrides:
warning
in classXMLHandler
- Throws:
SAXException
- See Also:
XMLHandler.warning(org.xml.sax.SAXParseException)
-
warning
public void warning(XMIException e)
- Overrides:
warning
in classXMLHandler
- See Also:
XMLHandler.warning(org.eclipse.emf.ecore.xmi.XMIException)
-
getXSIType
protected String getXSIType()
- Specified by:
getXSIType
in classXMLHandler
- See Also:
XMLHandler.getXSIType()
-
handleObjectAttribs
protected void handleObjectAttribs(EObject obj)
- Specified by:
handleObjectAttribs
in classXMLHandler
- See Also:
XMLHandler.handleObjectAttribs(org.eclipse.emf.ecore.EObject)
-
reflectiveCall
protected static Object reflectiveCall(String key, Object target, String methodName, Object... params)
Calls a given method through reflection after setting itaccessible
.- Parameters:
key
- The key of the bucket in which the Method object is stored withinMETHOD_CACHE
.target
- Target upon which we should invoke this method.methodName
- Name of the method we are to call.params
- Parameters of the invocation.- Returns:
- Result of the invocation.
-
setField
protected static void setField(String fieldName, Object target, Object value)
Sets the given field through reflection after setting itaccessible
.- Parameters:
fieldName
- Name of the field we should set.target
- The actual object which field we are to set.value
- Value to which this field should be set.
-
-