Class XMLWiringParser<T>

java.lang.Object
com.invirgance.convirgance.wiring.XMLWiringParser<T>

public class XMLWiringParser<T> extends Object
Provides facilities for loading Wiring XML files. In most circumstances, you merely need to provide a Source to the constructor that points to the XML file and then call getRoot to retrieve the configured object. In cases where you wish to access objects within the structure, get(id) can be used.

Custom tags can be plugged into XMLWiringParser by including a /META-INF/wirings.properties file in your project, or by using the Wiring annotation.
Author:
jbanes
  • Constructor Summary

    Constructors
    Constructor
    Description
    XMLWiringParser(com.invirgance.convirgance.source.Source source)
    Create a new XMLWiringParser to parse the given Source.
  • Method Summary

    Modifier and Type
    Method
    Description
    get(String id)
    Returns the object in the XML file with the specified id attribute on its tag.
    static Properties
    Provides a list of custom tags this parser is aware of and the classes loaded to service those tags.
    Returns the object described by the XML file

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • XMLWiringParser

      public XMLWiringParser(com.invirgance.convirgance.source.Source source)
      Create a new XMLWiringParser to parse the given Source.
      Parameters:
      source - the source from where to read the XML file
  • Method Details

    • getCustomTags

      public static Properties getCustomTags()
      Provides a list of custom tags this parser is aware of and the classes loaded to service those tags.
      Returns:
      A Properties object with the tag name as the key and class name as the value
    • getRoot

      public T getRoot()
      Returns the object described by the XML file
      Returns:
      the root object in the XML file
    • get

      public Object get(String id)
      Returns the object in the XML file with the specified id attribute on its tag. If the id is not found, null is returned instead.
      Parameters:
      id - the string identifier to find
      Returns: