pt.digitalis.dif.codegen.util
Class DEMLoaderHelper

java.lang.Object
  extended by pt.digitalis.dif.codegen.util.DEMLoaderHelper

public final class DEMLoaderHelper
extends Object

Holds the list of packages that will be searched for Entity classes by the DIFCodeGenerator. Provides methods to add packages to the list of packages, and to access the list.

Author:
Pedro Viegas pviegas@digitalis.pt, Rodrigo Gonçalves rgoncalves@digitalis.pt
Created on:
Jul 23, 2007

Field Summary
static String APPLICATIONS_DIR
          'Applications' folder name by convention.
static String PROVIDERS_DIR
          'Providers' folder name by convention.
static String SERVICES_DIR
          'Services' folder name by convention.
static String STAGES_DIR
          'Stages' folder name by convention.
static String VALIDATORS_DIR
          'Validators' folder name by convention.
 
Method Summary
static boolean addPackage(String packageName)
          Adds a package to the packageList after validating that this package does not already exist or is contained in an existing parent package
static void cleanUp()
          Makes internal package list eligible for GC when it is no longer needed.
static Map<String,DEMAnnotationLogic> getAnnotationLogicMap()
          Builds a map of all DEM annotations with associated logic.
static List<String> getDEMAnnotations()
          Returns a list with the names of all DEM annotations classes.
static List<String> getDEMEntitiesAnnontations()
          Returns a list with the defined DEM Entity Annotation FQNs for the framework
static List<pt.digitalis.utils.bytecode.holders.ClassHolder> getDEMEntityClassesInPackage(String packageName)
          Searches a given package for DEM Entity annotated classes.
static List<String> getPackageList()
          Return the list of packages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROVIDERS_DIR

public static final String PROVIDERS_DIR
'Providers' folder name by convention.

See Also:
Constant Field Values

APPLICATIONS_DIR

public static final String APPLICATIONS_DIR
'Applications' folder name by convention.

See Also:
Constant Field Values

SERVICES_DIR

public static final String SERVICES_DIR
'Services' folder name by convention.

See Also:
Constant Field Values

STAGES_DIR

public static final String STAGES_DIR
'Stages' folder name by convention.

See Also:
Constant Field Values

VALIDATORS_DIR

public static final String VALIDATORS_DIR
'Validators' folder name by convention.

See Also:
Constant Field Values
Method Detail

addPackage

public static boolean addPackage(String packageName)
Adds a package to the packageList after validating that this package does not already exist or is contained in an existing parent package

Parameters:
packageName - the name of the package to add
Returns:
T if package was added, F otherwise

getPackageList

public static List<String> getPackageList()
Return the list of packages.

Returns:
the List of packages

cleanUp

public static void cleanUp()
Makes internal package list eligible for GC when it is no longer needed. Must be called explicitly since this is a static class with static attributes for temporary data.


getDEMEntityClassesInPackage

public static List<pt.digitalis.utils.bytecode.holders.ClassHolder> getDEMEntityClassesInPackage(String packageName)
                                                                                          throws pt.digitalis.utils.inspection.exception.ResourceNotFoundException
Searches a given package for DEM Entity annotated classes.

Parameters:
packageName - the package to search for DEM classes
Returns:
a List of CGClassHolder
Throws:
pt.digitalis.utils.inspection.exception.ResourceNotFoundException - if package is not found

getAnnotationLogicMap

public static Map<String,DEMAnnotationLogic> getAnnotationLogicMap()
                                                            throws pt.digitalis.utils.inspection.exception.ResourceNotFoundException,
                                                                   pt.digitalis.utils.inspection.exception.AuxiliaryOperationException
Builds a map of all DEM annotations with associated logic.

Returns:
the Map of annotations
Throws:
pt.digitalis.utils.inspection.exception.ResourceNotFoundException - if DEM annotations classes can't be found
pt.digitalis.utils.inspection.exception.AuxiliaryOperationException - if a DEMAnnotationLogic object can't be created

getDEMAnnotations

public static List<String> getDEMAnnotations()
                                      throws pt.digitalis.utils.inspection.exception.ResourceNotFoundException
Returns a list with the names of all DEM annotations classes.

Returns:
the list with all DEM annotations class names
Throws:
pt.digitalis.utils.inspection.exception.ResourceNotFoundException - if some needed resource is not found

getDEMEntitiesAnnontations

public static List<String> getDEMEntitiesAnnontations()
                                               throws pt.digitalis.utils.inspection.exception.ResourceNotFoundException
Returns a list with the defined DEM Entity Annotation FQNs for the framework

Returns:
a list with the defined DEM Entity Annotation FQNs
Throws:
pt.digitalis.utils.inspection.exception.ResourceNotFoundException - if DEM annotations classes can't be found


Copyright © 2014 Digitalis Informática Lda. All Rights Reserved.