Interface com.ibm.ivj.util.builders.TypeBuilder
- public interface TypeBuilder
Method Index
- addMethodBuilder(MethodBuilder)
- Add a method builder to the type builder.
- checkMethodExists(MethodBuilder)
- Checks if the method defined by source already exists for the
type in the workspace.
- getBuilderName()
- Return the name of this type builder.The returned name
is computed from the arguments supplied on the
BuilderFactory.createTypeBuilder(...) call.
- getExistingMethods()
- Returns an array of MethodBuilder containing method builders
for methods defined for the type in the Workspace
- getExistingMethodSource(MethodBuilder)
- Returns any source code for the specified method builder that
is defined for this type currently loaded
in the workspace.
- getExistingSource()
- Returns any source code for the type currently loaded
in the workspace.
- getMethodBuilders()
- Returns an enumeration of MethodBuilder for any methods
that have been added to the builder using
TypeBuilder.addMethod(...)
- getSource()
- Returns any source code set into the builder by the caller.
- removeAllMethodBuilders()
- Removes all method builders from the type builder
- removeMethodBuilder(MethodBuilder)
- Remove a MethodBuilder previously added to the type builder.
- save()
- Save the builder source into the repository.
- saveMerge()
- Save the builder source into the repository.
- setSource(String)
- Sets the source code into the builder.
Methods
addMethodBuilder
public abstract void addMethodBuilder(MethodBuilder method)
- Add a method builder to the type builder. The method
builder can represent a new method, replacement
for an existing method or a deletion "request"
for an existing method
- Parameters:
- method - com.ibm.ivj.util.builders.MethodBuilder
checkMethodExists
public abstract boolean checkMethodExists(MethodBuilder method) throws IvjException
- Checks if the method defined by source already exists for the
type in the workspace. Returns false if this is a builder
for a new type
- Parameters:
- method - com.ibm.ivj.util.builders.MethodBuilder
- Returns:
- boolean
getBuilderName
public abstract String getBuilderName()
- Return the name of this type builder.The returned name
is computed from the arguments supplied on the
BuilderFactory.createTypeBuilder(...) call.
It is returned in the form of a qualified Java type name.
Note, that this name is strictly used
for programmer convenience in identifying the
individual type builders. The actual type name used
is determined based on the supplied type source (setSource(...)).
- Returns:
- java.lang.String
getExistingMethods
public abstract MethodBuilder[] getExistingMethods() throws IvjException
- Returns an array of MethodBuilder containing method builders
for methods defined for the type in the Workspace
- Returns:
- com.ibm.ivj.util.builders.MethodBuilder[]
getExistingMethodSource
public abstract String getExistingMethodSource(MethodBuilder method) throws IvjException
- Returns any source code for the specified method builder that
is defined for this type currently loaded
in the workspace. Returns null if there is no
corresponding method, or this is a type builder
for a new type
- Parameters:
- method - com.ibm.ivj.util.builders.MethodBuilder
- Returns:
- java.lang.String
getExistingSource
public abstract String getExistingSource() throws IvjException
- Returns any source code for the type currently loaded
in the workspace. Returns null if this is a builder
for a new type
- Returns:
- java.lang.String
getMethodBuilders
public abstract Enumeration getMethodBuilders()
- Returns an enumeration of MethodBuilder for any methods
that have been added to the builder using
TypeBuilder.addMethod(...)
- Returns:
- java.util.Enumeration
getSource
public abstract String getSource()
- Returns any source code set into the builder by the caller.
Note, that for existing types this is not the
source code for the type currently loaded in the workspace
- Returns:
- java.lang.String
removeAllMethodBuilders
public abstract void removeAllMethodBuilders()
- Removes all method builders from the type builder
removeMethodBuilder
public abstract void removeMethodBuilder(MethodBuilder method)
- Remove a MethodBuilder previously added to the type builder.
- Parameters:
- method - com.ibm.ivj.util.builders.MethodBuilder
save
public abstract void save() throws IvjException
- Save the builder source into the repository.
All provided source is used as full replacement source
for any existing source
saveMerge
public abstract void saveMerge() throws IvjException
- Save the builder source into the repository.
Merge any user code defined in "user blocks"
from the original code into the replacement code.
"User blocks" are designated in source using
TypeBuilder.userCodeBlock(...)
setSource
public abstract void setSource(String sourceCode)
- Sets the source code into the builder.
Note, that this does not immediately replace the
source code for the type currently loaded in the workspace.
The source is saved when the TypeBuilder.save() is called
- Parameters:
- sourceCode - java.lang.String
