|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.ocl.lpg.AbstractBasicEnvironment
public abstract class AbstractBasicEnvironment
Partial implementation of the BasicEnvironment interface, providing
default behaviours for most features.
| Constructor Summary | |
|---|---|
protected |
AbstractBasicEnvironment(BasicEnvironment parent)
Initializes me with the specified parent environment, which should be of the same type as me. |
| Method Summary | ||
|---|---|---|
void |
analyzerError(String problemMessage,
String problemContext,
int startOffset,
int endOffset)
Convenience method invoking getProblemHandler().analyzerProblem
with a ProblemHandler.errorSeverity. |
|
void |
analyzerError(String problemMessage,
String problemContext,
List<?> problemObjects)
Convenience method invoking getProblemHandler().analyzerProblem
with a ProblemHandler.errorSeverity. |
|
void |
analyzerError(String problemMessage,
String problemContext,
Object problemObject)
Convenience method invoking getProblemHandler().analyzerProblem
with a ProblemHandler.errorSeverity. |
|
void |
analyzerWarning(String problemMessage,
String problemContext,
Object problemObject)
Convenience method invoking getProblemHandler().analyzerProblem
with a ProblemHandler.warningSeverity. |
|
protected Map<Option<?>,Object> |
basicGetOptions()
|
|
Map<Option<?>,Object> |
clearOptions()
Clears all options. |
|
protected ProblemHandler |
createDefaultProblemHandler(AbstractParser parser)
|
|
|
getAdapter(Class<T> adapterType)
The abstract environment implementation is adaptable. |
|
CSTNode |
getASTMapping(Object object)
Return the mapping of an astNode to its originating cstNode, so that AST-based analysis may report error messages exploiting the CST context, or to support incremental AST/CST update. |
|
Map<Object,CSTNode> |
getASTNodeToCSTNodeMap()
|
|
FormattingHelper |
getFormatter()
Return the message formatter that may be used to format object-related contributions to problem messages. |
|
Map<Option<?>,Object> |
getOptions()
Obtains a copy of my map of options. |
|
BasicEnvironment |
getParent()
|
|
AbstractParser |
getParser()
Return the syntactic parser from which source tokens and text amy be obtained. |
|
ProblemHandler |
getProblemHandler()
Obtains a problem handler to service lexer, parser, analyzer, validator, ... errors. |
|
|
getValue(Option<T> option)
Obtains the value of the specified option's setting in the my options map. |
|
void |
initASTMapping(Object astNode,
CSTNode cstNode)
Initialize the mapping of an object (typically an astNode) to its originating cstNode, so that AST-based analysis may report error messages exploiting the CST context, or to support incremental AST/CST update. |
|
boolean |
isEnabled(Option<Boolean> option)
Queries whether the specified boolean-valued option is enabled. |
|
void |
lexerError(int errorCode,
int startOffset,
int endOffset)
Convenience method invoking getProblemHandler().lexerProblem
with a ProblemHandler.errorSeverity. |
|
void |
parserError(int errorCode,
int leftToken,
int rightToken,
String tokenText)
Convenience method invoking getProblemHandler().parserProblem
with a ProblemHandler.errorSeverity. |
|
void |
problem(ProblemHandler.Severity severity,
ProblemHandler.Phase phase,
String problemMessage,
String problemContext,
Object problemObject)
Generically reports a problem about some object. |
|
|
putOptions(Map<? extends Option<T>,? extends T> options)
Adds options to apply to my behaviour. |
|
|
removeOption(Option<T> option)
Removes the specified option. |
|
|
removeOptions(Collection<Option<T>> options)
Removes the specified options. |
|
void |
setASTNodeToCSTNodeMap(Map<Object,CSTNode> astNodeToCstNodeMap)
|
|
|
setOption(Option<T> option,
T value)
Add an option to apply to my behaviour. |
|
protected void |
setParent(BasicEnvironment parent)
Assigns me a parent environment after construction. |
|
void |
setParser(AbstractParser parser)
Define the syntactic parser from which source tokens and text amy be obtained. |
|
ProblemHandler |
setProblemHandler(ProblemHandler newProblemHandler)
Define the handler for any problem reports. |
|
void |
utilityError(String problemMessage,
String problemContext,
Object problemObject)
Convenience method invoking getProblemHandler().utilityProblem
with a ProblemHandler.errorSeverity. |
|
void |
validatorError(String problemMessage,
String problemContext,
Object problemObject)
Convenience method invoking getProblemHandler().validatorProblem
with a ProblemHandler.errorSeverity. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractBasicEnvironment(BasicEnvironment parent)
parent - an environment of the same type as me (or null)| Method Detail |
|---|
public <T> T getAdapter(Class<T> adapterType)
ProblemHandler interface.
Subclasses may override or extend this implementation.
getAdapter in interface AdaptableT - the requested adapter interfaceadapterType - the requested adapter interface
null
if this environment does not adapt to it
public void analyzerError(String problemMessage,
String problemContext,
Object problemObject)
BasicEnvironmentgetProblemHandler().analyzerProblem
with a ProblemHandler.errorSeverity.
analyzerError in interface BasicEnvironmentproblemMessage - message describing the problemproblemContext - optional message describing the reporting contextproblemObject - optional object associated with the problem
public void analyzerError(String problemMessage,
String problemContext,
List<?> problemObjects)
BasicEnvironmentgetProblemHandler().analyzerProblem
with a ProblemHandler.errorSeverity.
analyzerError in interface BasicEnvironmentproblemMessage - message describing the problemproblemContext - optional message describing the reporting contextproblemObjects - optional sequence of objects associated with the problem
public void analyzerError(String problemMessage,
String problemContext,
int startOffset,
int endOffset)
BasicEnvironmentgetProblemHandler().analyzerProblem
with a ProblemHandler.errorSeverity.
analyzerError in interface BasicEnvironmentproblemMessage - message describing the problemproblemContext - optional message describing the reporting contextstartOffset - character index at the start of the errorendOffset - character index beyond the end of the error
public void analyzerWarning(String problemMessage,
String problemContext,
Object problemObject)
BasicEnvironmentgetProblemHandler().analyzerProblem
with a ProblemHandler.warningSeverity.
analyzerWarning in interface BasicEnvironmentproblemMessage - message describing the problemproblemContext - optional message describing the reporting contextproblemObject - optional object associated with the problemprotected ProblemHandler createDefaultProblemHandler(AbstractParser parser)
public BasicEnvironment getParent()
public AbstractParser getParser()
BasicEnvironment
getParser in interface BasicEnvironmentpublic Map<Object,CSTNode> getASTNodeToCSTNodeMap()
public CSTNode getASTMapping(Object object)
BasicEnvironment
getASTMapping in interface BasicEnvironmentpublic FormattingHelper getFormatter()
BasicEnvironment
getFormatter in interface BasicEnvironmentpublic ProblemHandler getProblemHandler()
BasicEnvironment
getProblemHandler in interface BasicEnvironment
public void initASTMapping(Object astNode,
CSTNode cstNode)
BasicEnvironment
initASTMapping in interface BasicEnvironment
public void lexerError(int errorCode,
int startOffset,
int endOffset)
BasicEnvironmentgetProblemHandler().lexerProblem
with a ProblemHandler.errorSeverity.
lexerError in interface BasicEnvironmenterrorCode - the ParserErrorCodes value identifying the errorstartOffset - character index at the start of the errorendOffset - character index beyond the end of the error
public void parserError(int errorCode,
int leftToken,
int rightToken,
String tokenText)
BasicEnvironmentgetProblemHandler().parserProblem
with a ProblemHandler.errorSeverity.
parserError in interface BasicEnvironmenterrorCode - the ParserErrorCodes value identifying the errorleftToken - the lexical token index at the left hand edge of the errorrightToken - the lexical token index at the right hand edge of the errortokenText - additional text apprropriate to the ParserErrorCodes value.public void setASTNodeToCSTNodeMap(Map<Object,CSTNode> astNodeToCstNodeMap)
protected void setParent(BasicEnvironment parent)
null if I previously had one.
parent - my new parentpublic void setParser(AbstractParser parser)
BasicEnvironment
setParser in interface BasicEnvironmentpublic ProblemHandler setProblemHandler(ProblemHandler newProblemHandler)
BasicEnvironment
setProblemHandler in interface BasicEnvironment
public void utilityError(String problemMessage,
String problemContext,
Object problemObject)
BasicEnvironmentgetProblemHandler().utilityProblem
with a ProblemHandler.errorSeverity.
utilityError in interface BasicEnvironmentproblemMessage - message describing the problemproblemContext - optional message describing the reporting contextproblemObject - optional object associated with the problem
public void validatorError(String problemMessage,
String problemContext,
Object problemObject)
BasicEnvironmentgetProblemHandler().validatorProblem
with a ProblemHandler.errorSeverity.
validatorError in interface BasicEnvironmentproblemMessage - message describing the problemproblemContext - optional message describing the reporting contextproblemObject - optional object associated with the problem
public void problem(ProblemHandler.Severity severity,
ProblemHandler.Phase phase,
String problemMessage,
String problemContext,
Object problemObject)
BasicEnvironment
problem in interface BasicEnvironmentseverity - the severity of the problemphase - the phase in which the problem was encounteredproblemMessage - message describing the problemproblemContext - optional message describing the reporting contextproblemObject - optional object associated with the problemprotected Map<Option<?>,Object> basicGetOptions()
public Map<Option<?>,Object> getOptions()
Customizable
getOptions in interface Customizable
public <T> void setOption(Option<T> option,
T value)
Customizable
setOption in interface Customizableoption - the optionvalue - the option's valuepublic <T> void putOptions(Map<? extends Option<T>,? extends T> options)
Customizable
putOptions in interface Customizableoptions - the optionspublic <T> T removeOption(Option<T> option)
Customizable
removeOption in interface Customizableoption - the option to remove
public <T> Map<Option<T>,T> removeOptions(Collection<Option<T>> options)
Customizable
removeOptions in interface Customizableoptions - the options to remove
public Map<Option<?>,Object> clearOptions()
Customizable
clearOptions in interface Customizablepublic boolean isEnabled(Option<Boolean> option)
Customizable
isEnabled in interface Customizableoption - an option
public <T> T getValue(Option<T> option)
Customizable
getValue in interface Customizableoption - the option to query
|
Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||