|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.graph.element.ElementService
This class represents the loader methods for obtaining elements from a resource file.
| Nested Class Summary | |
static class |
ElementService.Locations
A simpler wrapper class to encapsulate locations read from a elements.xml file. |
| Method Summary | |
static boolean |
checkLocationsTag(java.lang.String elementURL)
Method checkLocationsTag checks whether the given element file contains the location tag and returns true. |
static java.lang.String |
getElementsName(java.lang.String elementURL)
Reads the ElementConstants.ELEMENTSNAME attribute from
the given element file and returns it as String. |
static ElementService.Locations |
getLocations(java.lang.String elementURL)
Method getLocations reads all optional locations of the given element file and returns an instance of class Locations or null if
no such attributes are found. |
static java.lang.String |
getPath(java.lang.String filename)
Method getPath strips the filename from the path and returns the path of the filename. |
static void |
loadElementsFromAttributes(AttributeList list)
This method will load the elements from the given attribute list |
static void |
loadElementsFromResource(java.lang.String filename,
java.lang.Class resourceclass)
This method will load the elements from the given xml file, using the specified classloader. |
static void |
loadElementsFromResource(java.lang.String filename,
java.lang.Class resourceclass,
java.util.List nameList)
This method will load the elements from the given xml file, using the specified classloader and will store the names of the resulting elements in the parameter set instance. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static final void loadElementsFromResource(java.lang.String filename,
java.lang.Class resourceclass)
throws ReadException
filename - the filename to load elements from.resourceclass - the resourceclass whose classloader to use.
ReadException - thrown if loading fails.
public static final void loadElementsFromAttributes(AttributeList list)
throws BuildException
list - The attribute list containing the data
BuildException
public static final void loadElementsFromResource(java.lang.String filename,
java.lang.Class resourceclass,
java.util.List nameList)
throws ReadException
filename - the filename to load elements from.resourceclass - the resourceclass whose classloader to use.nameList - a list that all loaded elements will be put into;
the list is not cleared so the newly loaded elements are appended
to the list.
ReadException - thrown if the loading fails.
public static boolean checkLocationsTag(java.lang.String elementURL)
throws BuildException,
ReadException,
XMLParseException
elementURL - the filename of the elements file.
ReadException - thrown if the file could not be read.
BuildException - thrown if the value could not read from the file.
XMLParseException - thrown if xml parsing failed.
public static java.lang.String getElementsName(java.lang.String elementURL)
throws BuildException,
XMLParseException,
ReadException
ElementConstants.ELEMENTSNAME attribute from
the given element file and returns it as String.
elementURL - url to load elements resource from.
BuildException - thrown if deserializing failed.
XMLParseException - thrown if xml reading failed.
ReadException - thrown if io failed.
public static ElementService.Locations getLocations(java.lang.String elementURL)
throws BuildException,
ReadException,
XMLParseException
null if
no such attributes are found.
elementURL - the url of the elements file.
ElementService.Locations instance consisting of all
locations of the given input url.
BuildException - thrown if deserialization failed.
ReadException - thrown if reading failed or if the list of
locations is not specified in a way that it points to valid
xml files defining the expected input.
XMLParseException - thrown if xml reading failed.public static java.lang.String getPath(java.lang.String filename)
filename - the filename string
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||