net.sourceforge.nrl.parser.type
Class XmlTypeMapping

java.lang.Object
  extended by net.sourceforge.nrl.parser.type.TypeMapping
      extended by net.sourceforge.nrl.parser.type.XmlTypeMapping
All Implemented Interfaces:
ITypeMapping

public class XmlTypeMapping
extends TypeMapping

A type mapping that can be loaded from and saved to an XML file.

The mapping file format is very simple, and the loading function does not do any validation - it would just produce an empty mapping if another type of XML file was passed.

<typeMapping>
<mapping name="ModelElement" package="*" type="String"/>
...
</typeMapping>


Constructor Summary
XmlTypeMapping()
           
 
Method Summary
 void load(File file)
          Load the mapping from an XML file.
 void load(InputStream stream)
          Load the mapping from a stream.
 
Methods inherited from class net.sourceforge.nrl.parser.type.TypeMapping
addAll, addMapping, clear, contains, getMapping, getStringForType, getType, getType, getTypeFromString, remove
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlTypeMapping

public XmlTypeMapping()
Method Detail

load

public void load(File file)
          throws Exception
Load the mapping from an XML file.

Parameters:
file - the file
Throws:
IOException
SAXException
ParserConfigurationException
Exception

load

public void load(InputStream stream)
          throws Exception
Load the mapping from a stream.

Parameters:
stream - the stream
Throws:
IOException
SAXException
ParserConfigurationException
Exception


Copyright © 2006-2010 Christian Nentwich and others