Package grails.core

Class 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.Map handlerData  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addGrailsClass​(GrailsClass artefactClass)
      Call to add a new class to this info object.
      void addOverridableGrailsClass​(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.
      GrailsClass getGrailsClass​(java.lang.String name)
      Retrieves the GrailsClass representing a named artefact.
      GrailsClass getGrailsClassByLogicalPropertyName​(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.
      void updateComplete()
      Refresh the arrays generated from the maps.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • handlerData

        public java.util.Map handlerData
    • Constructor Detail

      • DefaultArtefactInfo

        public DefaultArtefactInfo()
    • 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: ArtefactInfo
        Gets you the array of all artefact Class(es), the original classes loaded that represent the artefacts.
        Specified by:
        getClasses in interface ArtefactInfo
        Returns:
        The array, which may be empty but never null.
      • getGrailsClasses

        public GrailsClass[] getGrailsClasses()
        Description copied from interface: ArtefactInfo
        Gets you the array of all artefact GrailsClass(es), the classes used to track information about the artefact.
        Specified by:
        getGrailsClasses in interface ArtefactInfo
        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: ArtefactInfo
        Gets 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:
        getClassesByName in interface ArtefactInfo
        Returns:
        The Map, which may be empty but never null.
      • getGrailsClassesByName

        public java.util.Map<java.lang.String,​GrailsClass> getGrailsClassesByName()
        Description copied from interface: ArtefactInfo

        Gets 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:
        getGrailsClassesByName in interface ArtefactInfo
        Returns:
        The Map, which may be empty but never null.
      • getGrailsClass

        public GrailsClass getGrailsClass​(java.lang.String name)
        Description copied from interface: ArtefactInfo

        Retrieves the GrailsClass representing a named artefact.

        From the GrailsClass you can get to the original artefact Class using getClazz().

        Specified by:
        getGrailsClass in interface ArtefactInfo
        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: ArtefactInfo
        Retrieves a Grails class by its logical property name. For example "BookController" would be "book".
        Specified by:
        getGrailsClassByLogicalPropertyName in interface ArtefactInfo
        Parameters:
        logicalName - The logical name
        Returns:
        A GrailsClass or null
      • addOverridableGrailsClass

        public void addOverridableGrailsClass​(GrailsClass artefactGrailsClass)