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
This implementation of an
XMLHandler
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
Modifier and TypeFieldDescriptionprotected final XMLHandler
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, resolveEntities, 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
ConstructorDescriptionForwardingXMLHandler
(XMLHandler delegate, XMLResource xmlResource, XMLHelper helper, Map<?, ?> options) Creates this forwarding handler given its delegate. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
void
endDTD()
void
endElement
(String uri, String localName, String name) void
void
endPrefixMapping
(String prefix) boolean
void
void
void
void
protected String
protected void
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()
resolveEntity
(String publicId, String systemId) void
setDocumentLocator
(Locator locator) protected static void
Sets the given field through reflection after setting itaccessible
.void
skippedEntity
(String name) void
void
void
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) toString()
void
unparsedEntityDecl
(String name, String publicId, String systemId, String notationName) void
void
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
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
delegate
The delegate to which we'll forward all calls.
-
-
Constructor Details
-
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 Details
-
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:
-
characters
public void characters(char[] ch, int start, int length) - Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classXMLHandler
- See Also:
-
comment
public void comment(char[] ch, int start, int length) - Specified by:
comment
in interfaceLexicalHandler
- Overrides:
comment
in classXMLHandler
- See Also:
-
endCDATA
public void endCDATA()- Specified by:
endCDATA
in interfaceLexicalHandler
- Overrides:
endCDATA
in classXMLHandler
- See Also:
-
endDTD
public void endDTD()- Specified by:
endDTD
in interfaceLexicalHandler
- Overrides:
endDTD
in classXMLHandler
- See Also:
-
endElement
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classXMLHandler
- See Also:
-
endEntity
- Specified by:
endEntity
in interfaceLexicalHandler
- Overrides:
endEntity
in classXMLHandler
- See Also:
-
endPrefixMapping
- Specified by:
endPrefixMapping
in interfaceContentHandler
- Overrides:
endPrefixMapping
in classXMLHandler
- See Also:
-
equals
-
error
- Specified by:
error
in interfaceErrorHandler
- Overrides:
error
in classXMLHandler
- Throws:
SAXException
- See Also:
-
error
- Overrides:
error
in classXMLHandler
- See Also:
-
fatalError
- Specified by:
fatalError
in interfaceErrorHandler
- Overrides:
fatalError
in classXMLHandler
- Throws:
SAXException
- See Also:
-
fatalError
- Overrides:
fatalError
in classXMLHandler
- See Also:
-
hashCode
public int hashCode() -
ignorableWhitespace
- Specified by:
ignorableWhitespace
in interfaceContentHandler
- Overrides:
ignorableWhitespace
in classXMLHandler
- Throws:
SAXException
- See Also:
-
notationDecl
- Specified by:
notationDecl
in interfaceDTDHandler
- Overrides:
notationDecl
in classXMLHandler
- Throws:
SAXException
- See Also:
-
prepare
- Specified by:
prepare
in interfaceXMLDefaultHandler
- Overrides:
prepare
in classXMLHandler
- See Also:
-
processingInstruction
- Specified by:
processingInstruction
in interfaceContentHandler
- Overrides:
processingInstruction
in classXMLHandler
- See Also:
-
reset
public void reset()- Specified by:
reset
in interfaceXMLDefaultHandler
- Overrides:
reset
in classXMLHandler
- See Also:
-
resolveEntity
- Specified by:
resolveEntity
in interfaceEntityResolver
- Overrides:
resolveEntity
in classXMLHandler
- Throws:
SAXException
- See Also:
-
setDocumentLocator
- Specified by:
setDocumentLocator
in interfaceContentHandler
- Overrides:
setDocumentLocator
in classXMLHandler
- See Also:
-
skippedEntity
- Specified by:
skippedEntity
in interfaceContentHandler
- Overrides:
skippedEntity
in classXMLHandler
- Throws:
SAXException
- See Also:
-
startCDATA
public void startCDATA()- Specified by:
startCDATA
in interfaceLexicalHandler
- Overrides:
startCDATA
in classXMLHandler
- See Also:
-
startDocument
public void startDocument()- Specified by:
startDocument
in interfaceContentHandler
- Overrides:
startDocument
in classXMLHandler
- See Also:
-
startDTD
- Specified by:
startDTD
in interfaceLexicalHandler
- Overrides:
startDTD
in classXMLHandler
- See Also:
-
startElement
- Overrides:
startElement
in classXMLHandler
- See Also:
-
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:
-
startEntity
- Specified by:
startEntity
in interfaceLexicalHandler
- Overrides:
startEntity
in classXMLHandler
- See Also:
-
startPrefixMapping
- Specified by:
startPrefixMapping
in interfaceContentHandler
- Overrides:
startPrefixMapping
in classXMLHandler
- See Also:
-
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:
-
warning
- Specified by:
warning
in interfaceErrorHandler
- Overrides:
warning
in classXMLHandler
- Throws:
SAXException
- See Also:
-
warning
- Overrides:
warning
in classXMLHandler
- See Also:
-
getXSIType
- Specified by:
getXSIType
in classXMLHandler
- See Also:
-
handleObjectAttribs
- Specified by:
handleObjectAttribs
in classXMLHandler
- See Also:
-
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
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.
-