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 anXMLHandlerwill 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 XMLHandlerdelegateThe 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 voidcharacters(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()voidendDocument()voidendDTD()voidendElement(String uri, String localName, String name)voidendEntity(String name)voidendPrefixMapping(String prefix)booleanequals(Object obj)voiderror(XMIException e)voiderror(SAXParseException e)voidfatalError(XMIException e)voidfatalError(SAXParseException e)protected StringgetXSIType()protected voidhandleObjectAttribs(EObject obj)inthashCode()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()InputSourceresolveEntity(String publicId, String systemId)voidsetDocumentLocator(Locator locator)protected static voidsetField(String fieldName, Object target, Object value)Sets the given field through reflection after setting itaccessible.voidskippedEntity(String name)voidstartCDATA()voidstartDocument()voidstartDTD(String name, String publicId, String systemId)voidstartElement(String uri, String localName, String name)voidstartElement(String uri, String localName, String qName, Attributes attributes)voidstartEntity(String name)voidstartPrefixMapping(String prefix, String uri)StringtoString()voidunparsedEntityDecl(String name, String publicId, String systemId, String notationName)voidwarning(XMIException e)voidwarning(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 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 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:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classXMLHandler- See Also:
XMLHandler.endDocument()
-
characters
public void characters(char[] ch, int start, int length)- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classXMLHandler- See Also:
XMLHandler.characters(char[], int, int)
-
comment
public void comment(char[] ch, int start, int length)- Specified by:
commentin interfaceLexicalHandler- Overrides:
commentin classXMLHandler- See Also:
XMLHandler.comment(char[], int, int)
-
endCDATA
public void endCDATA()
- Specified by:
endCDATAin interfaceLexicalHandler- Overrides:
endCDATAin classXMLHandler- See Also:
XMLHandler.endCDATA()
-
endDTD
public void endDTD()
- Specified by:
endDTDin interfaceLexicalHandler- Overrides:
endDTDin classXMLHandler- See Also:
XMLHandler.endDTD()
-
endElement
public void endElement(String uri, String localName, String name)
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classXMLHandler- See Also:
XMLHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
-
endEntity
public void endEntity(String name)
- Specified by:
endEntityin interfaceLexicalHandler- Overrides:
endEntityin classXMLHandler- See Also:
XMLHandler.endEntity(java.lang.String)
-
endPrefixMapping
public void endPrefixMapping(String prefix)
- Specified by:
endPrefixMappingin interfaceContentHandler- Overrides:
endPrefixMappingin classXMLHandler- See Also:
XMLHandler.endPrefixMapping(java.lang.String)
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classObject- See Also:
Object.equals(java.lang.Object)
-
error
public void error(SAXParseException e) throws SAXException
- Specified by:
errorin interfaceErrorHandler- Overrides:
errorin classXMLHandler- Throws:
SAXException- See Also:
XMLHandler.error(org.xml.sax.SAXParseException)
-
error
public void error(XMIException e)
- Overrides:
errorin classXMLHandler- See Also:
XMLHandler.error(org.eclipse.emf.ecore.xmi.XMIException)
-
fatalError
public void fatalError(SAXParseException e) throws SAXException
- Specified by:
fatalErrorin interfaceErrorHandler- Overrides:
fatalErrorin classXMLHandler- Throws:
SAXException- See Also:
XMLHandler.fatalError(org.xml.sax.SAXParseException)
-
fatalError
public void fatalError(XMIException e)
- Overrides:
fatalErrorin classXMLHandler- See Also:
XMLHandler.fatalError(org.eclipse.emf.ecore.xmi.XMIException)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classObject- See Also:
Object.hashCode()
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException- Specified by:
ignorableWhitespacein interfaceContentHandler- Overrides:
ignorableWhitespacein classXMLHandler- Throws:
SAXException- See Also:
XMLHandler.ignorableWhitespace(char[], int, int)
-
notationDecl
public void notationDecl(String name, String publicId, String systemId) throws SAXException
- Specified by:
notationDeclin interfaceDTDHandler- Overrides:
notationDeclin 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:
preparein interfaceXMLDefaultHandler- Overrides:
preparein 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:
processingInstructionin interfaceContentHandler- Overrides:
processingInstructionin classXMLHandler- See Also:
XMLHandler.processingInstruction(java.lang.String, java.lang.String)
-
reset
public void reset()
- Specified by:
resetin interfaceXMLDefaultHandler- Overrides:
resetin classXMLHandler- See Also:
XMLHandler.reset()
-
resolveEntity
public InputSource resolveEntity(String publicId, String systemId) throws SAXException
- Specified by:
resolveEntityin interfaceEntityResolver- Overrides:
resolveEntityin classXMLHandler- Throws:
SAXException- See Also:
XMLHandler.resolveEntity(java.lang.String, java.lang.String)
-
setDocumentLocator
public void setDocumentLocator(Locator locator)
- Specified by:
setDocumentLocatorin interfaceContentHandler- Overrides:
setDocumentLocatorin classXMLHandler- See Also:
XMLHandler.setDocumentLocator(org.xml.sax.Locator)
-
skippedEntity
public void skippedEntity(String name) throws SAXException
- Specified by:
skippedEntityin interfaceContentHandler- Overrides:
skippedEntityin classXMLHandler- Throws:
SAXException- See Also:
XMLHandler.skippedEntity(java.lang.String)
-
startCDATA
public void startCDATA()
- Specified by:
startCDATAin interfaceLexicalHandler- Overrides:
startCDATAin classXMLHandler- See Also:
XMLHandler.startCDATA()
-
startDocument
public void startDocument()
- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classXMLHandler- See Also:
XMLHandler.startDocument()
-
startDTD
public void startDTD(String name, String publicId, String systemId)
- Specified by:
startDTDin interfaceLexicalHandler- Overrides:
startDTDin 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:
startElementin 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:
startElementin interfaceContentHandler- Overrides:
startElementin 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:
startEntityin interfaceLexicalHandler- Overrides:
startEntityin classXMLHandler- See Also:
XMLHandler.startEntity(java.lang.String)
-
startPrefixMapping
public void startPrefixMapping(String prefix, String uri)
- Specified by:
startPrefixMappingin interfaceContentHandler- Overrides:
startPrefixMappingin classXMLHandler- See Also:
XMLHandler.startPrefixMapping(java.lang.String, java.lang.String)
-
toString
public String toString()
- Overrides:
toStringin classObject- See Also:
Object.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:
XMLHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
-
warning
public void warning(SAXParseException e) throws SAXException
- Specified by:
warningin interfaceErrorHandler- Overrides:
warningin classXMLHandler- Throws:
SAXException- See Also:
XMLHandler.warning(org.xml.sax.SAXParseException)
-
warning
public void warning(XMIException e)
- Overrides:
warningin classXMLHandler- See Also:
XMLHandler.warning(org.eclipse.emf.ecore.xmi.XMIException)
-
getXSIType
protected String getXSIType()
- Specified by:
getXSITypein classXMLHandler- See Also:
XMLHandler.getXSIType()
-
handleObjectAttribs
protected void handleObjectAttribs(EObject obj)
- Specified by:
handleObjectAttribsin 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.
-
-