xArch/xADL 2.0 Data Binding Library

edu.uci.isr.xarch
Class XArchMetadataUtils

java.lang.Object
  extended byedu.uci.isr.xarch.XArchMetadataUtils

public class XArchMetadataUtils
extends Object


Constructor Summary
XArchMetadataUtils()
           
 
Method Summary
static Set getAvailablePromotions(XArchTypeMetadata type)
          Returns a set of all possible types to which the given type can be promotoed.
static XArchTypeMetadata getParent(XArchTypeMetadata type)
          Returns the parent type's metadata, or null if non exists.
static List getPromotionPathTypes(XArchTypeMetadata fromType, XArchTypeMetadata toType)
          Returns a list of XArchTypeMetadata involved in promoting an instance of fromType to an instance of toType.
static Collection getTopLevelElements()
          Returns a collection of all top level elements.
static XArchTypeMetadata getTypeMetadata(String packageTitle, String typeName)
          Returns the type metadata describing the specified type.
static boolean isAssignable(XArchTypeMetadata fromType, XArchTypeMetadata toType)
          Determines if the type represented by fromType is either the same as, or is a supertype of, the type represented by toType.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XArchMetadataUtils

public XArchMetadataUtils()
Method Detail

getTypeMetadata

public static XArchTypeMetadata getTypeMetadata(String packageTitle,
                                                String typeName)
Returns the type metadata describing the specified type.

Parameters:
packageTitle - package containing the type, or null if the type has no package
typeName - the type to return
Returns:
type metadata describing the specified type

isAssignable

public static boolean isAssignable(XArchTypeMetadata fromType,
                                   XArchTypeMetadata toType)
Determines if the type represented by fromType is either the same as, or is a supertype of, the type represented by toType. It returns true if so; otherwise it returns false.

Returns:
true if fromType is either the same as, or is a supertype of, toType.

getTopLevelElements

public static Collection getTopLevelElements()
Returns a collection of all top level elements.

Returns:
a collection of all top level elements

getParent

public static XArchTypeMetadata getParent(XArchTypeMetadata type)
Returns the parent type's metadata, or null if non exists.

Parameters:
type - the child metadata from which to determine the parent
Returns:
the parent type's metadata, or null if non exists.

getAvailablePromotions

public static Set getAvailablePromotions(XArchTypeMetadata type)
Returns a set of all possible types to which the given type can be promotoed.

Parameters:
type - the type metadata to start from
Returns:
a set of all possible types to which the given type can be promotoed

getPromotionPathTypes

public static List getPromotionPathTypes(XArchTypeMetadata fromType,
                                         XArchTypeMetadata toType)
Returns a list of XArchTypeMetadata involved in promoting an instance of fromType to an instance of toType. An empty list will be returned if fromType is an instance of toType. This method will return null if it is not possible to promote fromType to toType.

Parameters:
fromType - the initial type
toType - the desired type
Returns:
A list of promotions to promote fromType to toType, or null if it is not possible.

xArch/xADL 2.0 Data Binding Library