当前位置: 首页>>代码示例>>Java>>正文


Java Node类代码示例

本文整理汇总了Java中org.jboss.shrinkwrap.descriptor.spi.node.Node的典型用法代码示例。如果您正苦于以下问题:Java Node类的具体用法?Java Node怎么用?Java Node使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Node类属于org.jboss.shrinkwrap.descriptor.spi.node包,在下文中一共展示了Node类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initiateChameleon

import org.jboss.shrinkwrap.descriptor.spi.node.Node; //导入依赖的package包/类
private void initiateChameleon(SetupContainer setup) throws NoSuchFieldException, IllegalAccessException {
    ChameleonContainer container = (ChameleonContainer) setup.getContainer().getDeployableContainer();
    ContainerDefImpl containerDef = (ContainerDefImpl) setup.getContainer().getContainerConfiguration();
    Field containerNodeField = ContainerDefImpl.class.getDeclaredField("container");
    if (!containerNodeField.isAccessible()) {
        containerNodeField.setAccessible(true);
    }

    Node node = (Node) containerNodeField.get(containerDef);
    Map<String, String> properties = removeAndMerge(container, node, containerDef);
    if (container.isInitiated() && !properties.containsKey("chameleonTarget")) {
        return;
    }

    ChameleonConfiguration configuration = new ChameleonConfiguration();
    try {
        // Remove the Chameleon container properties from configuration
        setAndRemoveProperties(node, properties, configuration);
        configuration.validate();
    } catch (Exception e) {
        throw new RuntimeException("Could not configure Chameleon container " + setup.getContainerName(), e);
    }
    container.init(configuration, containerDef);
}
 
开发者ID:arquillian,项目名称:arquillian-container-chameleon,代码行数:25,代码来源:InitiateContainer.java

示例2: removeAndMerge

import org.jboss.shrinkwrap.descriptor.spi.node.Node; //导入依赖的package包/类
private Map<String, String> removeAndMerge(ChameleonContainer container, Node node, ContainerDef containerDef) {
    Map<String, String> current = containerDef.getContainerProperties();
    if (!container.isInitiated() || !current.containsKey("chameleonTarget")) {
        return current;
    }

    Map<String, String> original = container.getOriginalContainerConfiguration();
    Map<String, String> currentConfigured = container.getCurrentContainerConfiguration();

    for (Map.Entry<String, String> currentConfiguredEntry : currentConfigured.entrySet()) {
        if (!original.containsKey(currentConfiguredEntry.getKey())) {
            node.getSingle("configuration").removeChild("[email protected]=" + currentConfiguredEntry.getKey());
        }
    }

    return containerDef.getContainerProperties();
}
 
开发者ID:arquillian,项目名称:arquillian-container-chameleon,代码行数:18,代码来源:InitiateContainer.java

示例3: setAndRemoveProperties

import org.jboss.shrinkwrap.descriptor.spi.node.Node; //导入依赖的package包/类
private void setAndRemoveProperties(Node node, Map<String, String> properties, ChameleonConfiguration configuration)
    throws Exception {

    for (Method setter : configuration.getClass().getMethods()) {
        if ( // isSetter
            setter.getName().startsWith("set") &&
                setter.getReturnType().equals(Void.TYPE) &&
                setter.getParameterTypes().length == 1
            ) {
            String propertyName = toCamelCase(setter);
            if (properties.containsKey(propertyName)) {
                setter.invoke(configuration, properties.get(propertyName));
                node.getSingle("configuration").removeChild("[email protected]=" + propertyName);
            }
        }
    }
}
 
开发者ID:arquillian,项目名称:arquillian-container-chameleon,代码行数:18,代码来源:InitiateContainer.java

示例4: ModuleAnalyzer

import org.jboss.shrinkwrap.descriptor.spi.node.Node; //导入依赖的package包/类
public ModuleAnalyzer(InputStream in) throws IOException {
    NodeImporter importer = new XmlDomNodeImporterImpl();
    Node node = importer.importAsNode(in, true);

    String rootName = node.getName();

    if (rootName.equals("module")) {
        this.module = new ModuleDescriptorImpl(null, node);
    }
    in.close();
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:12,代码来源:ModuleAnalyzer.java

示例5: getAllDisplayName

import org.jboss.shrinkwrap.descriptor.spi.node.Node; //导入依赖的package包/类
/**
    * Returns all <code>display-name</code> elements
    * @return list of <code>display-name</code> 
    */
public List<String> getAllDisplayName()
   {
      List<String> result = new ArrayList<String>();
      List<Node> nodes = childNode.get("display-name");
      for (Node node : nodes)
      {
         result.add(node.getText());
      }
      return result;
   }
 
开发者ID:forge,项目名称:javaee-descriptors,代码行数:15,代码来源:FacesConfigRendererTypeImpl.java

示例6: getAllConfigProperty

import org.jboss.shrinkwrap.descriptor.spi.node.Node; //导入依赖的package包/类
/**
 * Returns all <code>config-property</code> elements
 * @return list of <code>config-property</code> 
 */
public List<ConfigPropertyType<ConnectionDefinitionType<T>>> getAllConfigProperty()
{
   List<ConfigPropertyType<ConnectionDefinitionType<T>>> list = new ArrayList<ConfigPropertyType<ConnectionDefinitionType<T>>>();
   List<Node> nodeList = childNode.get("config-property");
   for(Node node: nodeList)
   {
      ConfigPropertyType<ConnectionDefinitionType<T>>  type = new ConfigPropertyTypeImpl<ConnectionDefinitionType<T>>(this, "config-property", childNode, node);
      list.add(type);
   }
   return list;
}
 
开发者ID:forge,项目名称:javaee-descriptors,代码行数:16,代码来源:ConnectionDefinitionTypeImpl.java

示例7: getAllTransient

import org.jboss.shrinkwrap.descriptor.spi.node.Node; //导入依赖的package包/类
/**
 * Returns all <code>transient</code> elements
 * @return list of <code>transient</code> 
 */
public List<Transient<EmbeddableAttributes<T>>> getAllTransient()
{
   List<Transient<EmbeddableAttributes<T>>> list = new ArrayList<Transient<EmbeddableAttributes<T>>>();
   List<Node> nodeList = childNode.get("transient");
   for(Node node: nodeList)
   {
      Transient<EmbeddableAttributes<T>>  type = new TransientImpl<EmbeddableAttributes<T>>(this, "transient", childNode, node);
      list.add(type);
   }
   return list;
}
 
开发者ID:forge,项目名称:javaee-descriptors,代码行数:16,代码来源:EmbeddableAttributesImpl.java

示例8: getOrCreateEnvEntry

import org.jboss.shrinkwrap.descriptor.spi.node.Node; //导入依赖的package包/类
/**
 * If not already created, a new <code>env-entry</code> element will be created and returned.
 * Otherwise, the first existing <code>env-entry</code> element will be returned.
 * @return the instance defined for the element <code>env-entry</code> 
 */
public EnvEntryType<WebAppDescriptor> getOrCreateEnvEntry()
{
   List<Node> nodeList = model.get("env-entry");
   if (nodeList != null &&  nodeList.size() > 0)
   {
      return new EnvEntryTypeImpl<WebAppDescriptor>(this, "env-entry", model, nodeList.get(0));
   }
   return createEnvEntry();
}
 
开发者ID:forge,项目名称:javaee-descriptors,代码行数:15,代码来源:WebAppDescriptorImpl.java

示例9: getAllEjbRef

import org.jboss.shrinkwrap.descriptor.spi.node.Node; //导入依赖的package包/类
/**
 * Returns all <code>ejb-ref</code> elements
 * @return list of <code>ejb-ref</code> 
 */
public List<EjbRefType<WebAppType<T>>> getAllEjbRef()
{
   List<EjbRefType<WebAppType<T>>> list = new ArrayList<EjbRefType<WebAppType<T>>>();
   List<Node> nodeList = childNode.get("ejb-ref");
   for(Node node: nodeList)
   {
      EjbRefType<WebAppType<T>>  type = new EjbRefTypeImpl<WebAppType<T>>(this, "ejb-ref", childNode, node);
      list.add(type);
   }
   return list;
}
 
开发者ID:forge,项目名称:javaee-descriptors,代码行数:16,代码来源:WebAppTypeImpl.java

示例10: getAllVariableResolver

import org.jboss.shrinkwrap.descriptor.spi.node.Node; //导入依赖的package包/类
/**
    * Returns all <code>variable-resolver</code> elements
    * @return list of <code>variable-resolver</code> 
    */
public List<String> getAllVariableResolver()
   {
      List<String> result = new ArrayList<String>();
      List<Node> nodes = childNode.get("variable-resolver");
      for (Node node : nodes)
      {
         result.add(node.getText());
      }
      return result;
   }
 
开发者ID:forge,项目名称:javaee-descriptors,代码行数:15,代码来源:FacesConfigApplicationTypeImpl.java

示例11: getAllIcon

import org.jboss.shrinkwrap.descriptor.spi.node.Node; //导入依赖的package包/类
/**
 * Returns all <code>icon</code> elements
 * @return list of <code>icon</code> 
 */
public List<IconType<FaceletTaglibTagComponentType<T>>> getAllIcon()
{
   List<IconType<FaceletTaglibTagComponentType<T>>> list = new ArrayList<IconType<FaceletTaglibTagComponentType<T>>>();
   List<Node> nodeList = childNode.get("icon");
   for(Node node: nodeList)
   {
      IconType<FaceletTaglibTagComponentType<T>>  type = new IconTypeImpl<FaceletTaglibTagComponentType<T>>(this, "icon", childNode, node);
      list.add(type);
   }
   return list;
}
 
开发者ID:forge,项目名称:javaee-descriptors,代码行数:16,代码来源:FaceletTaglibTagComponentTypeImpl.java

示例12: getOrCreateIcon

import org.jboss.shrinkwrap.descriptor.spi.node.Node; //导入依赖的package包/类
/**
 * If not already created, a new <code>icon</code> element will be created and returned.
 * Otherwise, the first existing <code>icon</code> element will be returned.
 * @return the instance defined for the element <code>icon</code> 
 */
public IconType<FacesConfigPropertyType<T>> getOrCreateIcon()
{
   List<Node> nodeList = childNode.get("icon");
   if (nodeList != null &&  nodeList.size() > 0)
   {
      return new IconTypeImpl<FacesConfigPropertyType<T>>(this, "icon", childNode, nodeList.get(0));
   }
   return createIcon();
}
 
开发者ID:forge,项目名称:javaee-descriptors,代码行数:15,代码来源:FacesConfigPropertyTypeImpl.java

示例13: getOrCreateFilter

import org.jboss.shrinkwrap.descriptor.spi.node.Node; //导入依赖的package包/类
/**
 * If not already created, a new <code>filter</code> element will be created and returned.
 * Otherwise, the first existing <code>filter</code> element will be returned.
 * @return the instance defined for the element <code>filter</code> 
 */
public FilterType<WebFragmentDescriptor> getOrCreateFilter()
{
   List<Node> nodeList = model.get("filter");
   if (nodeList != null &&  nodeList.size() > 0)
   {
      return new FilterTypeImpl<WebFragmentDescriptor>(this, "filter", model, nodeList.get(0));
   }
   return createFilter();
}
 
开发者ID:forge,项目名称:javaee-descriptors,代码行数:15,代码来源:WebFragmentDescriptorImpl.java

示例14: getOrCreateIcon

import org.jboss.shrinkwrap.descriptor.spi.node.Node; //导入依赖的package包/类
/**
 * If not already created, a new <code>icon</code> element will be created and returned.
 * Otherwise, the first existing <code>icon</code> element will be returned.
 * @return the instance defined for the element <code>icon</code> 
 */
public IconType<FacesConfigFacetType<T>> getOrCreateIcon()
{
   List<Node> nodeList = childNode.get("icon");
   if (nodeList != null &&  nodeList.size() > 0)
   {
      return new IconTypeImpl<FacesConfigFacetType<T>>(this, "icon", childNode, nodeList.get(0));
   }
   return createIcon();
}
 
开发者ID:forge,项目名称:javaee-descriptors,代码行数:15,代码来源:FacesConfigFacetTypeImpl.java

示例15: getOrCreateUniqueConstraint

import org.jboss.shrinkwrap.descriptor.spi.node.Node; //导入依赖的package包/类
/**
 * If not already created, a new <code>unique-constraint</code> element will be created and returned.
 * Otherwise, the first existing <code>unique-constraint</code> element will be returned.
 * @return the instance defined for the element <code>unique-constraint</code> 
 */
public UniqueConstraint<SecondaryTable<T>> getOrCreateUniqueConstraint()
{
   List<Node> nodeList = childNode.get("unique-constraint");
   if (nodeList != null &&  nodeList.size() > 0)
   {
      return new UniqueConstraintImpl<SecondaryTable<T>>(this, "unique-constraint", childNode, nodeList.get(0));
   }
   return createUniqueConstraint();
}
 
开发者ID:forge,项目名称:javaee-descriptors,代码行数:15,代码来源:SecondaryTableImpl.java


注:本文中的org.jboss.shrinkwrap.descriptor.spi.node.Node类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。