org.jboss.deployers.spi.deployer.helpers
Class AttachmentLocator

java.lang.Object
  extended by org.jboss.deployers.spi.deployer.helpers.AttachmentLocator

public class AttachmentLocator
extends Object

Search a DeploymentUnit structure from child to parent for a matching attachment.

Version:
$Revision:$
Author:
Scott.Stark@jboss.org, adrian@jboss.org

Constructor Summary
AttachmentLocator()
           
 
Method Summary
static
<T> T
search(org.jboss.deployers.structure.spi.DeploymentUnit unit, Class<T> type)
          Get an attachment of the given type
static Object search(org.jboss.deployers.structure.spi.DeploymentUnit unit, String name)
          Get a named attachment
static
<T> T
search(org.jboss.deployers.structure.spi.DeploymentUnit unit, String name, Class<T> expectedType)
          Get named attachment of a given type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttachmentLocator

public AttachmentLocator()
Method Detail

search

public static Object search(org.jboss.deployers.structure.spi.DeploymentUnit unit,
                            String name)
Get a named attachment

Parameters:
unit - the deployment unit
name - the name of the attachment
Returns:
the attachment or null if not present
Throws:
IllegalArgumentException - for a null name

search

public static <T> T search(org.jboss.deployers.structure.spi.DeploymentUnit unit,
                           String name,
                           Class<T> expectedType)
Get named attachment of a given type

Type Parameters:
T - the expected type
Parameters:
unit - the deployment unit
name - the name of the attachment
expectedType - the expected type
Returns:
the attachment or null if not present
Throws:
IllegalArgumentException - for a null name or expectedType

search

public static <T> T search(org.jboss.deployers.structure.spi.DeploymentUnit unit,
                           Class<T> type)
Get an attachment of the given type

Type Parameters:
T - the expected type
Parameters:
type - the type
unit - the deployment unit
Returns:
the attachment or null if not present
Throws:
IllegalArgumentException - for a null name or type


Copyright © 2008 JBoss Inc.. All Rights Reserved.