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>, XMLHandler.SingleReference -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final XMLHandlerThe 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
ConstructorsConstructorDescriptionForwardingXMLHandler(XMLHandler delegate, XMLResource xmlResource, XMLHelper helper, Map<?, ?> options) Creates this forwarding handler given its delegate. -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) voidcomment(char[] ch, int start, int length) protected XMLHandlerdelegate()Returns the delegate instance that methods are forwarded to.voidendCDATA()voidvoidendDTD()voidendElement(String uri, String localName, String name) voidvoidendPrefixMapping(String prefix) booleanvoidvoidvoidvoidprotected Stringprotected voidinthashCode()voidignorableWhitespace(char[] ch, int start, int length) voidnotationDecl(String name, String publicId, String systemId) voidprepare(XMLResource resource, XMLHelper xmlHelper, Map<?, ?> options) voidprocessingInstruction(String target, String data) protected static ObjectreflectiveCall(String key, Object target, String methodName, Object... params) Calls a given method through reflection after setting itaccessible.voidreset()resolveEntity(String publicId, String systemId) voidsetDocumentLocator(Locator locator) protected static voidSets the given field through reflection after setting itaccessible.voidskippedEntity(String name) voidvoidvoidvoidstartElement(String uri, String localName, String name) voidstartElement(String uri, String localName, String qName, Attributes attributes) voidstartEntity(String name) voidstartPrefixMapping(String prefix, String uri) toString()voidunparsedEntityDecl(String name, String publicId, String systemId, String notationName) voidvoidMethods 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, validateCreateObjectFromFactoryMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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 todelegateanyway.helper- The xml helper to use. Mandatory for the super-constructor, but we'll forward all calls todelegateanyway.options- The load options that were specified. Mandatory for the super-constructor, but we'll forward all calls todelegateanyway.
-
-
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:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classXMLHandler- See Also:
-
characters
public void characters(char[] ch, int start, int length) - Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classXMLHandler- See Also:
-
comment
public void comment(char[] ch, int start, int length) - Specified by:
commentin interfaceLexicalHandler- Overrides:
commentin classXMLHandler- See Also:
-
endCDATA
public void endCDATA()- Specified by:
endCDATAin interfaceLexicalHandler- Overrides:
endCDATAin classXMLHandler- See Also:
-
endDTD
public void endDTD()- Specified by:
endDTDin interfaceLexicalHandler- Overrides:
endDTDin classXMLHandler- See Also:
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classXMLHandler- See Also:
-
endEntity
- Specified by:
endEntityin interfaceLexicalHandler- Overrides:
endEntityin classXMLHandler- See Also:
-
endPrefixMapping
- Specified by:
endPrefixMappingin interfaceContentHandler- Overrides:
endPrefixMappingin classXMLHandler- See Also:
-
equals
-
error
- Specified by:
errorin interfaceErrorHandler- Overrides:
errorin classXMLHandler- Throws:
SAXException- See Also:
-
error
- Overrides:
errorin classXMLHandler- See Also:
-
fatalError
- Specified by:
fatalErrorin interfaceErrorHandler- Overrides:
fatalErrorin classXMLHandler- Throws:
SAXException- See Also:
-
fatalError
- Overrides:
fatalErrorin classXMLHandler- See Also:
-
hashCode
public int hashCode() -
ignorableWhitespace
- Specified by:
ignorableWhitespacein interfaceContentHandler- Overrides:
ignorableWhitespacein classXMLHandler- Throws:
SAXException- See Also:
-
notationDecl
- Specified by:
notationDeclin interfaceDTDHandler- Overrides:
notationDeclin classXMLHandler- Throws:
SAXException- See Also:
-
prepare
- Specified by:
preparein interfaceXMLDefaultHandler- Overrides:
preparein classXMLHandler- See Also:
-
processingInstruction
- Specified by:
processingInstructionin interfaceContentHandler- Overrides:
processingInstructionin classXMLHandler- See Also:
-
reset
public void reset()- Specified by:
resetin interfaceXMLDefaultHandler- Overrides:
resetin classXMLHandler- See Also:
-
resolveEntity
- Specified by:
resolveEntityin interfaceEntityResolver- Overrides:
resolveEntityin classXMLHandler- Throws:
SAXException- See Also:
-
setDocumentLocator
- Specified by:
setDocumentLocatorin interfaceContentHandler- Overrides:
setDocumentLocatorin classXMLHandler- See Also:
-
skippedEntity
- Specified by:
skippedEntityin interfaceContentHandler- Overrides:
skippedEntityin classXMLHandler- Throws:
SAXException- See Also:
-
startCDATA
public void startCDATA()- Specified by:
startCDATAin interfaceLexicalHandler- Overrides:
startCDATAin classXMLHandler- See Also:
-
startDocument
public void startDocument()- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classXMLHandler- See Also:
-
startDTD
- Specified by:
startDTDin interfaceLexicalHandler- Overrides:
startDTDin classXMLHandler- See Also:
-
startElement
- Overrides:
startElementin classXMLHandler- See Also:
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException - Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classXMLHandler- Throws:
SAXException- See Also:
-
startEntity
- Specified by:
startEntityin interfaceLexicalHandler- Overrides:
startEntityin classXMLHandler- See Also:
-
startPrefixMapping
- Specified by:
startPrefixMappingin interfaceContentHandler- Overrides:
startPrefixMappingin classXMLHandler- See Also:
-
toString
-
unparsedEntityDecl
public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException - Specified by:
unparsedEntityDeclin interfaceDTDHandler- Overrides:
unparsedEntityDeclin classXMLHandler- Throws:
SAXException- See Also:
-
warning
- Specified by:
warningin interfaceErrorHandler- Overrides:
warningin classXMLHandler- Throws:
SAXException- See Also:
-
warning
- Overrides:
warningin classXMLHandler- See Also:
-
getXSIType
- Specified by:
getXSITypein classXMLHandler- See Also:
-
handleObjectAttribs
- Specified by:
handleObjectAttribsin 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.
-