net.dpml.lang
Class PartDecoder

java.lang.Object
  extended bynet.dpml.lang.PartDecoder
All Implemented Interfaces:
Decoder

public final class PartDecoder
extends Object
implements Decoder

Construct a part.


Field Summary
static String PART_XSD_URI
          Part XSD uri.
 
Method Summary
 Part build(Logger logger, Info information, Classpath classpath, Element strategy, Resolver resolver)
          Resolve a part plugin or resource strategy.
 Object decode(Element element, Resolver resolver)
          Resolve a object from a DOM element.
 Part decodePart(URI uri, Element element, Resolver resolver)
          Resolve a part from a DOM element.
protected  Classpath getClasspath(Element root)
          Construct the classpath defintion.
 URI getDecoderURI(Element element)
          Resolve the element decoder uri.
static PartDecoder getInstance()
          Get the singleton instance of the part decoder.
protected  Logger getLogger()
          Get the assigned logging channel.
 Part loadPart(URI uri, boolean cache)
          Load a part from a uri.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PART_XSD_URI

public static final String PART_XSD_URI
Part XSD uri.

See Also:
Constant Field Values
Method Detail

getInstance

public static PartDecoder getInstance()
Get the singleton instance of the part decoder.

Returns:
the decoder instance.

loadPart

public Part loadPart(URI uri,
                     boolean cache)
              throws IOException
Load a part from a uri.

Parameters:
uri - the part uri
cache - if true parts are cached relative to the requested uri
Returns:
the part definition
Throws:
IOException - if an IO error occurs

decode

public Object decode(Element element,
                     Resolver resolver)
              throws IOException
Resolve a object from a DOM element.

Specified by:
decode in interface Decoder
Parameters:
element - the dom element
resolver - build-time value resolver
Returns:
the resolved object
Throws:
IOException - if an error occurs during element evaluation

decodePart

public Part decodePart(URI uri,
                       Element element,
                       Resolver resolver)
                throws IOException
Resolve a part from a DOM element.

Parameters:
uri - the part uri
element - element part definition
resolver - build-time value resolver
Returns:
the resolved part datastructure
Throws:
IOException - if an error occurs during element evaluation

build

public Part build(Logger logger,
                  Info information,
                  Classpath classpath,
                  Element strategy,
                  Resolver resolver)
           throws IOException
Resolve a part plugin or resource strategy.

Parameters:
logger - the logging channel
information - the part info definition
classpath - the part classpath definition
strategy - part deployment strategy definition
resolver - build-time value resolver
Returns:
the resolved part
Throws:
IOException - if an error occurs during element evaluation

getDecoderURI

public URI getDecoderURI(Element element)
                  throws DecodingException
Resolve the element decoder uri.

Parameters:
element - the DOM element
Returns:
the decoder uri
Throws:
DecodingException - if an error occurs

getLogger

protected Logger getLogger()
Get the assigned logging channel.

Returns:
the logging channel

getClasspath

protected Classpath getClasspath(Element root)
                          throws DecodingException
Construct the classpath defintion.

Parameters:
root - the element containing a 'classpath' element.
Returns:
the classpath definition
Throws:
DecodingException - if an error occurs during element evaluation