public class XmlMapping extends Object
XmlMappingParser
Constructor and Description |
---|
XmlMapping()
Constructs a new XmlMapping.
|
XmlMapping(String name,
String location,
XmlMapping parent)
Constructs a new XmlMapping.
|
Modifier and Type | Method and Description |
---|---|
void |
addImport(XmlMapping child)
Adds an imported mapping file to this mapping file.
|
boolean |
addTemplate(String name,
Element element)
Adds a template configuration to this mapping file.
|
void |
addTypeHandlers(List<TypeHandlerConfig> list)
Recursively adds type handlers from all imported mapping files,
and from this mapping file, to a given list.
|
Element |
findTemplate(String name)
Recursively finds the template DOM element for a given template
name in this mapping file and its parents.
|
BeanIOConfig |
getConfiguration()
Returns the BeanIO configuration for this mapping file.
|
String |
getLocation()
Returns the location of this mapping file (in URL format).
|
String |
getName()
Returns the name of this mapping file.
|
XmlMapping |
getParent()
Returns the parent mapping file that imported this mapping file,
or null if this file is the "root" mapping file.
|
Properties |
getProperties()
Returns the properties declared in this mapping file.
|
boolean |
isDeclaredGlobalTypeHandler(String name)
Returns whether a global type handler was configured for the
given type handler name.
|
boolean |
isLoading(String url)
Returns whether a given mapping file is being actively loaded
using its location to identify it.
|
void |
setProperty(String name,
String value)
Sets a property declared in this mapping file.
|
String |
toString() |
public XmlMapping()
public XmlMapping(String name, String location, XmlMapping parent)
name
- the mapping file name used for error messageslocation
- the location of the mapping (this should be
the absolute URL location of the file so that the same
mapping file will always have the same the location)parent
- the parent mappingpublic String getName()
public String getLocation()
public BeanIOConfig getConfiguration()
public XmlMapping getParent()
public void addImport(XmlMapping child)
child
- the imported mapping filepublic boolean isLoading(String url)
url
- the mapping file location to checkpublic void setProperty(String name, String value)
name
- the property namevalue
- the property valuepublic Properties getProperties()
Properties
public void addTypeHandlers(List<TypeHandlerConfig> list)
list
- the list to add all type handlers toopublic boolean addTemplate(String name, Element element)
name
- the name of the templateelement
- the 'template' DOM elementpublic Element findTemplate(String name)
name
- the name of the template to retrievepublic boolean isDeclaredGlobalTypeHandler(String name)
name
- the type handler name