org.milyn.container.ExecutionContext.getAttribute()方法的使用及代码示例

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

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

ExecutionContext.getAttribute介绍

暂无

代码示例

代码示例来源:origin: smooks/smooks

/**
 * Get the {@link ExtensionContext} from the {@link org.milyn.container.ExecutionContext}.
 * @param executionContext Execution Context.
 * @return Extension Context.
 */
public static ExtensionContext getExtensionContext(ExecutionContext executionContext) {
  return (ExtensionContext) executionContext.getAttribute(EXEC_CONTEXT_KEY);
}

代码示例来源:origin: org.milyn/milyn-smooks-core

/**
 * Get the {@link ExtensionContext} from the {@link org.milyn.container.ExecutionContext}.
 * @param executionContext Execution Context.
 * @return Extension Context.
 */
public static ExtensionContext getExtensionContext(ExecutionContext executionContext) {
  return (ExtensionContext) executionContext.getAttribute(EXEC_CONTEXT_KEY);
}

代码示例来源:origin: org.milyn/milyn-smooks-core

/**
   * Get the {@link NamespaceDeclarationStack} for the current message from the current {@link ExecutionContext}.
   * @param executionContext The execution context.
   */
  public static NamespaceDeclarationStack getNamespaceDeclarationStack(ExecutionContext executionContext) {
    return (NamespaceDeclarationStack) executionContext.getAttribute(NamespaceDeclarationStack.class);
  }
}

代码示例来源:origin: org.virtuslab/milyn-smooks-core

/**
 * Get the {@link ExtensionContext} from the {@link org.milyn.container.ExecutionContext}.
 * @param executionContext Execution Context.
 * @return Extension Context.
 */
public static ExtensionContext getExtensionContext(ExecutionContext executionContext) {
  return (ExtensionContext) executionContext.getAttribute(EXEC_CONTEXT_KEY);
}

代码示例来源:origin: smooks/smooks

/**
   * Get the {@link NamespaceDeclarationStack} for the current message from the current {@link ExecutionContext}.
   * @param executionContext The execution context.
   */
  public static NamespaceDeclarationStack getNamespaceDeclarationStack(ExecutionContext executionContext) {
    return (NamespaceDeclarationStack) executionContext.getAttribute(NamespaceDeclarationStack.class);
  }
}

代码示例来源:origin: org.milyn/milyn-smooks-all

/**
   * Get the {@link NamespaceDeclarationStack} for the current message from the current {@link ExecutionContext}.
   * @param executionContext The execution context.
   */
  public static NamespaceDeclarationStack getNamespaceDeclarationStack(ExecutionContext executionContext) {
    return (NamespaceDeclarationStack) executionContext.getAttribute(NamespaceDeclarationStack.class);
  }
}

代码示例来源:origin: org.milyn/milyn-smooks-all

@SuppressWarnings ( "unchecked" )
public static List<String> getListFileNames( final ExecutionContext executionContext )
{
  return (List<String>) executionContext.getAttribute( ALL_LIST_FILE_NAME_CONTEXT_KEY );
}

代码示例来源:origin: org.milyn/milyn-smooks-all

public static Map<String, String> getNamespacePrefixMappings(ExecutionContext executionContext) {
    Map<String, String> namespacePrefixMappings = (Map<String, String>) executionContext.getAttribute(NamespaceReaper.class);

    if(namespacePrefixMappings == null) {
      namespacePrefixMappings = new LinkedHashMap<String, String>();
      executionContext.setAttribute(NamespaceReaper.class, namespacePrefixMappings);
    }

    return namespacePrefixMappings;
  }
}

代码示例来源:origin: org.virtuslab/milyn-smooks-core

private static Map<String, ElementToNodeModel> getElementToNodeModelMap(ExecutionContext executionContext) {
  @SuppressWarnings("unchecked")
  Map<String, ElementToNodeModel> map = (Map<String, ElementToNodeModel>) executionContext.getAttribute(ElementToNodeModel.class);
  if(map == null) {
    map = new HashMap<String, ElementToNodeModel>();
    executionContext.setAttribute(ElementToNodeModel.class, map);
  }
  return map;
}

代码示例来源:origin: smooks/smooks

public static Map<String, String> getNamespacePrefixMappings(ExecutionContext executionContext) {
    Map<String, String> namespacePrefixMappings = (Map<String, String>) executionContext.getAttribute(NamespaceReaper.class);

    if(namespacePrefixMappings == null) {
      namespacePrefixMappings = new LinkedHashMap<String, String>();
      executionContext.setAttribute(NamespaceReaper.class, namespacePrefixMappings);
    }

    return namespacePrefixMappings;
  }
}

代码示例来源:origin: smooks/smooks

@SuppressWarnings("unchecked")
public static Stack<XMLReader> getReaders(ExecutionContext execContext) {
  Stack<XMLReader> readers = (Stack<XMLReader>) execContext.getAttribute(XMLReader.class);
  if(readers == null) {
    readers = new Stack<XMLReader>();
    setReaders(readers, execContext);
  }
  return readers;
}

代码示例来源:origin: org.milyn/milyn-smooks-core

private static Map<String, ElementToNodeModel> getElementToNodeModelMap(ExecutionContext executionContext) {
  @SuppressWarnings("unchecked")
  Map<String, ElementToNodeModel> map = (Map<String, ElementToNodeModel>) executionContext.getAttribute(ElementToNodeModel.class);
  if(map == null) {
    map = new HashMap<String, ElementToNodeModel>();
    executionContext.setAttribute(ElementToNodeModel.class, map);
  }
  return map;
}

代码示例来源:origin: org.virtuslab/milyn-smooks-core

public static Stack<XMLReader> getReaders(ExecutionContext execContext) {
  Stack<XMLReader> readers = (Stack<XMLReader>) execContext.getAttribute(XMLReader.class);
  if(readers == null) {
    readers = new Stack<XMLReader>();
    setReaders(readers, execContext);
  }
  return readers;
}

代码示例来源:origin: org.milyn/milyn-smooks-javabean

public static Map<String, String> getNamespacePrefixMappings(ExecutionContext executionContext) {
    Map<String, String> namespacePrefixMappings = (Map<String, String>) executionContext.getAttribute(NamespaceReaper.class);

    if(namespacePrefixMappings == null) {
      namespacePrefixMappings = new LinkedHashMap<String, String>();
      executionContext.setAttribute(NamespaceReaper.class, namespacePrefixMappings);
    }

    return namespacePrefixMappings;
  }
}

代码示例来源:origin: org.milyn/milyn-smooks-all

private static Map<String, ElementToNodeModel> getElementToNodeModelMap(ExecutionContext executionContext) {
  @SuppressWarnings("unchecked")
  Map<String, ElementToNodeModel> map = (Map<String, ElementToNodeModel>) executionContext.getAttribute(ElementToNodeModel.class);
  if(map == null) {
    map = new HashMap<String, ElementToNodeModel>();
    executionContext.setAttribute(ElementToNodeModel.class, map);
  }
  return map;
}

代码示例来源:origin: org.milyn/milyn-smooks-all

@SuppressWarnings("unchecked")
public static Stack<XMLReader> getReaders(ExecutionContext execContext) {
  Stack<XMLReader> readers = (Stack<XMLReader>) execContext.getAttribute(XMLReader.class);
  if(readers == null) {
    readers = new Stack<XMLReader>();
    setReaders(readers, execContext);
  }
  return readers;
}

代码示例来源:origin: smooks/smooks

public static DOMModel getModel(ExecutionContext executionContext) {
    DOMModel nodeModel = (DOMModel) executionContext.getAttribute(DOMModel.class);

    if(nodeModel == null) {
      nodeModel = new DOMModel();
      executionContext.setAttribute(DOMModel.class, nodeModel);
    }

    return nodeModel;
  }
}

代码示例来源:origin: org.milyn/milyn-smooks-core

public static DOMModel getModel(ExecutionContext executionContext) {
    DOMModel nodeModel = (DOMModel) executionContext.getAttribute(DOMModel.class);

    if(nodeModel == null) {
      nodeModel = new DOMModel();
      executionContext.setAttribute(DOMModel.class, nodeModel);
    }

    return nodeModel;
  }
}

代码示例来源:origin: org.milyn/milyn-smooks-all

public static DOMModel getModel(ExecutionContext executionContext) {
    DOMModel nodeModel = (DOMModel) executionContext.getAttribute(DOMModel.class);

    if(nodeModel == null) {
      nodeModel = new DOMModel();
      executionContext.setAttribute(DOMModel.class, nodeModel);
    }

    return nodeModel;
  }
}

代码示例来源:origin: org.milyn/milyn-smooks-all

public void visitBefore(Element element, ExecutionContext executionContext)	throws SmooksException {
  SmooksResourceConfiguration config = ExtensionContext.getExtensionContext(executionContext).getResourceStack().peek();
  Integer index = (Integer) executionContext.getAttribute(ParameterIndexInitializer.PARAMETER_INDEX);
  ResourceConfigUtil.setProperty(config, "index", Integer.toString(index), executionContext);
  executionContext.setAttribute(ParameterIndexInitializer.PARAMETER_INDEX, index + 1);
}

相关文章