net.dpml.station
Class PlanContentHandler

java.lang.Object
  extended by java.net.ContentHandler
      extended by net.dpml.transit.ContentHandler
          extended by net.dpml.station.ApplianceContentHandler
              extended by net.dpml.station.PlanContentHandler
All Implemented Interfaces:
ApplianceContentManager, ApplianceFactory, ContentManager

public class PlanContentHandler
extends ApplianceContentHandler

Content handler for the plan artifact type.

Version:
2.1.0
Author:
Digital Product Management Library

Constructor Summary
PlanContentHandler()
          Creation of a new plan content handler.
 
Method Summary
 Object getContent(URLConnection connection)
          Returns the content in the form of a Appliance.
 Object getContent(URLConnection connection, Class[] classes)
          Returns the content assignable to the first recognized class in the list of suppied classes.
 String getType()
          Returns the type thar the content handler supports.
static Appliance newAppliance(String key, URI uri)
          Creation of a new appliance using a supplied key and appliance uri.
 Appliance newAppliance(URLConnection connection, String partition)
          Create a new appliance using the supplied connection object.
 
Methods inherited from class net.dpml.station.ApplianceContentHandler
getApplianceManagers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlanContentHandler

public PlanContentHandler()
Creation of a new plan content handler.

Method Detail

getType

public String getType()
Returns the type thar the content handler supports.

Specified by:
getType in interface ContentManager
Overrides:
getType in class ApplianceContentHandler
Returns:
the content type name

getContent

public Object getContent(URLConnection connection)
                  throws IOException
Returns the content in the form of a Appliance.

Overrides:
getContent in class ApplianceContentHandler
Parameters:
connection - the url connection
Returns:
the application handler
Throws:
IOException - if an IO error occurs

getContent

public Object getContent(URLConnection connection,
                         Class[] classes)
                  throws IOException
Returns the content assignable to the first recognized class in the list of suppied classes. If the class array is empty the application handler is returned. If none of the classes are recognized, null is returned.

Overrides:
getContent in class ApplianceContentHandler
Parameters:
connection - the url connection
classes - the selection class array
Returns:
the resolved instance
Throws:
IOException - if an IO error occurs

newAppliance

public Appliance newAppliance(URLConnection connection,
                              String partition)
                       throws IOException
Create a new appliance using the supplied connection object.

Specified by:
newAppliance in interface ApplianceFactory
Overrides:
newAppliance in class ApplianceContentHandler
Parameters:
connection - the URL connection
partition - an optional partition name
Returns:
the appliance
Throws:
IOException - if an IO error occurs

newAppliance

public static Appliance newAppliance(String key,
                                     URI uri)
                              throws IOException
Creation of a new appliance using a supplied key and appliance uri.

Parameters:
key - the appliance key
uri - an artifact uri referencing an appliance datastructure
Returns:
the new appliance
Throws:
IOException - if an IO error occurs