Class XMLMapper

java.lang.Object
org.cdlib.mrt.formatter.XMLMapper

public class XMLMapper extends Object
Provide mapping of State to header and namespaces Resource entries for XMLMapper take the form: [typename].header= (required) [typename].namespace= (optional - if not supplied then assumed empty or id provided) [typename].id.[property name]= (optional)
Author:
dloy
  • Field Details

  • Constructor Details

    • XMLMapper

      protected XMLMapper(String resourceName, StateInf state) throws TException
      State must be explicitly included match an instance to assign a type name The type name is used for matchin resource properties
      Parameters:
      state - implements StateInf
      Throws:
      TException
  • Method Details

    • getXMLMapper

      public static XMLMapper getXMLMapper(String resourceName, StateInf state) throws TException
      Throws:
      TException
    • getHeader

      public String getHeader(String name) throws TException
      return a header for the XML - this property is required
      Returns:
      XML header
      Throws:
      TException - XML not found
    • getName

      public String getName(String name) throws TException
      Get this name with namespace if supplied. If individual namespace is supplied for name then use it else use globalname space else not supplied
      Parameters:
      name - identifier name
      Returns:
      name with extracted namespace
      Throws:
      TException
    • getIDName

      public String getIDName() throws TException
      Get name of ID used for this namespace
      Parameters:
      name - identifier name
      Returns:
      name with extracted namespace
      Throws:
      TException
    • getResourceName

      public String getResourceName() throws TException
      Get name of ID used for this namespace
      Parameters:
      name - identifier name
      Returns:
      name with extracted namespace
      Throws:
      TException
    • getNameSpaceURI

      public String getNameSpaceURI() throws TException
      Throws:
      TException
    • getNameSpacePrefix

      public String getNameSpacePrefix() throws TException
      Throws:
      TException
    • getXHTML

      public String getXHTML() throws TException
      Throws:
      TException
    • getSemanticBase

      public String getSemanticBase() throws TException
      Throws:
      TException
    • getProperties

      public Properties getProperties(String resourceName) throws TException
      Gets a resource using the class loader
      Parameters:
      resourceName - Name of the file containing the resource. The name may include a relative path which is interpreted as being relative to the path "resources/" below the classpath root.
      Returns:
      An inputstream for the resource
      Throws:
      TException
    • dump

      public String dump(String header)