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, ales.justin@jboss.org

Constructor Summary
AttachmentLocator()
           
 
Method Summary
static
<T> T
search(DeploymentUnit unit, Class<T> type)
          Deprecated. 
static Object search(DeploymentUnit unit, String name)
          Deprecated. 
static
<T> T
search(DeploymentUnit unit, String name, Class<T> expectedType)
          Deprecated. 
static
<T> T
searchAncestors(DeploymentUnit unit, Class<T> type)
          Get an attachment of the given type, search ancestors
static Object searchAncestors(DeploymentUnit unit, String name)
          Get a named attachment, search ancestors
static
<T> T
searchAncestors(DeploymentUnit unit, String name, Class<T> expectedType)
          Get named attachment of a given type, search ancestors
static
<T> T
searchChildren(DeploymentUnit unit, Class<T> type)
          Get an attachment of the given type, search in children
static Object searchChildren(DeploymentUnit unit, String name)
          Get a named attachment, search in children
static
<T> T
searchChildren(DeploymentUnit unit, String name, Class<T> expectedType)
          Get named attachment of a given type, search in children
 
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

@Deprecated
public static Object search(DeploymentUnit unit,
                                       String name)
Deprecated. 

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

@Deprecated
public static <T> T search(DeploymentUnit unit,
                                      String name,
                                      Class<T> expectedType)
Deprecated. 

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

@Deprecated
public static <T> T search(DeploymentUnit unit,
                                      Class<T> type)
Deprecated. 

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

searchAncestors

public static Object searchAncestors(DeploymentUnit unit,
                                     String name)
Get a named attachment, search ancestors

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

searchAncestors

public static <T> T searchAncestors(DeploymentUnit unit,
                                    String name,
                                    Class<T> expectedType)
Get named attachment of a given type, search ancestors

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

searchAncestors

public static <T> T searchAncestors(DeploymentUnit unit,
                                    Class<T> type)
Get an attachment of the given type, search ancestors

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

searchChildren

public static Object searchChildren(DeploymentUnit unit,
                                    String name)
Get a named attachment, search in children

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

searchChildren

public static <T> T searchChildren(DeploymentUnit unit,
                                   String name,
                                   Class<T> expectedType)
Get named attachment of a given type, search in children

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

searchChildren

public static <T> T searchChildren(DeploymentUnit unit,
                                   Class<T> type)
Get an attachment of the given type, search in children

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 © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.