net.dpml.library.info
Class LibraryDecoder

java.lang.Object
  extended bynet.dpml.library.info.LibraryConstants
      extended bynet.dpml.library.info.LibraryDecoder

public final class LibraryDecoder
extends net.dpml.library.info.LibraryConstants

Utility class used for construction of a module model from an XML source.

Version:
1.1.0
Author:
Digital Product Meta Library

Constructor Summary
LibraryDecoder()
           
 
Method Summary
 LibraryDirective build(File source)
          Construct a library directive from XML source.
 ResourceDirective buildResource(URI uri)
          Construct a resource directive from source.
protected  boolean getAliasFlag(Element element)
          Return the alias attribute of the supplied element.
protected  String getID(Element element)
          Return the id attribute of the supplied element.
protected  Properties getProperties(Element element)
          Return properties declared within the supplied element as immediate child elements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LibraryDecoder

public LibraryDecoder()
Method Detail

build

public LibraryDirective build(File source)
                       throws IOException
Construct a library directive from XML source.

Parameters:
source - the XML source file
Returns:
the library directive
Throws:
IOException - if an IO exception occurs

buildResource

public ResourceDirective buildResource(URI uri)
                                throws IOException
Construct a resource directive from source.

Parameters:
uri - the source uri
Returns:
the resource directive
Throws:
IOException - if an IO exception occurs

getID

protected String getID(Element element)
                throws DecodingException
Return the id attribute of the supplied element.

Parameters:
element - the DOM element
Returns:
the id value
Throws:
DecodingException - if an error occurs during element evaluation

getAliasFlag

protected boolean getAliasFlag(Element element)
Return the alias attribute of the supplied element.

Parameters:
element - the DOM element
Returns:
the alias production flag value

getProperties

protected Properties getProperties(Element element)
Return properties declared within the supplied element as immediate child elements.

Parameters:
element - the enclosing DOM element
Returns:
the resolved properties instance