- All Superinterfaces:
- ExecuteScope,- Scope
- All Known Subinterfaces:
- BindContext,- RenderContext
 This type implements Scope and thus has a lifecycle defined by the
 rendering or binding operation.
 
 The Scope.data() map contents are maintained for the entirety of the
 rendering or binding operation, and are passed along to child Scope
 types, including e.g.
 
- GeneratorContext: When computing client side computed column values
- BindingSQLContext: When generating the SQL for bind values
- Author:
- Lukas Eder
- See Also:
- 
Method SummaryModifier and TypeMethodDescription@NotNull BindContextBind a value using a specific type.@NotNull RenderContext.CastModecastMode()The currently applied cast mode for bind values.Set the new cast mode forcastMode().castMode(RenderContext.CastMode mode, Consumer<? super C> consumer) Set the new cast mode forcastMode()for the scope of aConsumer.castModeIf(RenderContext.CastMode mode, boolean condition) Set the new cast mode forcastMode(), if a condition is true.Set a data value for a key for the scope of aConsumer.booleanWhether the current context is rendering a SQL alias declarations indeclareTables()ordeclareFields()sections.declareAliases(boolean declareTables) Whether the current context is rendering a SQL alias declarations indeclareTables()ordeclareFields()sections.declareAliases(boolean declareTables, Consumer<? super C> consumer) Whether the current context is rendering a SQL alias declarations indeclareTables()ordeclareFields()sections for the scope of aConsumer.booleanWhether the current context is rendering a common table expression (e.g.declareCTE(boolean declareCTE) Set the new context value fordeclareCTE().declareCTE(boolean declareCTE, Consumer<? super C> consumer) Set the new context value fordeclareCTE()for the scope of aConsumer.booleanWhether the current context is rendering a SQL field declaration (e.g.declareFields(boolean declareFields) Set the new context value fordeclareFields().declareFields(boolean declareFields, Consumer<? super C> consumer) Set the new context value fordeclareFields()for the scope of aConsumer.booleanWhether the current context is rendering a procedure or function parameter declaration.declareParameters(boolean declareParameters) Set the new context value fordeclareParameters().declareParameters(boolean declareParameters, Consumer<? super C> consumer) Set the new context value fordeclareParameters()for the scope of aConsumer.booleanWhether the current context is rendering a SQL table declaration (e.g.declareTables(boolean declareTables) Set the new context value fordeclareTables().declareTables(boolean declareTables, Consumer<? super C> consumer) Set the new context value fordeclareTables()for the scope of aConsumer.booleanWhether the current context is rendering a SQL window declaration (e.g.declareWindows(boolean declareWindows) Set the new context value fordeclareWindows().declareWindows(boolean declareWindows, Consumer<? super C> consumer) Set the new context value fordeclareWindows()for the scope of aConsumer.booleanWhether the current context is rendering a derived table subquery.derivedTableSubquery(boolean derivedTableSubquery) Set the new context value forderivedTableSubquery().A formatter to produce scientific notation forDoubletypes.A formatter to produce scientific notation forFloattypes.booleanformat()The value ofSettings.isRenderFormatted().format(boolean format) Override the value ofSettings.isRenderFormatted().Stop indenting subsequent SQL by one level (two characters), ifSettings.isRenderFormatted()is set totrue.formatIndentEnd(int indent) Stop indenting subsequent SQL by a number of characters, ifSettings.isRenderFormatted()is set totrue.Deprecated, for removal: This API element is subject to removal in a future version.- [#10317] - 3.14.0 - Do not reuse this method.Deprecated, for removal: This API element is subject to removal in a future version.- [#10317] - 3.14.0 - Do not reuse this method.Start indenting subsequent SQL by one level (two characters), ifSettings.isRenderFormatted()is set totrue.formatIndentStart(int indent) Start indenting subsequent SQL by a number of characters, ifSettings.isRenderFormatted()is set totrue.Render a new line character (only ifSettings.isRenderFormatted()is set totrue).Render a new line character (only ifSettings.isRenderFormatted()is set totrue, and theformatPrintMargin(int)has been exceeded).formatPrintMargin(int margin) Set a print margin that will be applied to formatted SQL, ifSettings.isRenderFormatted()is set totrue.Render a new line character (only ifSettings.isRenderFormatted()is set totrue), or a whitespace separator character otherwise.booleaninCurrentScope(QueryPart part) Check whether a query part is registered in the current scope.booleanCheck whether a query part is registered in the current scope or higher.Deprecated, for removal: This API element is subject to removal in a future version.- 3.10.0 - [#4990] - UseDSL.keyword(String)instead.@NotNull LanguageContextThe current language context.languageContext(LanguageContext languageContext) Set the new language context forlanguageContext()languageContext(LanguageContext languageContext, Consumer<? super C> consumer) Set the new language context forlanguageContext()for the scope of aConsumer.languageContext(LanguageContext languageContext, QueryPart topLevelForLanguageContext, Consumer<? super C> consumer) Set the new language context forlanguageContext()for the scope of aConsumer.languageContextIf(LanguageContext languageContext, boolean condition) Set the new language context forlanguageContext(), if a condition is true.Deprecated, for removal: This API element is subject to removal in a future version.- 3.10.0 - [#4990] - Use any ofDSL.name(String),DSL.quotedName(String)orDSL.unquotedName(String)instead.@NotNull StringReturn a new alias that is unique for the scope of one query.intGet the next bind index.@NotNull ParamTypeSpecify, how bind values should be rendered.Set the new context value forparamType().Set the new context value forparamType()for the scope of aConsumer.paramTypeIf(ParamType paramType, boolean condition) Set the new context value forparamType(), if a condition is true.paramTypeIf(ParamType paramType, boolean condition, Consumer<? super C> runnable) Set the new context value forparamType()for the scope of aConsumer, if a condition is true.@NotNull StringPeek the next alias that will be generated bynextAlias().intPeek the next bind index.booleanWhether the current context is rendering a predicand subquery, i.e.predicandSubquery(boolean predicandSubquery) Set the new context value forpredicandSubquery().booleanqualify()Whether query parts should render qualified names or not.qualify(boolean qualify) Set the new context value forqualify().booleanWhether query parts should renderCatalog-qualified names or not.qualifyCatalog(boolean qualifyCatalog) Set the new context value forqualifyCatalog().qualifyCatalog(boolean qualifyCatalog, Consumer<? super C> consumer) Set the new context value forqualifyCatalog()for the scope of aConsumer.booleanWhether query parts should renderSchema-qualified names or not.qualifySchema(boolean qualifySchema) Set the new context value forqualifySchema().qualifySchema(boolean qualifySchema, Consumer<? super C> consumer) Set the new context value forqualifySchema()for the scope of aConsumer.booleanquote()WhetherNameparts (andliteral(String)) should be quoted.quote(boolean quote) Set the new context value forquote().@NotNull Stringrender()Render the context's underlying SQL statement.@NotNull StringRender a query part in a new context derived from this one.scopeEnd()End a previous SELECT scope.intWhich level of scopes we're currently in, starting with 0 for the top scope.@NotNull QueryPartscopeMapping(QueryPart part) Retrieve the registered mapping for a query part in the current scope.scopeMarkEnd(QueryPart part) Mark the end of a scoped query part.scopeMarkStart(QueryPart part) Mark the beginning of a scoped query part.@Nullable QueryPartReturn theQueryPartthat defines the currentscopeStart(QueryPart), if any, ornullif there is no suchQueryPart.scopeParts(Class<? extends Q> type) Get all values of a type that are in the current scope or higher.scopeRegister(QueryPart part) Register a "special" query part in the scope, reusing the object from a higher scope, if available.scopeRegister(QueryPart part, boolean forceNew) Register a "special" query part in the scope, allowing to force registering the object in the new scope, if a higher scope already has the object.scopeRegister(QueryPart part, boolean forceNew, QueryPart mapped) Register a "special" query part in the scope, allowing to force registering the object in the new scope, if a higher scope already has the object, as well as providing a mapped part to map the original part to.scopeRegisterAndMark(QueryPart part, boolean forceNew) Start a new scope.scopeStart(QueryPart part) Start a new scope, passing the currentQueryPartas thescopePart().booleanWhether some sort of separator is required before rendering the nextQueryPart.separatorRequired(boolean separatorRequired) Specify that a separator will be required before the nextvisit(QueryPart)call, but leave the decision whether to generate aformatSeparator()or just a whitespace to that nextQueryPart.booleanWhether the current context is rendering a set operation subquery.setOperationSubquery(boolean setOperationSubquery) Set the new context value forsetOperationSubquery().Skip an additional update count produced by this query.intThe number of update counts to be skipped by this query.skipUpdateCounts(int skip) Skip a number of additional update counts produced by this query.sql(char sql) Append some SQL to the context's containedStringBuilder.sql(double sql) Append some SQL to the context's containedStringBuilder.sql(float sql) Append some SQL to the context's containedStringBuilder.sql(int sql) Append some SQL to the context's containedStringBuilder.sql(long sql) Append some SQL to the context's containedStringBuilder.Append some SQL to the context's containedStringBuilder.Append some SQL to the context's containedStringBuilder.Append some SQL to the context's containedStringBuilderpreceded by the usual calls toformatIndentEnd()andformatNewLine().sqlIndentEnd(char sql) Append some SQL to the context's containedStringBuilderpreceded by the usual calls toformatIndentEnd()andformatNewLine().sqlIndentEnd(String sql) Append some SQL to the context's containedStringBuilderpreceded by the usual calls toformatIndentEnd()andformatNewLine().Append some SQL to the context's containedStringBuilder, followed by the usual calls toformatIndentStart()andformatNewLine().sqlIndentStart(char sql) Append some SQL to the context's containedStringBuilder, followed by the usual calls toformatIndentStart()andformatNewLine().sqlIndentStart(String sql) Append some SQL to the context's containedStringBuilder, followed by the usual calls toformatIndentStart()andformatNewLine().TODO [#2667] Properties of these methods: - A clause is always started / ended, even if it isn't rendered or if it's empty!@Nullable PreparedStatementRetrieve the context's underlyingPreparedStatementif available, ornullif this traversal does not operate on aPreparedStatement.booleanwhether the current context is rendering a string literal.stringLiteral(boolean stringLiteral) Set the new context value forstringLiteral().booleansubquery()Whether the current context is rendering a subquery (nested query).subquery(boolean subquery) Set the new context value forsubquery().Set the new context value forsubquery()as well asscopePart()aintWhich level of subqueries we're currently in, starting with 0 for the top level query.@Nullable QueryParttopLevel()The top levelQueryPartthat is being rendered.Set the top levelQueryPartthat is being rendered.@Nullable QueryPartThe top levelQueryPartthat is being rendered in the currentlanguageContext().topLevelForLanguageContext(QueryPart topLevelForLanguageContext) Set the top levelQueryPartthat is being rendered in the currentlanguageContext().Visit aFieldas aDSL.field(Condition), if it is aCondition, or as an ordineryQueryPart, otherwise.Visit aQueryPartin the currentContext.Visit a query part with a given value forparamType().visitSubquery(QueryPart part) Visit aQueryPartas a subquery in the currentContext.Methods inherited from interface org.jooq.ExecuteScopeconverterContext, executeContextMethods inherited from interface org.jooq.Scopeconfiguration, creationTime, data, data, data, dialect, dsl, family, settings
- 
Method Details- 
visitVisit aQueryPartin the currentContext.This method is called by certain QueryPartimplementations to recursively visit componentQueryParts.- Parameters:
- part- The component- QueryPart
- Throws:
- DataAccessException- If something went wrong while visiting the component- QueryPart, e.g. when binding a variable
 
- 
visit- Throws:
- DataAccessException
 
- 
visitVisit aFieldas aDSL.field(Condition), if it is aCondition, or as an ordineryQueryPart, otherwise.[#11969] Not all RDBMS support Conditionin the form ofFieldof typeBoolean, natively. As such, we must wrap any suchConditionusingDSL.field(Condition)to make sure the appropriate emulations are implemented. This applies to conditions that are declared asField, e.g. the arguments of a function likeDSL.nvl(Field, Field).If a Conditionis declared as a condition, then this doesn't apply andvisit(Condition)is invoked, instead, e.g. the arguments ofAggregateFilterStep.filterWhere(Condition).- Throws:
- DataAccessException
 
- 
visitSubqueryVisit aQueryPartas a subquery in the currentContext.This method is called by certain QueryPartimplementations to recursively visit componentQueryParts.- Parameters:
- part- The component- QueryPart
- Throws:
- DataAccessException- If something went wrong while visiting the component- QueryPart, e.g. when binding a variable
 
- 
startTODO [#2667] Properties of these methods: - A clause is always started / ended, even if it isn't rendered or if it's empty!
- 
end
- 
dataSet a data value for a key for the scope of aConsumer.
- 
declareFieldsboolean declareFields()Whether the current context is rendering a SQL field declaration (e.g. aFieldin theSELECTclause of the query).
- 
declareFieldsSet the new context value fordeclareFields().
- 
declareFieldsSet the new context value fordeclareFields()for the scope of aConsumer.
- 
declareTablesboolean declareTables()Whether the current context is rendering a SQL table declaration (e.g. aTablein theFROMorJOINclause of the query).
- 
declareTablesSet the new context value fordeclareTables().
- 
declareTablesSet the new context value fordeclareTables()for the scope of aConsumer.
- 
declareAliasesboolean declareAliases()Whether the current context is rendering a SQL alias declarations indeclareTables()ordeclareFields()sections.
- 
declareAliasesWhether the current context is rendering a SQL alias declarations indeclareTables()ordeclareFields()sections.
- 
declareAliasesWhether the current context is rendering a SQL alias declarations indeclareTables()ordeclareFields()sections for the scope of aConsumer.
- 
declareWindowsboolean declareWindows()Whether the current context is rendering a SQL window declaration (e.g. aWindowDefinitionin theWINDOWclause of the query).
- 
declareWindowsSet the new context value fordeclareWindows().
- 
declareWindowsSet the new context value fordeclareWindows()for the scope of aConsumer.
- 
declareParametersWhether the current context is rendering a procedure or function parameter declaration.
- 
declareParametersSet the new context value fordeclareParameters().
- 
declareParametersSet the new context value fordeclareParameters()for the scope of aConsumer.
- 
declareCTEboolean declareCTE()Whether the current context is rendering a common table expression (e.g. aCommonTableExpressionin theWITHclause of the query).
- 
declareCTESet the new context value fordeclareCTE().
- 
declareCTESet the new context value fordeclareCTE()for the scope of aConsumer.
- 
topLevelThe top levelQueryPartthat is being rendered.
- 
topLevelSet the top levelQueryPartthat is being rendered.
- 
topLevelForLanguageContextThe top levelQueryPartthat is being rendered in the currentlanguageContext().
- 
topLevelForLanguageContextSet the top levelQueryPartthat is being rendered in the currentlanguageContext().
- 
subqueryboolean subquery()Whether the current context is rendering a subquery (nested query).
- 
subquerySet the new context value forsubquery().
- 
subquerySet the new context value forsubquery()as well asscopePart()a
- 
derivedTableSubqueryboolean derivedTableSubquery()Whether the current context is rendering a derived table subquery.
- 
derivedTableSubquerySet the new context value forderivedTableSubquery().
- 
setOperationSubqueryboolean setOperationSubquery()Whether the current context is rendering a set operation subquery.
- 
setOperationSubquerySet the new context value forsetOperationSubquery().
- 
predicandSubqueryboolean predicandSubquery()Whether the current context is rendering a predicand subquery, i.e. a subquery that is an operand of a predicate.
- 
predicandSubquerySet the new context value forpredicandSubquery().
- 
subqueryLevelint subqueryLevel()Which level of subqueries we're currently in, starting with 0 for the top level query.
- 
scopeLevelint scopeLevel()Which level of scopes we're currently in, starting with 0 for the top scope.
- 
scopeStartStart a new scope.
- 
scopeStartStart a new scope, passing the currentQueryPartas thescopePart().If the new scope doesn't have such a QueryPart, thenscopeStart()can be called instead.
- 
scopePartReturn theQueryPartthat defines the currentscopeStart(QueryPart), if any, ornullif there is no suchQueryPart.
- 
scopeMarkStartMark the beginning of a scoped query part.
- 
scopeRegisterRegister a "special" query part in the scope, reusing the object from a higher scope, if available.
- 
scopeRegisterAndMark
- 
scopeRegisterRegister a "special" query part in the scope, allowing to force registering the object in the new scope, if a higher scope already has the object.[#10992] This is necessary to allow for hiding identifiers from nested scopes. 
- 
scopeRegisterRegister a "special" query part in the scope, allowing to force registering the object in the new scope, if a higher scope already has the object, as well as providing a mapped part to map the original part to.[#10716] When wrapping parts of a query in a derived table, additional table mappings may be needed. 
- 
scopePartsGet all values of a type that are in the current scope or higher.
- 
inScopeCheck whether a query part is registered in the current scope or higher.
- 
inCurrentScopeCheck whether a query part is registered in the current scope.
- 
scopeMappingRetrieve the registered mapping for a query part in the current scope.If no such mapping exists, the argument QueryPartitself is returned.
- 
scopeMarkEndMark the end of a scoped query part.
- 
scopeEndEnd a previous SELECT scope.
- 
stringLiteralboolean stringLiteral()whether the current context is rendering a string literal.
- 
stringLiteralSet the new context value forstringLiteral().
- 
nextIndexint nextIndex()Get the next bind index. This increments an internal counter. This is relevant for two use-cases:- When binding variables to a PreparedStatement. Client code must assure that callingnextIndex()is followed by setting a bind value tostatement()
- When rendering unnamed bind variables with
 paramType()being toNAMED
 
- When binding variables to a 
- 
peekIndexint peekIndex()Peek the next bind index. This won't increment the internal counter, unlikenextIndex().
- 
skipUpdateCountSkip an additional update count produced by this query.
- 
skipUpdateCountsSkip a number of additional update counts produced by this query.
- 
skipUpdateCountsint skipUpdateCounts()The number of update counts to be skipped by this query.
- 
statementRetrieve the context's underlyingPreparedStatementif available, ornullif this traversal does not operate on aPreparedStatement.
- 
bindValueBind a value using a specific type. This will also increment the internal counter.- Throws:
- DataAccessException- If something went wrong while binding a variable
 
- 
peekAliasPeek the next alias that will be generated bynextAlias().
- 
nextAliasReturn a new alias that is unique for the scope of one query. These aliases are sometimes needed when unaliased projections are defined in subqueries, which can lead to syntax errors.
- 
renderRender the context's underlying SQL statement.
- 
renderRender a query part in a new context derived from this one. The rendered SQL will not be appended to this context.
- 
keywordDeprecated, for removal: This API element is subject to removal in a future version.- 3.10.0 - [#4990] - UseDSL.keyword(String)instead.Append a SQL keyword to the context's containedStringBuilder.Use this to have your SQL keyword rendered in RenderKeywordCase.
- 
sqlAppend some SQL to the context's containedStringBuilder.
- 
sqlAppend some SQL to the context's containedStringBuilder.Set literal = trueto indicate that theRenderContextshall not format the argument SQL.
- 
sqlIndentStartAppend some SQL to the context's containedStringBuilder, followed by the usual calls toformatIndentStart()andformatNewLine().
- 
sqlIndentEndAppend some SQL to the context's containedStringBuilderpreceded by the usual calls toformatIndentEnd()andformatNewLine().
- 
sqlIndentStartAppend some SQL to the context's containedStringBuilder, followed by the usual calls toformatIndentStart()andformatNewLine().
- 
sqlIndentEndAppend some SQL to the context's containedStringBuilderpreceded by the usual calls toformatIndentEnd()andformatNewLine().
- 
sqlAppend some SQL to the context's containedStringBuilder.
- 
sqlIndentStartAppend some SQL to the context's containedStringBuilder, followed by the usual calls toformatIndentStart()andformatNewLine().
- 
sqlIndentEndAppend some SQL to the context's containedStringBuilderpreceded by the usual calls toformatIndentEnd()andformatNewLine().
- 
sqlAppend some SQL to the context's containedStringBuilder.
- 
sqlAppend some SQL to the context's containedStringBuilder.
- 
floatFormatDecimalFormat floatFormat()A formatter to produce scientific notation forFloattypes.
- 
sqlAppend some SQL to the context's containedStringBuilder.
- 
doubleFormatDecimalFormat doubleFormat()A formatter to produce scientific notation forDoubletypes.
- 
sqlAppend some SQL to the context's containedStringBuilder.
- 
formatOverride the value ofSettings.isRenderFormatted().
- 
formatboolean format()The value ofSettings.isRenderFormatted().
- 
formatNewLineRender a new line character (only ifSettings.isRenderFormatted()is set totrue).
- 
formatNewLineAfterPrintMarginRender a new line character (only ifSettings.isRenderFormatted()is set totrue, and theformatPrintMargin(int)has been exceeded).
- 
formatSeparatorRender a new line character (only ifSettings.isRenderFormatted()is set totrue), or a whitespace separator character otherwise.
- 
separatorRequiredSpecify that a separator will be required before the nextvisit(QueryPart)call, but leave the decision whether to generate aformatSeparator()or just a whitespace to that nextQueryPart.
- 
separatorRequiredboolean separatorRequired()Whether some sort of separator is required before rendering the nextQueryPart.
- 
formatIndentStartStart indenting subsequent SQL by one level (two characters), ifSettings.isRenderFormatted()is set totrue.This is the same as calling formatIndentStart(int)with a parameter of2
- 
formatIndentStartStart indenting subsequent SQL by a number of characters, ifSettings.isRenderFormatted()is set totrue.
- 
formatIndentLockStartDeprecated, for removal: This API element is subject to removal in a future version.- [#10317] - 3.14.0 - Do not reuse this method. It will be removed without replacement.Start indenting subsequent SQL at the same level as the current line, ifSettings.isRenderFormatted()is set totrue.
- 
formatIndentEndStop indenting subsequent SQL by one level (two characters), ifSettings.isRenderFormatted()is set totrue.This is the same as calling formatIndentEnd(int)with a parameter of2
- 
formatIndentEndStop indenting subsequent SQL by a number of characters, ifSettings.isRenderFormatted()is set totrue.
- 
formatIndentLockEndDeprecated, for removal: This API element is subject to removal in a future version.- [#10317] - 3.14.0 - Do not reuse this method. It will be removed without replacement.Stop indenting subsequent SQL at the same level as the current line, ifSettings.isRenderFormatted()is set totrue.
- 
formatPrintMarginSet a print margin that will be applied to formatted SQL, ifSettings.isRenderFormatted()is set totrue.The default print margin is 80. Setting this to zero or a negative value means that no print margin will be applied.The print margin is applied to any of these QueryParts:- Field.in(Field...)and related expressions
 
- 
literalDeprecated, for removal: This API element is subject to removal in a future version.- 3.10.0 - [#4990] - Use any ofDSL.name(String),DSL.quotedName(String)orDSL.unquotedName(String)instead.Append some literal to the context's containedStringBuilder.
- 
quoteboolean quote()WhetherNameparts (andliteral(String)) should be quoted.
- 
quoteSet the new context value forquote().
- 
quote
- 
qualifyboolean qualify()Whether query parts should render qualified names or not.
- 
qualifySet the new context value forqualify().
- 
qualify
- 
qualifySchemaboolean qualifySchema()Whether query parts should renderSchema-qualified names or not.
- 
qualifySchemaSet the new context value forqualifySchema().
- 
qualifySchemaSet the new context value forqualifySchema()for the scope of aConsumer.
- 
qualifyCatalogboolean qualifyCatalog()Whether query parts should renderCatalog-qualified names or not.
- 
qualifyCatalogSet the new context value forqualifyCatalog().
- 
qualifyCatalogSet the new context value forqualifyCatalog()for the scope of aConsumer.
- 
paramTypeSpecify, how bind values should be rendered.- As ParamType.INDEXEDparameters:
 ?, ?, ?
- As ParamType.NAMEDparameters:
 :1, :2, :custom_name
- As ParamType.INLINEDparameters:
 1, 'A', null
 
- As 
- 
paramTypeSet the new context value forparamType().
- 
visitVisit a query part with a given value forparamType().
- 
paramTypeIfSet the new context value forparamType(), if a condition is true.
- 
paramTypeSet the new context value forparamType()for the scope of aConsumer.
- 
paramTypeIfSet the new context value forparamType()for the scope of aConsumer, if a condition is true.
- 
languageContextThe current language context.
- 
languageContextSet the new language context forlanguageContext()
- 
languageContextSet the new language context forlanguageContext()for the scope of aConsumer.
- 
languageContext@NotNull C languageContext(LanguageContext languageContext, QueryPart topLevelForLanguageContext, Consumer<? super C> consumer) Set the new language context forlanguageContext()for the scope of aConsumer.
- 
languageContextIfSet the new language context forlanguageContext(), if a condition is true.
- 
castModeThe currently applied cast mode for bind values.
- 
castModeSet the new cast mode forcastMode().
- 
castModeSet the new cast mode forcastMode()for the scope of aConsumer.
- 
castModeIfSet the new cast mode forcastMode(), if a condition is true.
 
-