net.dpml.component
Class Composition

java.lang.Object
  extended by net.dpml.lang.Part
      extended by net.dpml.component.Composition
All Implemented Interfaces:
Serializable, Directive
Direct Known Subclasses:
DefaultComposition

public abstract class Composition
extends Part
implements Directive

Component composition.

Version:
1.0.4
Author:
Digital Product Meta Library
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.dpml.lang.Part
PART_FOOTER, PART_HEADER, PART_SCHEMA_URN, VALUE_ENCODER, XML_HEADER
 
Constructor Summary
Composition(Logger logger, Info info, Classpath classpath, Controller controller, Directive directive, String label)
          Creation of a new abstract composition instance.
 
Method Summary
 boolean equals(Object other)
          Return true if this object is equal to the supplied object.
protected  Object getContent(Class c)
          Return the part content or null if the result type is unresolvable relative to the supplied class argument.
 Controller getController()
          Return the assigned controller.
 Directive getDirective()
          Get the deployment directive.
 Model getModel()
          Get the deployment model.
 int hashCode()
          Return the hashcode for the instance.
 Object instantiate(Object[] args)
          Instantiate a value.
 Component newComponent()
          Create and return a new component using the deplyment model established by the part.
 
Methods inherited from class net.dpml.lang.Part
encode, encodeStrategy, getClassLoader, getClasspath, getContent, getContent, getInfo, getLogger, load, load
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Composition

public Composition(Logger logger,
                   Info info,
                   Classpath classpath,
                   Controller controller,
                   Directive directive,
                   String label)
            throws IOException
Creation of a new abstract composition instance.

Parameters:
logger - the assigned logging channel
info - the part info descriptor
classpath - the part classpath definition
controller - the part controller
directive - the part deployment strategy directive
label - debug label
Throws:
IOException - if an I/O error occurs
Method Detail

getController

public Controller getController()
Return the assigned controller.

Returns:
the controller

getContent

protected Object getContent(Class c)
                     throws IOException
Return the part content or null if the result type is unresolvable relative to the supplied class argument. Class types recognized over and above the Part class include Directive, Model, Component and Controller.

Overrides:
getContent in class Part
Parameters:
c - the content class
Returns:
the content
Throws:
IOException - if an IO error occurs

getDirective

public Directive getDirective()
Get the deployment directive.

Returns:
the deployment directive

getModel

public Model getModel()
Get the deployment model.

Returns:
the deployment model

newComponent

public Component newComponent()
Create and return a new component using the deplyment model established by the part.

Returns:
the component

instantiate

public Object instantiate(Object[] args)
                   throws Exception
Instantiate a value.

Specified by:
instantiate in class Part
Parameters:
args - supplimentary arguments
Returns:
the resolved instance
Throws:
Exception - if a deployment error occurs

equals

public boolean equals(Object other)
Return true if this object is equal to the supplied object.

Overrides:
equals in class Part
Parameters:
other - the object to evaluate
Returns:
the equality status

hashCode

public int hashCode()
Return the hashcode for the instance.

Overrides:
hashCode in class Part
Returns:
the instance hashcode