com.ibm.xsp.registry
Class RegistryUtil

java.lang.Object
  extended by com.ibm.xsp.registry.RegistryUtil

public class RegistryUtil
extends java.lang.Object


Constructor Summary
RegistryUtil()
           
 
Method Summary
static FacesProperty createFakeProperty(java.lang.String name, java.lang.Class<?> propertyClass)
           
static FacesComplexDefinition getComplexParent(FacesComplexDefinition child)
          Returns the FacesComplexDefinition's parent on the assumption that it supports the contract of it's parent always being a FacesComplexDefinition (or null).
static FacesComponentDefinition getComponentParent(FacesComponentDefinition child)
          Returns the FacesComponentDefinition's parent on the assumption that it supports the contract of it's parent always being a FacesComponentDefinition (or null).
static java.lang.String getDefaultPrefix(FacesDefinition def)
          Gets the default-prefix associated with the given namespace-uri, or null.
static java.util.Collection<FacesProperty> getDefinedProperties(FacesDefinition def)
           
static FacesComplexDefinition getFirstComplexDefinition(FacesRegistry reg, java.lang.Class<?> javaClass)
           
static FacesLibrary getLibrary(FacesDefinition def)
           
static FacesProject getProject(FacesDefinition def)
           
static java.util.Collection<FacesProperty> getProperties(FacesDefinition def)
           
static java.util.Collection<FacesProperty> getProperties(FacesDefinition def, java.util.Collection<java.lang.String> names)
           
static FacesRegistry getRegistry(FacesDefinition def)
          The registry that the definition is defined in.
static FacesRegistry getRegistry(FacesLibraryFragment file)
           
static java.lang.String getRegistryTypeName(FacesSharableRegistry reg)
          Non-localized string names for the registry types, like FacesSharableRegistry.TYPE_APPLICATION.
static java.lang.String getRendererId(java.lang.String rendererType, java.lang.String componentFamily)
          Computes a FacesRendererDefinition's id from it's rendererType and componentFamily
static java.lang.String getRendererKey(java.lang.String componentFamily, java.lang.String rendererType)
          Computes a FacesRendererDefinition's id from it's rendererType and componentFamily
static java.util.Map<java.lang.String,java.lang.String> getRenderKitAliasToIdMap(FacesRegistry reg)
          Map of renderKitAlias to Id, also includes each id mapped to itself.
static FacesRenderKitLibrary getRenderKitByAlias(FacesRegistry reg, java.lang.String alias)
          Returns a FacesRenderKitLibrary in the specified registry where FacesRenderKitLibrary.isRenderKitAlias(String) is true for the given String alias.
static java.lang.String getRenderKitId(FacesRendererDefinition renderer)
           
static java.util.List<FacesDefinition> getSubstitutableDefinitions(FacesDefinition ancestor, FacesRegistry reg)
          Returns an iterator over all definitions that can be substituted for the specified definition.
static boolean isGeneric(FacesSimpleProperty prop)
          Returns true if FacesSimpleProperty.getType() returns a type for which FacesSimpleTypes.isGeneric(int) is true.
static boolean isHasLocalClassDef(FacesSharableRegistry reg)
           
static boolean isItemPrimitive(FacesContainerProperty container)
          True if the itemProperty is a FacesSimpleProperty and it's type is primitive.
static boolean isPrimitive(FacesSimpleProperty prop)
          Returns true if FacesSimpleProperty.getType() returns a type for which FacesSimpleTypes.isPrimitive(int) is true.
static boolean isPrimitiveObject(FacesSimpleProperty prop)
          Returns true if FacesSimpleProperty.getType() returns a type for which FacesSimpleTypes.isPrimitiveObject(int) is true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegistryUtil

public RegistryUtil()
Method Detail

isPrimitive

public static boolean isPrimitive(FacesSimpleProperty prop)
Returns true if FacesSimpleProperty.getType() returns a type for which FacesSimpleTypes.isPrimitive(int) is true.

Parameters:
prop - the simple property whose type is to be checked.
Returns:
true if the property is primitive.
Throws:
java.lang.IllegalArgumentException - if the parameter is null.

isPrimitiveObject

public static boolean isPrimitiveObject(FacesSimpleProperty prop)
Returns true if FacesSimpleProperty.getType() returns a type for which FacesSimpleTypes.isPrimitiveObject(int) is true.

Parameters:
prop - the simple property whose type is to be checked.
Returns:
true if the property is a known 'primitive' object.
Throws:
java.lang.IllegalArgumentException - if the parameter is null.

isGeneric

public static boolean isGeneric(FacesSimpleProperty prop)
Returns true if FacesSimpleProperty.getType() returns a type for which FacesSimpleTypes.isGeneric(int) is true.

Parameters:
prop - the simple property whose type is to be checked.
Returns:
true if the property is generic.
Throws:
java.lang.IllegalArgumentException - if the parameter is null.

getProject

public static FacesProject getProject(FacesDefinition def)
Parameters:
def -
Returns:
The project of the library fragment that corresponds to this definition.

getRegistry

public static FacesRegistry getRegistry(FacesDefinition def)
The registry that the definition is defined in.

Parameters:
def -
Returns:

isItemPrimitive

public static boolean isItemPrimitive(FacesContainerProperty container)
True if the itemProperty is a FacesSimpleProperty and it's type is primitive.

Parameters:
container -
Returns:

getComplexParent

public static FacesComplexDefinition getComplexParent(FacesComplexDefinition child)
Returns the FacesComplexDefinition's parent on the assumption that it supports the contract of it's parent always being a FacesComplexDefinition (or null).

Parameters:
child -
Returns:
the parent

getComponentParent

public static FacesComponentDefinition getComponentParent(FacesComponentDefinition child)
Returns the FacesComponentDefinition's parent on the assumption that it supports the contract of it's parent always being a FacesComponentDefinition (or null).

Parameters:
child -
Returns:
the parent

getSubstitutableDefinitions

public static java.util.List<FacesDefinition> getSubstitutableDefinitions(FacesDefinition ancestor,
                                                                          FacesRegistry reg)
Returns an iterator over all definitions that can be substituted for the specified definition. It includes children of the definition and the definition itself.

Parameters:
ancestor -
reg -
Returns:

getRegistry

public static FacesRegistry getRegistry(FacesLibraryFragment file)

getLibrary

public static FacesLibrary getLibrary(FacesDefinition def)
Parameters:
def -
Returns:
The library this definition is in.

getRenderKitId

public static java.lang.String getRenderKitId(FacesRendererDefinition renderer)
Parameters:
renderer -
Returns:
The Id of the specified render kit.

getRenderKitByAlias

public static FacesRenderKitLibrary getRenderKitByAlias(FacesRegistry reg,
                                                        java.lang.String alias)
Returns a FacesRenderKitLibrary in the specified registry where FacesRenderKitLibrary.isRenderKitAlias(String) is true for the given String alias.

Parameters:
reg -
alias -
Returns:

getProperties

public static java.util.Collection<FacesProperty> getProperties(FacesDefinition def)

getDefinedProperties

public static java.util.Collection<FacesProperty> getDefinedProperties(FacesDefinition def)

getProperties

public static java.util.Collection<FacesProperty> getProperties(FacesDefinition def,
                                                                java.util.Collection<java.lang.String> names)

getFirstComplexDefinition

public static FacesComplexDefinition getFirstComplexDefinition(FacesRegistry reg,
                                                               java.lang.Class<?> javaClass)

getDefaultPrefix

public static java.lang.String getDefaultPrefix(FacesDefinition def)
Gets the default-prefix associated with the given namespace-uri, or null.


getRendererId

public static java.lang.String getRendererId(java.lang.String rendererType,
                                             java.lang.String componentFamily)
Computes a FacesRendererDefinition's id from it's rendererType and componentFamily


getRendererKey

public static java.lang.String getRendererKey(java.lang.String componentFamily,
                                              java.lang.String rendererType)
Computes a FacesRendererDefinition's id from it's rendererType and componentFamily


createFakeProperty

public static FacesProperty createFakeProperty(java.lang.String name,
                                               java.lang.Class<?> propertyClass)

isHasLocalClassDef

public static boolean isHasLocalClassDef(FacesSharableRegistry reg)

getRenderKitAliasToIdMap

public static java.util.Map<java.lang.String,java.lang.String> getRenderKitAliasToIdMap(FacesRegistry reg)
Map of renderKitAlias to Id, also includes each id mapped to itself.

Parameters:
reg -
Returns:

getRegistryTypeName

public static java.lang.String getRegistryTypeName(FacesSharableRegistry reg)
Non-localized string names for the registry types, like FacesSharableRegistry.TYPE_APPLICATION.

Parameters:
reg -
Returns: