Skip to content

Commit

Permalink
Refactor 'org.codehaus' -> 'org.grails' for 'grails-core'
Browse files Browse the repository at this point in the history
  • Loading branch information
graemerocher authored and graemerocher committed Jun 19, 2014
1 parent 90e5b56 commit b3c7b62
Show file tree
Hide file tree
Showing 235 changed files with 722 additions and 491 deletions.
Expand Up @@ -16,7 +16,7 @@
package org.codehaus.groovy.grails.commons.spring

import groovy.transform.CompileStatic
import org.codehaus.groovy.grails.commons.GrailsApplication
import grails.core.GrailsApplication
import org.codehaus.groovy.grails.plugins.GrailsPluginManager
import org.springframework.context.ApplicationContext

Expand Down
Expand Up @@ -16,7 +16,7 @@
package org.codehaus.groovy.grails.commons.spring

import groovy.transform.CompileStatic
import org.codehaus.groovy.grails.commons.GrailsApplication
import grails.core.GrailsApplication
import org.springframework.beans.BeansException
import org.springframework.beans.factory.support.DefaultListableBeanFactory
import org.springframework.context.ApplicationContext
Expand Down
Expand Up @@ -17,7 +17,7 @@ package org.codehaus.groovy.grails.web.binding

import groovy.transform.CompileStatic

import org.codehaus.groovy.grails.commons.GrailsApplication
import grails.core.GrailsApplication

/**
*
Expand Down
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.codehaus.groovy.grails.commons;
package grails.core;

import org.springframework.context.ApplicationContext;

Expand Down
@@ -1,84 +1,85 @@
/*
* Copyright 2004-2005 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.codehaus.groovy.grails.commons;

/**
* <p>The ArtefactHandler interface's purpose is to allow the analysis of conventions within a Grails application.
* An artefact is represented by the GrailsClass interface and this interface provides methods that allow artefacts to
* be identified, created and initialized.
*
* <p>Artefacts need to provide info about themselves, and some callbacks are required
* to verify whether or not a class is that kind of artefact/p>
*
* @see org.codehaus.groovy.grails.commons.GrailsApplication#registerArtefactHandler(ArtefactHandler)
*
* @author Graeme Rocher
* @author Marc Palmer (marc@anyware.co.uk)
*/
public interface ArtefactHandler {

/**
* Obtains the plugin name that deals with this artefact.
* @return The plugin name or null if there isn't one
*/
String getPluginName();

/**
* Implementations must return a name such as "Domain" to indicate the type of artefact they represent.
* @return The aretfact type, as a String
*/
String getType();

/**
* <p>Called by the GrailsApplication whenever it needs to know if a given class
* is considered to be the kind of artefact represented by this handler.</p>
* <p>Typically you will check the name of the class and some other properties to see
* if it is of the correct artefact type</p>
* @param aClass A class to test
* @return true if the class looks like one of your artefacts
*/
boolean isArtefact(@SuppressWarnings("rawtypes") Class aClass);

/**
* <p>Called by GrailsApplication when a new class is found and a GrailsClass wrapping it is required</p>
* @param artefactClass The new class that has been loaded
* @return A new custom GrailsClass wrapper containing any extra information your artefact type requires
*/
GrailsClass newArtefactClass(@SuppressWarnings("rawtypes") Class artefactClass);

/**
* <p>Called whenever the list of artefacts has changed or been reloaded.</p>
* <p>It must be safe to call this method multiple times and have any internal data structures reset.</p>
* @param artefacts The collection of artefact classes for this handler
*/
void initialize(ArtefactInfo artefacts);

/**
* <p>Called to retrieve an artefact relating to some other key for example a URI or tag name</p>
* <p>Handlers are responsible for caching the appropriate information using the data passed to them in calls
* to initialize()</p>
* @param feature Any object that acts as a key
* @return A matching artefact GrailsClass or null if there is no match for this feature ID
*/
GrailsClass getArtefactForFeature(Object feature);

/**
* <p>Called to check if the specified GrailsClass is one managed by this artefact handler</p>
* @param artefactGrailsClass A GrailsClass instance
* @return true if this handler manages the specified GrailsClass
*/
boolean isArtefactGrailsClass(GrailsClass artefactGrailsClass);
}
/*
* Copyright 2004-2005 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package grails.core;

/**
* <p>The ArtefactHandler interface's purpose is to allow the analysis of conventions within a Grails application.
* An artefact is represented by the GrailsClass interface and this interface provides methods that allow artefacts to
* be identified, created and initialized.
*
* <p>Artefacts need to provide info about themselves, and some callbacks are required
* to verify whether or not a class is that kind of artefact/p>
*
* @see GrailsApplication#registerArtefactHandler(ArtefactHandler)
*
* @author Graeme Rocher
* @author Marc Palmer (marc@anyware.co.uk)
* @since 1.0
*/
public interface ArtefactHandler {

/**
* Obtains the plugin name that deals with this artefact.
* @return The plugin name or null if there isn't one
*/
String getPluginName();

/**
* Implementations must return a name such as "Domain" to indicate the type of artefact they represent.
* @return The aretfact type, as a String
*/
String getType();

/**
* <p>Called by the GrailsApplication whenever it needs to know if a given class
* is considered to be the kind of artefact represented by this handler.</p>
* <p>Typically you will check the name of the class and some other properties to see
* if it is of the correct artefact type</p>
* @param aClass A class to test
* @return true if the class looks like one of your artefacts
*/
boolean isArtefact(@SuppressWarnings("rawtypes") Class aClass);

/**
* <p>Called by GrailsApplication when a new class is found and a GrailsClass wrapping it is required</p>
* @param artefactClass The new class that has been loaded
* @return A new custom GrailsClass wrapper containing any extra information your artefact type requires
*/
GrailsClass newArtefactClass(@SuppressWarnings("rawtypes") Class artefactClass);

/**
* <p>Called whenever the list of artefacts has changed or been reloaded.</p>
* <p>It must be safe to call this method multiple times and have any internal data structures reset.</p>
* @param artefacts The collection of artefact classes for this handler
*/
void initialize(ArtefactInfo artefacts);

/**
* <p>Called to retrieve an artefact relating to some other key for example a URI or tag name</p>
* <p>Handlers are responsible for caching the appropriate information using the data passed to them in calls
* to initialize()</p>
* @param feature Any object that acts as a key
* @return A matching artefact GrailsClass or null if there is no match for this feature ID
*/
GrailsClass getArtefactForFeature(Object feature);

/**
* <p>Called to check if the specified GrailsClass is one managed by this artefact handler</p>
* @param artefactGrailsClass A GrailsClass instance
* @return true if this handler manages the specified GrailsClass
*/
boolean isArtefactGrailsClass(GrailsClass artefactGrailsClass);
}
@@ -1,73 +1,76 @@
/*
* Copyright 2004-2005 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.codehaus.groovy.grails.commons;

import java.util.Map;

/**
* Holder for all the class-related info and structures relating to an Artefact.
* @author Marc Palmer (marc@anyware.co.uk)
* @author Graeme Rocher
*/
public interface ArtefactInfo {

/**
* Gets you the array of all artefact Class(es), the original classes loaded
* that represent the artefacts.
* @return The array, which may be empty but never null.
*/
@SuppressWarnings("rawtypes")
Class[] getClasses();

/**
* Gets you the array of all artefact GrailsClass(es), the classes used to track
* information about the artefact.
* @return The array, which may be empty but never null.
*/
GrailsClass[] getGrailsClasses();

/**
* Gets you the unmodifiable Map of all artefact Class(es), the actual classes implementing the artefact.
* <p>The Map is keyed by class name, i.e. "BookController"</p>
* @return The Map, which may be empty but never null.
*/
@SuppressWarnings("rawtypes")
Map getClassesByName();

/**
* <p>Gets you the unmodifiable Map of all artefact GrailsClass(es), the classes that store extra
* state relating to the artefact.</p>
* <p>The Map is keyed by class name, i.e. "BookController"</p>
* @return The Map, which may be empty but never null.
*/
@SuppressWarnings("rawtypes")
Map getGrailsClassesByName();

/**
* <p>Retrieves the GrailsClass representing a named artefact.</p>
* <p>From the GrailsClass you can get to the original artefact Class using getClazz().</p>
* @param name The name of the artefact, i.e. "BookController"
* @return The Map, which may be empty but never null.
*/
GrailsClass getGrailsClass(String name);

/**
* Retrieves a Grails class by its logical property name. For example "BookController" would be "book".
* @param logicalName The logical name
* @return A GrailsClass or null
*/
GrailsClass getGrailsClassByLogicalPropertyName(String logicalName);
}
/*
* Copyright 2004-2005 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package grails.core;

import java.util.Map;

/**
* Holder for all the class-related info and structures relating to an Artefact.
*
* @author Marc Palmer (marc@anyware.co.uk)
* @author Graeme Rocher
*
* @since 1.0
*/
public interface ArtefactInfo {

/**
* Gets you the array of all artefact Class(es), the original classes loaded
* that represent the artefacts.
* @return The array, which may be empty but never null.
*/
@SuppressWarnings("rawtypes")
Class[] getClasses();

/**
* Gets you the array of all artefact GrailsClass(es), the classes used to track
* information about the artefact.
* @return The array, which may be empty but never null.
*/
GrailsClass[] getGrailsClasses();

/**
* Gets you the unmodifiable Map of all artefact Class(es), the actual classes implementing the artefact.
* <p>The Map is keyed by class name, i.e. "BookController"</p>
* @return The Map, which may be empty but never null.
*/
@SuppressWarnings("rawtypes")
Map getClassesByName();

/**
* <p>Gets you the unmodifiable Map of all artefact GrailsClass(es), the classes that store extra
* state relating to the artefact.</p>
* <p>The Map is keyed by class name, i.e. "BookController"</p>
* @return The Map, which may be empty but never null.
*/
@SuppressWarnings("rawtypes")
Map getGrailsClassesByName();

/**
* <p>Retrieves the GrailsClass representing a named artefact.</p>
* <p>From the GrailsClass you can get to the original artefact Class using getClazz().</p>
* @param name The name of the artefact, i.e. "BookController"
* @return The Map, which may be empty but never null.
*/
GrailsClass getGrailsClass(String name);

/**
* Retrieves a Grails class by its logical property name. For example "BookController" would be "book".
* @param logicalName The logical name
* @return A GrailsClass or null
*/
GrailsClass getGrailsClassByLogicalPropertyName(String logicalName);
}
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.codehaus.groovy.grails.commons;
package grails.core;

import java.util.List;

Expand Down
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.codehaus.groovy.grails.commons;
package grails.core;

import grails.util.Environment;
import grails.util.Metadata;
Expand All @@ -30,7 +30,7 @@
* main purpose is to provide a mechanism for analysing the conventions within a Grails
* application as well as providing metadata and information about the execution environment.
*
* <p>The GrailsApplication interface interfacts with {@link org.codehaus.groovy.grails.commons.ArtefactHandler} instances
* <p>The GrailsApplication interface interfacts with {@link ArtefactHandler} instances
* which are capable of analysing different artefact types (controllers, domain classes etc.) and introspecting
* the artefact conventions
*
Expand Down
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.codehaus.groovy.grails.commons;
package grails.core;

import groovy.lang.MetaClass;

Expand Down

0 comments on commit b3c7b62

Please sign in to comment.