|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.jam.provider.JamClassBuilder
public abstract class JamClassBuilder
Implemented by providers to build and initialize classes on demand. The main responsibility a JAM provider has is writing an extension of this class.
Constructor Summary | |
---|---|
JamClassBuilder()
|
Method Summary | |
---|---|
protected void |
assertInitialized()
Asserts that init() has been called on this class builder. |
abstract MClass |
build(java.lang.String packageName,
java.lang.String className)
This is called by JAM when it attempts to load a class. |
protected MClass |
createClassToBuild(java.lang.String packageName,
java.lang.String className,
java.lang.String[] importSpecs)
When a JamClassBuilder decides that it is going to be able to respond to a build() request, it must call this method to get an initial instance of MClass to return. |
protected MClass |
createClassToBuild(java.lang.String packageName,
java.lang.String className,
java.lang.String[] importSpecs,
JamClassPopulator pop)
When a JamClassBuilder decides that it is going to be able to respond to a build() request, it must call this method to get an initial instance of MClass to return. |
protected JamLogger |
getLogger()
|
void |
init(ElementContext ctx)
This method is called by JAM to initialize this class builder. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JamClassBuilder()
Method Detail |
---|
public void init(ElementContext ctx)
ctx
- public abstract MClass build(java.lang.String packageName, java.lang.String className)
This is called by JAM when it attempts to load a class. If the builder has access to an artifact (typically a java source or classfile) that represents the given type, it should call createClassToBuild() to get a new instance of MClass and then return it. No caching should be performed - if an MClass is going to be returned, it should be a new instance returned by createClassToBuild()
If no artififact is available, the builder should just return null, signalling that other JamClassBuilders should attempt to build the class.
packageName
- className
-
protected MClass createClassToBuild(java.lang.String packageName, java.lang.String className, java.lang.String[] importSpecs, JamClassPopulator pop)
When a JamClassBuilder decides that it is going to be able to respond to a build() request, it must call this method to get an initial instance of MClass to return.
packageName
- qualified name of the package that contains the
class to createclassName
- simple name of the class to create.importSpecs
- array of import specs to be used in the class,
or null if not known or relevant. Import specs are only strictly
required if the builder is planning on setting any unqualified type
references on the class. The importspec values will be used in
determining what is retuned by JClass.getImportedPackages() and
getImportedClasses(). Note that an importSpec does not include the
word 'import' - e.g. it should only be 'java.util.List' or 'java.util.*'protected MClass createClassToBuild(java.lang.String packageName, java.lang.String className, java.lang.String[] importSpecs)
When a JamClassBuilder decides that it is going to be able to respond to a build() request, it must call this method to get an initial instance of MClass to return.
packageName
- qualified name of the package that contains the
class to createclassName
- simple name of the class to create.importSpecs
- array of import specs to be used in the class,
or null if not known or relevant. Import specs are only needed if
the builder is planning on setting any unqualified type references
on the class.protected JamLogger getLogger()
protected final void assertInitialized()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |