Class PamelaMetaModelLibrary


  • public class PamelaMetaModelLibrary
    extends java.lang.Object
    The PamelaMetaModelLibrary represent the API used to instantiate a PAMELA model (a PamelaMetaModel). Computed PamelaMetaModel are stored in an internal cache.
    The idea behind this is to instantiate required model using a list of class acting as base entries. The inheritance links as well as the properties links (getter/setter) are explored - both are dependancy links -, as well as @Imports and @Import annotations, until a closure is computed. That scheme allows to avoid the explicit declaration of a PAMELA model boundary, since this is dynamically performed. This offers a basic solution to model fragmentation.
    Note following details regarding model exploration:
    • If a property link should not be followed (accessed type should not be part of returned PamelaMetaModel), use @Getter(...,ignoreType=true))
    • If a property type is specialized in PAMELA model to retrieve, declare in that type required entity specializations using @Imports annotations in generic type
    • Constructor Detail

      • PamelaMetaModelLibrary

        public PamelaMetaModelLibrary()
    • Method Detail

      • hasContext

        public static boolean hasContext​(java.lang.Class<?> baseClass)
        Indicates if PamelaMetaModel identified by baseClass was already computed
        Parameters:
        baseClass -
        Returns:
      • getCompoundModelContext

        public static PamelaMetaModel getCompoundModelContext​(java.util.List<java.lang.Class<?>> classes)
                                                       throws ModelDefinitionException
        Return (compute when not existant) a PamelaMetaModel (a PAMELA model) from supplied base classes as multiple entry points
        Parameters:
        classes - classes to consider to compute graph closure
        Returns:
        Throws:
        ModelDefinitionException
      • getCompoundModelContext

        public static PamelaMetaModel getCompoundModelContext​(java.lang.Class<?> baseClass,
                                                              java.lang.Class<?>[] classes)
                                                       throws ModelDefinitionException
        Return (compute when not existant) a PamelaMetaModel (a PAMELA model) from supplied base classes as multiple entry points
        Parameters:
        baseClass - main entry point
        classes - other classes to consider to compute graph closure
        Returns:
        Throws:
        ModelDefinitionException
      • clearCache

        public static void clearCache()
        Clear cache