Package grails.core
Class DefaultArtefactInfo
- java.lang.Object
-
- grails.core.DefaultArtefactInfo
-
- All Implemented Interfaces:
ArtefactInfo
public class DefaultArtefactInfo extends java.lang.Object implements ArtefactInfo
Mutable holder of artefact info.
-
-
Field Summary
Fields Modifier and Type Field Description java.util.MaphandlerData
-
Constructor Summary
Constructors Constructor Description DefaultArtefactInfo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddGrailsClass(GrailsClass artefactClass)Call to add a new class to this info object.voidaddOverridableGrailsClass(GrailsClass artefactGrailsClass)java.lang.Class<?>[]getClasses()Gets you the array of all artefact Class(es), the original classes loaded that represent the artefacts.java.util.Map<java.lang.String,java.lang.Class<?>>getClassesByName()Gets you the unmodifiable Map of all artefact Class(es), the actual classes implementing the artefact.GrailsClassgetGrailsClass(java.lang.String name)Retrieves the GrailsClass representing a named artefact.GrailsClassgetGrailsClassByLogicalPropertyName(java.lang.String logicalName)Retrieves a Grails class by its logical property name.GrailsClass[]getGrailsClasses()Gets you the array of all artefact GrailsClass(es), the classes used to track information about the artefact.java.util.Map<java.lang.String,GrailsClass>getGrailsClassesByName()Gets you the unmodifiable Map of all artefact GrailsClass(es), the classes that store extra state relating to the artefact.voidupdateComplete()Refresh the arrays generated from the maps.
-
-
-
Method Detail
-
addGrailsClass
public void addGrailsClass(GrailsClass artefactClass)
Call to add a new class to this info object.
You must call refresh() later to update the arrays
- Parameters:
artefactClass-
-
updateComplete
public void updateComplete()
Refresh the arrays generated from the maps.
-
getClasses
public java.lang.Class<?>[] getClasses()
Description copied from interface:ArtefactInfoGets you the array of all artefact Class(es), the original classes loaded that represent the artefacts.- Specified by:
getClassesin interfaceArtefactInfo- Returns:
- The array, which may be empty but never null.
-
getGrailsClasses
public GrailsClass[] getGrailsClasses()
Description copied from interface:ArtefactInfoGets you the array of all artefact GrailsClass(es), the classes used to track information about the artefact.- Specified by:
getGrailsClassesin interfaceArtefactInfo- Returns:
- The array, which may be empty but never null.
-
getClassesByName
public java.util.Map<java.lang.String,java.lang.Class<?>> getClassesByName()
Description copied from interface:ArtefactInfoGets you the unmodifiable Map of all artefact Class(es), the actual classes implementing the artefact.The Map is keyed by class name, i.e. "BookController"
- Specified by:
getClassesByNamein interfaceArtefactInfo- Returns:
- The Map, which may be empty but never null.
-
getGrailsClassesByName
public java.util.Map<java.lang.String,GrailsClass> getGrailsClassesByName()
Description copied from interface:ArtefactInfoGets you the unmodifiable Map of all artefact GrailsClass(es), the classes that store extra state relating to the artefact.
The Map is keyed by class name, i.e. "BookController"
- Specified by:
getGrailsClassesByNamein interfaceArtefactInfo- Returns:
- The Map, which may be empty but never null.
-
getGrailsClass
public GrailsClass getGrailsClass(java.lang.String name)
Description copied from interface:ArtefactInfoRetrieves the GrailsClass representing a named artefact.
From the GrailsClass you can get to the original artefact Class using getClazz().
- Specified by:
getGrailsClassin interfaceArtefactInfo- Parameters:
name- The name of the artefact, i.e. "BookController"- Returns:
- The Map, which may be empty but never null.
-
getGrailsClassByLogicalPropertyName
public GrailsClass getGrailsClassByLogicalPropertyName(java.lang.String logicalName)
Description copied from interface:ArtefactInfoRetrieves a Grails class by its logical property name. For example "BookController" would be "book".- Specified by:
getGrailsClassByLogicalPropertyNamein interfaceArtefactInfo- Parameters:
logicalName- The logical name- Returns:
- A GrailsClass or null
-
addOverridableGrailsClass
public void addOverridableGrailsClass(GrailsClass artefactGrailsClass)
-
-