Package org.eclipse.m2m.atl.engine.injectors.xml

# Class XMLInjector

java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.eclipse.m2m.atl.engine.injectors.xml.XMLInjector

All Implemented Interfaces:
  `Injector`, `ContentHandler`, `DTDHandler`, `EntityResolver`, `ErrorHandler`

public class XMLInjector extends DefaultHandler implements Injector

## Constructor Summary

Constructors
Constructor
Description
`XMLInjector()`

## Method Summary

Modifier and Type
Method
Description
`void`
`characters(char[] ch, int start, int length)`
`void`
`endElement(String uri, String localName, String qName)`
`void`
`error(SAXParseException e)`
`void`
`fatalError(SAXParseException e)`
`Map`
`getParameterTypes()`
returns the list of parameters supported by this injector in the form of a Map with parameter names as keys and type name as value.
`String`
`getPrefix()`
`ASMModelElement`
`inject(ASMModel target, InputStream source, Map params)`
Performs the injection.
`ASMModelElement`
`inject(ASMModel target, Reader source, Map params)`
Performs the injection.
`void`
`performImportation(ASMModel format, ASMModel extent, InputStream in, String other)`
`void`
`setDocumentLocator(Locator locator)`
`void`
`startElement(String uri, String localName, String qName, Attributes attributes)`

### Methods inherited from class org.xml.sax.helpers.DefaultHandler

`endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.xml.sax.ContentHandler

`declaration`

## Constructor Details

### XMLInjector

public XMLInjector()

## Method Details

### getParameterTypes

public Map getParameterTypes()
Description copied from interface: `Injector`
returns the list of parameters supported by this injector in the form of a Map with parameter names as keys and type name as value. Known type names are: "String" "Model"

Specified by:
  `getParameterTypes` in interface `Injector`
Returns:
  the Map of parameter types

### inject

public ASMModelElement inject(ASMModel target, InputStream source, Map params) throws IOException
Description copied from interface: `Injector`
Performs the injection.

Specified by:
  `inject` in interface `Injector`
Parameters:
  `target` - The target model to populate.
  `source` - The source InputStream. Alternative source kinds can be passed in params.
  `params` - A Map of additional parameters. The key is the name.
Returns:
  The root element of the populated model if it exists, any element else.
Throws:
  `IOException`

### inject

public ASMModelElement inject(ASMModel target, Reader source, Map params) throws IOException
Description copied from interface: `Injector`
Performs the injection.

Specified by:
  `inject` in interface `Injector`
Parameters:
  `target` - The target model to populate.
  `source` - The source Reader. Alternative source kinds can be passed in params.
  `params` - A Map of additional parameters. The key is the name.
Returns:
  The root element of the populated model if it exists, any element else.
Throws:
  `IOException`

### getPrefix

public String getPrefix()

Specified by:
  `getPrefix` in interface `Injector`

### performImportation

public void performImportation(ASMModel format, ASMModel extent, InputStream in, String other) throws IOException

Specified by:
  `performImportation` in interface `Injector`
Throws:
  `IOException`

### setDocumentLocator

public void setDocumentLocator(Locator locator)

Specified by:
  `setDocumentLocator` in interface `ContentHandler`
Overrides:
  `setDocumentLocator` in class `DefaultHandler`

### characters

public void characters(char[] ch, int start, int length) throws SAXException

Specified by:
  `characters` in interface `ContentHandler`
Overrides:
  `characters` in class `DefaultHandler`
Throws:
  `SAXException`

### startElement

public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException

Specified by:
  `startElement` in interface `ContentHandler`
Overrides:
  `startElement` in class `DefaultHandler`
Throws:
  `SAXException`

### endElement

public void endElement(String uri, String localName, String qName) throws SAXException

Specified by:
  `endElement` in interface `ContentHandler`
Overrides:
  `endElement` in class `DefaultHandler`
Throws:
  `SAXException`

### error

public void error(SAXParseException e)

Specified by:
  `error` in interface `ErrorHandler`
Overrides:
  `error` in class `DefaultHandler`

### fatalError

public void fatalError(SAXParseException e)

Specified by:
  `fatalError` in interface `ErrorHandler`
Overrides:
  `fatalError` in class `DefaultHandler`