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

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

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

Environment.getNodeProcessor介绍

暂无

代码示例

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

  1. void fallback() throws TemplateException, IOException {
  2. TemplateModel macroOrTransform = getNodeProcessor(currentNodeName, currentNodeNS, nodeNamespaceIndex);
  3. if (macroOrTransform instanceof Macro) {
  4. invoke((Macro) macroOrTransform, null, null, null, null);
  5. } else if (macroOrTransform instanceof TemplateTransformModel) {
  6. visitAndTransform(null, (TemplateTransformModel) macroOrTransform, null);
  7. }
  8. }

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

  1. TemplateModel getNodeProcessor(TemplateNodeModel node) throws TemplateException {
  2. String nodeName = node.getNodeName();
  3. if (nodeName == null) {
  4. throw new _MiscTemplateException(this, "Node name is null.");
  5. }
  6. TemplateModel result = getNodeProcessor(nodeName, node.getNodeNamespace(), 0);
  7. if (result == null) {
  8. String type = node.getNodeType();
  9. /* DD: Original version: */
  10. if (type == null) {
  11. type = "default";
  12. }
  13. result = getNodeProcessor("@" + type, null, 0);
  14. /*
  15. * DD: Jonathan's non-BC version and IMHO otherwise wrong version: if (type != null) { result =
  16. * getNodeProcessor("@" + type, null, 0); } if (result == null) { result = getNodeProcessor("@default",
  17. * null, 0); }
  18. */
  19. }
  20. return result;
  21. }

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

  1. private TemplateModel getNodeProcessor(final String nodeName, final String nsURI, int startIndex)
  2. throws TemplateException {
  3. TemplateModel result = null;
  4. int i;
  5. int size = nodeNamespaces.size();
  6. for (i = startIndex; i < size; i++) {
  7. Namespace ns = null;
  8. try {
  9. ns = (Namespace) nodeNamespaces.get(i);
  10. } catch (ClassCastException cce) {
  11. throw new _MiscTemplateException(this,
  12. "A \"using\" clause should contain a sequence of namespaces or strings that indicate the "
  13. + "location of importable macro libraries.");
  14. }
  15. result = getNodeProcessor(ns, nodeName, nsURI);
  16. if (result != null)
  17. break;
  18. }
  19. if (result != null) {
  20. this.nodeNamespaceIndex = i + 1;
  21. this.currentNodeName = nodeName;
  22. this.currentNodeNS = nsURI;
  23. }
  24. return result;
  25. }

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

  1. TemplateModel macroOrTransform = getNodeProcessor(node);
  2. if (macroOrTransform instanceof Macro) {
  3. invoke((Macro) macroOrTransform, null, null, null, null);

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

  1. void fallback() throws TemplateException, IOException {
  2. TemplateModel macroOrTransform = getNodeProcessor(currentNodeName, currentNodeNS, nodeNamespaceIndex);
  3. if (macroOrTransform instanceof Macro) {
  4. visit((Macro) macroOrTransform, null, null, null, null);
  5. }
  6. else if (macroOrTransform instanceof TemplateTransformModel) {
  7. visit(null, (TemplateTransformModel) macroOrTransform, null);
  8. }
  9. }

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

  1. void fallback() throws TemplateException, IOException {
  2. TemplateModel macroOrTransform = getNodeProcessor(currentNodeName, currentNodeNS, nodeNamespaceIndex);
  3. if (macroOrTransform instanceof Macro) {
  4. invoke((Macro) macroOrTransform, null, null, null, null);
  5. } else if (macroOrTransform instanceof TemplateTransformModel) {
  6. visitAndTransform(null, (TemplateTransformModel) macroOrTransform, null);
  7. }
  8. }

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

  1. void fallback() throws TemplateException, IOException {
  2. TemplateModel macroOrTransform = getNodeProcessor(currentNodeName, currentNodeNS, nodeNamespaceIndex);
  3. if (macroOrTransform instanceof Macro) {
  4. invoke((Macro) macroOrTransform, null, null, null, null);
  5. } else if (macroOrTransform instanceof TemplateTransformModel) {
  6. visitAndTransform(null, (TemplateTransformModel) macroOrTransform, null);
  7. }
  8. }

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

  1. TemplateModel getNodeProcessor(TemplateNodeModel node) throws TemplateException {
  2. String nodeName = node.getNodeName();
  3. if (nodeName == null) {
  4. throw new _MiscTemplateException(this, "Node name is null.");
  5. }
  6. TemplateModel result = getNodeProcessor(nodeName, node.getNodeNamespace(), 0);
  7. if (result == null) {
  8. String type = node.getNodeType();
  9. /* DD: Original version: */
  10. if (type == null) {
  11. type = "default";
  12. }
  13. result = getNodeProcessor("@" + type, null, 0);
  14. /*
  15. * DD: Jonathan's non-BC version and IMHO otherwise wrong version: if (type != null) { result =
  16. * getNodeProcessor("@" + type, null, 0); } if (result == null) { result = getNodeProcessor("@default",
  17. * null, 0); }
  18. */
  19. }
  20. return result;
  21. }

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

  1. TemplateModel getNodeProcessor(TemplateNodeModel node) throws TemplateException {
  2. String nodeName = node.getNodeName();
  3. if (nodeName == null) {
  4. throw new _MiscTemplateException(this, "Node name is null.");
  5. }
  6. TemplateModel result = getNodeProcessor(nodeName, node.getNodeNamespace(), 0);
  7. if (result == null) {
  8. String type = node.getNodeType();
  9. /* DD: Original version: */
  10. if (type == null) {
  11. type = "default";
  12. }
  13. result = getNodeProcessor("@" + type, null, 0);
  14. /*
  15. * DD: Jonathan's non-BC version and IMHO otherwise wrong version: if (type != null) { result =
  16. * getNodeProcessor("@" + type, null, 0); } if (result == null) { result = getNodeProcessor("@default",
  17. * null, 0); }
  18. */
  19. }
  20. return result;
  21. }

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

  1. TemplateModel getNodeProcessor(TemplateNodeModel node) throws TemplateException {
  2. String nodeName = node.getNodeName();
  3. if (nodeName == null) {
  4. throw new TemplateException("Node name is null.", this);
  5. }
  6. TemplateModel result = getNodeProcessor(nodeName, node.getNodeNamespace(), 0);
  7. if (result == null) {
  8. String type = node.getNodeType();
  9. /* DD: Original version: */
  10. if (type == null) {
  11. type = "default";
  12. }
  13. result = getNodeProcessor("@" + type, null, 0);
  14. /* DD: Jonathan's non-BC version and IMHO otherwise wrong version:
  15. if (type != null) {
  16. result = getNodeProcessor("@" + type, null, 0);
  17. }
  18. if (result == null) {
  19. result = getNodeProcessor("@default", null, 0);
  20. }
  21. */
  22. }
  23. return result;
  24. }

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

  1. private TemplateModel getNodeProcessor(final String nodeName, final String nsURI, int startIndex)
  2. throws TemplateException {
  3. TemplateModel result = null;
  4. int i;
  5. int size = nodeNamespaces.size();
  6. for (i = startIndex; i < size; i++) {
  7. Namespace ns = null;
  8. try {
  9. ns = (Namespace) nodeNamespaces.get(i);
  10. } catch (ClassCastException cce) {
  11. throw new _MiscTemplateException(this,
  12. "A \"using\" clause should contain a sequence of namespaces or strings that indicate the "
  13. + "location of importable macro libraries.");
  14. }
  15. result = getNodeProcessor(ns, nodeName, nsURI);
  16. if (result != null)
  17. break;
  18. }
  19. if (result != null) {
  20. this.nodeNamespaceIndex = i + 1;
  21. this.currentNodeName = nodeName;
  22. this.currentNodeNS = nsURI;
  23. }
  24. return result;
  25. }

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

  1. private TemplateModel getNodeProcessor(final String nodeName, final String nsURI, int startIndex)
  2. throws TemplateException
  3. {
  4. TemplateModel result = null;
  5. int i;
  6. for (i = startIndex; i<nodeNamespaces.size(); i++) {
  7. Namespace ns = null;
  8. try {
  9. ns = (Namespace) nodeNamespaces.get(i);
  10. } catch (ClassCastException cce) {
  11. throw new InvalidReferenceException("A using clause should contain a sequence of namespaces or strings that indicate the location of importable macro libraries.", this);
  12. }
  13. result = getNodeProcessor(ns, nodeName, nsURI);
  14. if (result != null)
  15. break;
  16. }
  17. if (result != null) {
  18. this.nodeNamespaceIndex = i+1;
  19. this.currentNodeName = nodeName;
  20. this.currentNodeNS = nsURI;
  21. }
  22. return result;
  23. }

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

  1. private TemplateModel getNodeProcessor(final String nodeName, final String nsURI, int startIndex)
  2. throws TemplateException {
  3. TemplateModel result = null;
  4. int i;
  5. int size = nodeNamespaces.size();
  6. for (i = startIndex; i < size; i++) {
  7. Namespace ns = null;
  8. try {
  9. ns = (Namespace) nodeNamespaces.get(i);
  10. } catch (ClassCastException cce) {
  11. throw new _MiscTemplateException(this,
  12. "A \"using\" clause should contain a sequence of namespaces or strings that indicate the "
  13. + "location of importable macro libraries.");
  14. }
  15. result = getNodeProcessor(ns, nodeName, nsURI);
  16. if (result != null)
  17. break;
  18. }
  19. if (result != null) {
  20. this.nodeNamespaceIndex = i + 1;
  21. this.currentNodeName = nodeName;
  22. this.currentNodeNS = nsURI;
  23. }
  24. return result;
  25. }

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

  1. TemplateModel macroOrTransform = getNodeProcessor(node);
  2. if (macroOrTransform instanceof Macro) {
  3. visit((Macro) macroOrTransform, null, null, null, null);

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

  1. TemplateModel macroOrTransform = getNodeProcessor(node);
  2. if (macroOrTransform instanceof Macro) {
  3. invoke((Macro) macroOrTransform, null, null, null, null);

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

  1. TemplateModel macroOrTransform = getNodeProcessor(node);
  2. if (macroOrTransform instanceof Macro) {
  3. invoke((Macro) macroOrTransform, null, null, null, null);

相关文章

Environment类方法