本文整理汇总了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);
}
示例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();
}
示例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);
}
}
}
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}