本文整理了Java中freemarker.core.Environment.getFastInvalidReferenceExceptions()
方法的一些代码示例,展示了Environment.getFastInvalidReferenceExceptions()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Environment.getFastInvalidReferenceExceptions()
方法的具体详情如下:
包路径:freemarker.core.Environment
类名称:Environment
方法名:getFastInvalidReferenceExceptions
[英]See #setFastInvalidReferenceExceptions(boolean).
[中]请参见#setFastInvalidReferenceExceptions(布尔值)。
代码示例来源:origin: org.freemarker/freemarker
protected InvalidReferenceException newNullPropertyException(
String propertyName, TemplateModel tm, Environment env) {
if (env.getFastInvalidReferenceExceptions()) {
return InvalidReferenceException.FAST_INSTANCE;
} else {
return new InvalidReferenceException(
new _ErrorDescriptionBuilder(
"The exteneded hash (of class ", tm.getClass().getName(), ") has returned null for its \"",
propertyName,
"\" property. This is maybe a bug. The extended hash was returned by this expression:")
.blame(target),
env, this);
}
}
代码示例来源:origin: org.freemarker/freemarker
/**
* Used for assignments that use operators like {@code +=}, when the target variable was null/missing.
*/
static InvalidReferenceException getInstance(int scope, String missingAssignedVarName, String assignmentOperator,
Environment env) {
if (env != null && env.getFastInvalidReferenceExceptions()) {
return FAST_INSTANCE;
} else {
final _ErrorDescriptionBuilder errDescBuilder = new _ErrorDescriptionBuilder(
"The target variable of the assignment, ",
new _DelayedJQuote(missingAssignedVarName),
", was null or missing in the " + Assignment.scopeAsString(scope) + ", and the \"",
assignmentOperator, "\" operator must get its value from there before assigning to it."
);
if (missingAssignedVarName.startsWith("$")) {
errDescBuilder.tips(TIP_NO_DOLLAR, TIP_MISSING_ASSIGNMENT_TARGET);
} else {
errDescBuilder.tip(TIP_MISSING_ASSIGNMENT_TARGET);
}
return new InvalidReferenceException(errDescBuilder, env, null);
}
}
代码示例来源:origin: org.freemarker/freemarker
if (env != null && env.getFastInvalidReferenceExceptions()) {
return FAST_INSTANCE;
} else {
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.freemarker
protected InvalidReferenceException newNullPropertyException(
String propertyName, TemplateModel tm, Environment env) {
if (env.getFastInvalidReferenceExceptions()) {
return InvalidReferenceException.FAST_INSTANCE;
} else {
return new InvalidReferenceException(
new _ErrorDescriptionBuilder(
"The exteneded hash (of class ", tm.getClass().getName(), ") has returned null for its \"",
propertyName,
"\" property. This is maybe a bug. The extended hash was returned by this expression:")
.blame(target),
env, this);
}
}
代码示例来源:origin: org.freemarker/freemarker-gae
protected InvalidReferenceException newNullPropertyException(
String propertyName, TemplateModel tm, Environment env) {
if (env.getFastInvalidReferenceExceptions()) {
return InvalidReferenceException.FAST_INSTANCE;
} else {
return new InvalidReferenceException(
new _ErrorDescriptionBuilder(
"The exteneded hash (of class ", tm.getClass().getName(), ") has returned null for its \"",
propertyName,
"\" property. This is maybe a bug. The extended hash was returned by this expression:")
.blame(target),
env, this);
}
}
代码示例来源:origin: org.freemarker/freemarker-gae
/**
* Used for assignments that use operators like {@code +=}, when the target variable was null/missing.
*/
static InvalidReferenceException getInstance(int scope, String missingAssignedVarName, String assignmentOperator,
Environment env) {
if (env != null && env.getFastInvalidReferenceExceptions()) {
return FAST_INSTANCE;
} else {
final _ErrorDescriptionBuilder errDescBuilder = new _ErrorDescriptionBuilder(
"The target variable of the assignment, ",
new _DelayedJQuote(missingAssignedVarName),
", was null or missing in the " + Assignment.scopeAsString(scope) + ", and the \"",
assignmentOperator, "\" operator must get its value from there before assigning to it."
);
if (missingAssignedVarName.startsWith("$")) {
errDescBuilder.tips(TIP_NO_DOLLAR, TIP_MISSING_ASSIGNMENT_TARGET);
} else {
errDescBuilder.tip(TIP_MISSING_ASSIGNMENT_TARGET);
}
return new InvalidReferenceException(errDescBuilder, env, null);
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.freemarker
/**
* Used for assignments that use operators like {@code +=}, when the target variable was null/missing.
*/
static InvalidReferenceException getInstance(int scope, String missingAssignedVarName, String assignmentOperator,
Environment env) {
if (env != null && env.getFastInvalidReferenceExceptions()) {
return FAST_INSTANCE;
} else {
final _ErrorDescriptionBuilder errDescBuilder = new _ErrorDescriptionBuilder(
"The target variable of the assignment, ",
new _DelayedJQuote(missingAssignedVarName),
", was null or missing in the " + Assignment.scopeAsString(scope) + ", and the \"",
assignmentOperator, "\" operator must get its value from there before assigning to it."
);
if (missingAssignedVarName.startsWith("$")) {
errDescBuilder.tips(TIP_NO_DOLLAR, TIP_MISSING_ASSIGNMENT_TARGET);
} else {
errDescBuilder.tip(TIP_MISSING_ASSIGNMENT_TARGET);
}
return new InvalidReferenceException(errDescBuilder, env, null);
}
}
代码示例来源:origin: org.freemarker/freemarker-gae
if (env != null && env.getFastInvalidReferenceExceptions()) {
return FAST_INSTANCE;
} else {
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.freemarker
if (env != null && env.getFastInvalidReferenceExceptions()) {
return FAST_INSTANCE;
} else {
内容来源于网络,如有侵权,请联系作者删除!