Gant 1.9.6

org.codehaus.gant
[Groovy] Class AbstractInclude

java.lang.Object
  org.codehaus.gant.AbstractInclude

abstract class AbstractInclude
extends java.lang.Object

This class is for code sharing between classes doing include activity.

Authors:
Russel Winder
See Also:
IncludeTargets
IncludeTool


Field Summary
protected groovy.lang.Binding binding

The GantBinding for this run.

protected java.util.List loadedClasses

The list of loaded classes.

protected java.lang.Class pendingClass

When using the ** * operator there is a need to not instantiate the class immediately so information has to be buffered.

 
Constructor Summary
protected AbstractInclude(GantBinding binding)

Constructor.

 
Method Summary
protected java.lang.Object createInstance(java.lang.Class theClass)

Create an instance of a class included using the << operator.

protected java.lang.Object createInstance(java.lang.Class theClass, java.util.Map keywordParameters)

Create an instance of a class included with the ** * operator.

java.lang.Object leftShift(java.lang.Class theClass)

Implementation of the << operator taking a Class parameter.

java.lang.Object leftShift(java.io.File file)

Implementation of the << operator taking a File parameter.

java.lang.Object leftShift(java.lang.String s)

Implementation of the << operator taking a String parameter.

java.lang.Object leftShift(java.util.List l)

Implementation of the << operator taking a List parameter.

java.lang.Object leftShift(java.lang.Object o)

Implementation of the << operator taking a Object parameter.

java.lang.Object multiply(java.util.Map keywordParameters)

Implementation of the * operator taking a Map parameter.

java.lang.Object power(java.lang.Class theClass)

Implementation of the ** operator taking a Class parameter.

protected java.lang.Object readFile(java.io.File file, boolean asClass = false )

Read a file which may or may not be a class, searching the Gant library path if the file cannot be found at first.

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

binding

protected groovy.lang.Binding binding
The GantBinding for this run.


loadedClasses

protected final java.util.List loadedClasses
The list of loaded classes.


pendingClass

protected java.lang.Class pendingClass
When using the ** * operator there is a need to not instantiate the class immediately so information has to be buffered. This variable holds a reference to the class ready for instantiation once all the constructor parameters are known.


 
Constructor Detail

AbstractInclude

protected AbstractInclude(GantBinding binding)
Constructor.
Parameters:
binding - The GantBinding to associate with.


 
Method Detail

createInstance

protected java.lang.Object createInstance(java.lang.Class theClass)
Create an instance of a class included using the << operator.
throws:
NoSuchMethodException if the required constructor cannot be found.
Parameters:
theClass - The Class to instantiate.


createInstance

protected java.lang.Object createInstance(java.lang.Class theClass, java.util.Map keywordParameters)
Create an instance of a class included with the ** * operator.
throws:
NoSuchMethodException if the required constructor cannot be found.
Parameters:
theClass - The Class to instantiate.
keywordParameter - The Map containing the parameters for construction.


leftShift

java.lang.Object leftShift(java.lang.Class theClass)
Implementation of the << operator taking a Class parameter.
Parameters:
theClass - The Class to load and instantiate.
Returns:
The includer object to allow for << chaining.


leftShift

java.lang.Object leftShift(java.io.File file)
Implementation of the << operator taking a File parameter.
Parameters:
file - The File to load, compile, and instantiate.
Returns:
The includer object to allow for << chaining.


leftShift

java.lang.Object leftShift(java.lang.String s)
Implementation of the << operator taking a String parameter.
Parameters:
s - The String to compile and instantiate.
Returns:
The includer object to allow for << chaining.


leftShift

java.lang.Object leftShift(java.util.List l)
Implementation of the << operator taking a List parameter.
Parameters:
l - The List of things to load (, compile) and instantiate.
Returns:
The includer object to allow for << chaining.


leftShift

java.lang.Object leftShift(java.lang.Object o)
Implementation of the << operator taking a Object parameter. This always throws an exception, it is here to avoid using a type other than Class, File, String or List (of Class, File, or String).
Throws:
RuntimeException always.
Parameters:
theClass - The Class to load and instantiate.


multiply

java.lang.Object multiply(java.util.Map keywordParameters)
Implementation of the * operator taking a Map parameter. This operator only makes sense immediately after a ** operator, since only then is there a Class to instantiate.
Parameters:
keywordParameter - The Map of parameters to the constructor.
Returns:
The includer object to allow for ** * operator chaining.


power

java.lang.Object power(java.lang.Class theClass)
Implementation of the ** operator taking a Class parameter.
Parameters:
theClass - The Class to load and instantiate.
Returns:
The includer object to allow for * operator.


readFile

protected java.lang.Object readFile(java.io.File file, boolean asClass = false )
Read a file which may or may not be a class, searching the Gant library path if the file cannot be found at first.
throws:
FileNotFoundException when the file cannot be found.
Parameters:
file - The File to read.
asClass - Specify whether this is supposed to be a class.


 

Copyright © 2006–9 The Codehaus. All Rights Reserved.