|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.farrago.ddl.DdlStmt net.sf.farrago.ddl.DdlSetParamStmt
public abstract class DdlSetParamStmt
DdlSetParamStmt provides a common base class for DDL that alters configuration values on repository objects.
Field Summary | |
---|---|
private String |
paramName
|
private SqlLiteral |
paramValue
|
Constructor Summary | |
---|---|
DdlSetParamStmt(String paramName,
SqlLiteral paramValue)
Constructs a new DdlSetParamStmt. |
Method Summary | |
---|---|
String |
getParamName()
|
SqlLiteral |
getParamValue()
|
protected abstract void |
handleImmutableParameter(FarragoSessionDdlValidator ddlValidator,
InvalidNameException thrown)
Handle immutable parameters. |
protected abstract void |
handleInvalidName(FarragoSessionDdlValidator ddlValidator,
InvalidNameException thrown)
Handle invalide name exception. |
protected abstract void |
handleReflectionException(FarragoSessionDdlValidator ddlValidator,
Exception thrown)
Handle reflection exception. |
protected abstract void |
handleTypeMismatch(FarragoSessionDdlValidator ddlValidator,
TypeMismatchException thrown)
Handle type mismatch. |
protected void |
preValidate(FarragoSessionDdlValidator ddlValidator,
RefObject primaryConfig,
RefObject alternateConfig)
Prevalidates an "ALTER ... |
Methods inherited from class net.sf.farrago.ddl.DdlStmt |
---|
getModelElement, isDropRestricted, postCommit, postExecute, preExecute, preValidate, requiresCommit, runsAsDml, visit |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final String paramName
private final SqlLiteral paramValue
Constructor Detail |
---|
public DdlSetParamStmt(String paramName, SqlLiteral paramValue)
paramName
- name of parameter to setparamValue
- new value for parameterMethod Detail |
---|
public String getParamName()
public SqlLiteral getParamValue()
protected void preValidate(FarragoSessionDdlValidator ddlValidator, RefObject primaryConfig, RefObject alternateConfig)
First examines primaryConfig
to see if the paramName
is a valid name. If not, and if alternateConfig
is not null, tests alternateConfig
. If either succeeds,
converts paramValue
to the appropriate type and calls the RefFeatured.refSetValue(javax.jmi.reflect.RefObject, java.lang.Object)
mutator is called on the the
RefObject
.
Calls the following functions in the event of errors:
handleInvalidName(FarragoSessionDdlValidator,
InvalidNameException)
- if paramName
is not a member of
either RefObject.handleReflectionException( FarragoSessionDdlValidator,
Exception)
- if there's an error converting paramValue
.handleImmutableParameter(FarragoSessionDdlValidator,
InvalidNameException)
- if it turns out the parameter is immutable.handleTypeMismatch( FarragoSessionDdlValidator,
TypeMismatchException)
- if the paramValue
is successfully
converted but does not match the expected type for the parameter.
ddlValidator
- the DDL validator performing validationprimaryConfig
- the primary RefObject to check for param namesalternateConfig
- an alternate RefObject to use if
primaryConfig
doesn't contain the parameter.protected abstract void handleInvalidName(FarragoSessionDdlValidator ddlValidator, InvalidNameException thrown)
paramName
is not
recognized as a member of the RefObject passed to preValidate(FarragoSessionDdlValidator, RefObject, RefObject)
.
ddlValidator
- the object passed to preValidate(net.sf.farrago.session.FarragoSessionDdlValidator, javax.jmi.reflect.RefObject, javax.jmi.reflect.RefObject)
.thrown
- the InvalidNameException generatedprotected abstract void handleReflectionException(FarragoSessionDdlValidator ddlValidator, Exception thrown)
paramValue
.
ddlValidator
- the object passed to preValidate(net.sf.farrago.session.FarragoSessionDdlValidator, javax.jmi.reflect.RefObject, javax.jmi.reflect.RefObject)
.thrown
- the Exceptionprotected abstract void handleImmutableParameter(FarragoSessionDdlValidator ddlValidator, InvalidNameException thrown)
paramName
is an
immutable parameter of the RefObject passed to preValidate(FarragoSessionDdlValidator, RefObject, RefObject)
.
ddlValidator
- the object passed to preValidate(net.sf.farrago.session.FarragoSessionDdlValidator, javax.jmi.reflect.RefObject, javax.jmi.reflect.RefObject)
.thrown
- the InvalidNameException generated (which in this case
indicates an immutable parameter)protected abstract void handleTypeMismatch(FarragoSessionDdlValidator ddlValidator, TypeMismatchException thrown)
paramValue
has successfully
undergone type conversion but is not the expected type.
ddlValidator
- the object passed to preValidate(net.sf.farrago.session.FarragoSessionDdlValidator, javax.jmi.reflect.RefObject, javax.jmi.reflect.RefObject)
.thrown
- the TypeMismatchException thrown
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |