freemarker.core.Environment.getFastInvalidReferenceExceptions()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中freemarker.core.Environment.getFastInvalidReferenceExceptions()方法的一些代码示例,展示了Environment.getFastInvalidReferenceExceptions()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Environment.getFastInvalidReferenceExceptions()方法的具体详情如下:
包路径:freemarker.core.Environment
类名称:Environment
方法名:getFastInvalidReferenceExceptions

Environment.getFastInvalidReferenceExceptions介绍

[英]See #setFastInvalidReferenceExceptions(boolean).
[中]请参见#setFastInvalidReferenceExceptions(布尔值)。

代码示例

代码示例来源:origin: org.freemarker/freemarker

  1. protected InvalidReferenceException newNullPropertyException(
  2. String propertyName, TemplateModel tm, Environment env) {
  3. if (env.getFastInvalidReferenceExceptions()) {
  4. return InvalidReferenceException.FAST_INSTANCE;
  5. } else {
  6. return new InvalidReferenceException(
  7. new _ErrorDescriptionBuilder(
  8. "The exteneded hash (of class ", tm.getClass().getName(), ") has returned null for its \"",
  9. propertyName,
  10. "\" property. This is maybe a bug. The extended hash was returned by this expression:")
  11. .blame(target),
  12. env, this);
  13. }
  14. }

代码示例来源:origin: org.freemarker/freemarker

  1. /**
  2. * Used for assignments that use operators like {@code +=}, when the target variable was null/missing.
  3. */
  4. static InvalidReferenceException getInstance(int scope, String missingAssignedVarName, String assignmentOperator,
  5. Environment env) {
  6. if (env != null && env.getFastInvalidReferenceExceptions()) {
  7. return FAST_INSTANCE;
  8. } else {
  9. final _ErrorDescriptionBuilder errDescBuilder = new _ErrorDescriptionBuilder(
  10. "The target variable of the assignment, ",
  11. new _DelayedJQuote(missingAssignedVarName),
  12. ", was null or missing in the " + Assignment.scopeAsString(scope) + ", and the \"",
  13. assignmentOperator, "\" operator must get its value from there before assigning to it."
  14. );
  15. if (missingAssignedVarName.startsWith("$")) {
  16. errDescBuilder.tips(TIP_NO_DOLLAR, TIP_MISSING_ASSIGNMENT_TARGET);
  17. } else {
  18. errDescBuilder.tip(TIP_MISSING_ASSIGNMENT_TARGET);
  19. }
  20. return new InvalidReferenceException(errDescBuilder, env, null);
  21. }
  22. }

代码示例来源:origin: org.freemarker/freemarker

  1. if (env != null && env.getFastInvalidReferenceExceptions()) {
  2. return FAST_INSTANCE;
  3. } else {

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.freemarker

  1. protected InvalidReferenceException newNullPropertyException(
  2. String propertyName, TemplateModel tm, Environment env) {
  3. if (env.getFastInvalidReferenceExceptions()) {
  4. return InvalidReferenceException.FAST_INSTANCE;
  5. } else {
  6. return new InvalidReferenceException(
  7. new _ErrorDescriptionBuilder(
  8. "The exteneded hash (of class ", tm.getClass().getName(), ") has returned null for its \"",
  9. propertyName,
  10. "\" property. This is maybe a bug. The extended hash was returned by this expression:")
  11. .blame(target),
  12. env, this);
  13. }
  14. }

代码示例来源:origin: org.freemarker/freemarker-gae

  1. protected InvalidReferenceException newNullPropertyException(
  2. String propertyName, TemplateModel tm, Environment env) {
  3. if (env.getFastInvalidReferenceExceptions()) {
  4. return InvalidReferenceException.FAST_INSTANCE;
  5. } else {
  6. return new InvalidReferenceException(
  7. new _ErrorDescriptionBuilder(
  8. "The exteneded hash (of class ", tm.getClass().getName(), ") has returned null for its \"",
  9. propertyName,
  10. "\" property. This is maybe a bug. The extended hash was returned by this expression:")
  11. .blame(target),
  12. env, this);
  13. }
  14. }

代码示例来源:origin: org.freemarker/freemarker-gae

  1. /**
  2. * Used for assignments that use operators like {@code +=}, when the target variable was null/missing.
  3. */
  4. static InvalidReferenceException getInstance(int scope, String missingAssignedVarName, String assignmentOperator,
  5. Environment env) {
  6. if (env != null && env.getFastInvalidReferenceExceptions()) {
  7. return FAST_INSTANCE;
  8. } else {
  9. final _ErrorDescriptionBuilder errDescBuilder = new _ErrorDescriptionBuilder(
  10. "The target variable of the assignment, ",
  11. new _DelayedJQuote(missingAssignedVarName),
  12. ", was null or missing in the " + Assignment.scopeAsString(scope) + ", and the \"",
  13. assignmentOperator, "\" operator must get its value from there before assigning to it."
  14. );
  15. if (missingAssignedVarName.startsWith("$")) {
  16. errDescBuilder.tips(TIP_NO_DOLLAR, TIP_MISSING_ASSIGNMENT_TARGET);
  17. } else {
  18. errDescBuilder.tip(TIP_MISSING_ASSIGNMENT_TARGET);
  19. }
  20. return new InvalidReferenceException(errDescBuilder, env, null);
  21. }
  22. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.freemarker

  1. /**
  2. * Used for assignments that use operators like {@code +=}, when the target variable was null/missing.
  3. */
  4. static InvalidReferenceException getInstance(int scope, String missingAssignedVarName, String assignmentOperator,
  5. Environment env) {
  6. if (env != null && env.getFastInvalidReferenceExceptions()) {
  7. return FAST_INSTANCE;
  8. } else {
  9. final _ErrorDescriptionBuilder errDescBuilder = new _ErrorDescriptionBuilder(
  10. "The target variable of the assignment, ",
  11. new _DelayedJQuote(missingAssignedVarName),
  12. ", was null or missing in the " + Assignment.scopeAsString(scope) + ", and the \"",
  13. assignmentOperator, "\" operator must get its value from there before assigning to it."
  14. );
  15. if (missingAssignedVarName.startsWith("$")) {
  16. errDescBuilder.tips(TIP_NO_DOLLAR, TIP_MISSING_ASSIGNMENT_TARGET);
  17. } else {
  18. errDescBuilder.tip(TIP_MISSING_ASSIGNMENT_TARGET);
  19. }
  20. return new InvalidReferenceException(errDescBuilder, env, null);
  21. }
  22. }

代码示例来源:origin: org.freemarker/freemarker-gae

  1. if (env != null && env.getFastInvalidReferenceExceptions()) {
  2. return FAST_INSTANCE;
  3. } else {

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.freemarker

  1. if (env != null && env.getFastInvalidReferenceExceptions()) {
  2. return FAST_INSTANCE;
  3. } else {

相关文章

Environment类方法