gpt4 book ai didi

org.codehaus.cargo.util.XmlUtils.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 22:08:40 26 4
gpt4 key购买 nike

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

XmlUtils.<init>介绍

[英]default constructor will assign no namespaces and use a default file handler.
[中]默认构造函数将不分配名称空间,并使用默认的文件处理程序。

代码示例

代码示例来源:origin: org.codehaus.cargo/cargo-core-api-util

/**
 * creates the instance, which will use the specified @{link FileHandler fileHandler} to read or
 * write the xml file.
 *
 * @param fileHandler used for file i/o.
 * @param namespaceAware true if builder should be namespace aware.
 */
public DefaultXmlFileBuilder(FileHandler fileHandler, boolean namespaceAware)
{
  xmlUtil = new XmlUtils(fileHandler, namespaceAware);
}

代码示例来源:origin: codehaus-cargo/cargo

/**
 * creates the instance, which will use the specified @{link FileHandler fileHandler} to read or
 * write the xml file.
 *
 * @param fileHandler used for file i/o.
 * @param namespaceAware true if builder should be namespace aware.
 */
public DefaultXmlFileBuilder(FileHandler fileHandler, boolean namespaceAware)
{
  xmlUtil = new XmlUtils(fileHandler, namespaceAware);
}

代码示例来源:origin: org.codehaus.cargo/cargo-core-api-util

/**
 * creates the instance, which will use the specified @{link FileHandler fileHandler} to read or
 * write the xml file.
 * 
 * @param fileHandler used for file i/o.
 */
public DefaultXmlFileBuilder(FileHandler fileHandler)
{
  xmlUtil = new XmlUtils(fileHandler);
}

代码示例来源:origin: codehaus-cargo/cargo

/**
 * creates the instance, which will use the specified @{link FileHandler fileHandler} to read or
 * write the xml file.
 * 
 * @param fileHandler used for file i/o.
 */
public DefaultXmlFileBuilder(FileHandler fileHandler)
{
  xmlUtil = new XmlUtils(fileHandler);
}

代码示例来源:origin: stackoverflow.com

XmlUtils xmlUtils = new XmlUtils();

代码示例来源:origin: org.codehaus.cargo/cargo-core-container-jrun

/**
 * Sole constructor.
 * @param jrunContainer {@link LocalContainer}
 */
public JRun4xFilterChain(LocalContainer jrunContainer)
{
  this.jrunContainer = (InstalledLocalContainer) jrunContainer;
  this.configuration = jrunContainer.getConfiguration();
  this.xmlUtil = new XmlUtils(jrunContainer.getFileHandler());
  this.init();
}

代码示例来源:origin: codehaus-cargo/cargo

/**
 * Creates the various XML test elements. {@inheritDoc}
 * @throws Exception If anything goes wrong.
 */
@Override
protected void setUp() throws Exception
{
  super.setUp();
  util = new XmlUtils(true);
  DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
  DocumentBuilder builder = domFactory.newDocumentBuilder();
  Document document = builder.newDocument();
  this.testElement = document.createElement("test");
  document.appendChild(this.testElement);
}

代码示例来源:origin: codehaus-cargo/cargo

/**
 * Sole constructor.
 * @param jrunContainer {@link LocalContainer}
 */
public JRun4xFilterChain(LocalContainer jrunContainer)
{
  this.jrunContainer = (InstalledLocalContainer) jrunContainer;
  this.configuration = jrunContainer.getConfiguration();
  this.xmlUtil = new XmlUtils(jrunContainer.getFileHandler());
  this.init();
}

代码示例来源:origin: org.codehaus.cargo/cargo-core-container-weblogic

/**
 * {@inheritDoc}
 * 
 * @param container container to configure
 */
public WebLogic9x10x103x12xConfigXmlInstalledLocalDeployer(InstalledLocalContainer container)
{
  super(container);
  xmlTool = new XmlUtils();
  if (container instanceof WebLogic12xInstalledLocalContainer
    || container instanceof WebLogic121xInstalledLocalContainer)
  {
    namespace = "http://xmlns.oracle.com/weblogic/domain";
  }
  else
  {
    namespace = "http://www.bea.com/ns/weblogic/920/domain";
  }
  xmlTool.getNamespaces().put("weblogic", namespace);
  // using the same filehandler as the container will help pass unit tests
  FileHandler handler = container.getFileHandler();
  xmlTool.setFileHandler(handler);
}

代码示例来源:origin: codehaus-cargo/cargo

/**
 * {@inheritDoc}
 * 
 * @param container container to configure
 */
public WebLogic9x10x103x12xConfigXmlInstalledLocalDeployer(InstalledLocalContainer container)
{
  super(container);
  xmlTool = new XmlUtils();
  if (container instanceof WebLogic12xInstalledLocalContainer
    || container instanceof WebLogic121xInstalledLocalContainer)
  {
    namespace = "http://xmlns.oracle.com/weblogic/domain";
  }
  else
  {
    namespace = "http://www.bea.com/ns/weblogic/920/domain";
  }
  xmlTool.getNamespaces().put("weblogic", namespace);
  // using the same filehandler as the container will help pass unit tests
  FileHandler handler = container.getFileHandler();
  xmlTool.setFileHandler(handler);
}

代码示例来源:origin: org.codehaus.cargo/cargo-core-api-util

throws CargoException
XmlUtils domUtils = new XmlUtils(this);
Document doc = domUtils.loadXmlFromFile(file);

代码示例来源:origin: codehaus-cargo/cargo

/**
 * write the domain's config.xml to disk.
 * 
 * @param configXml document to write to disk
 */
public void writeConfigXml(Document configXml)
{
  XmlUtils xmlUtil = new XmlUtils(getFileHandler());
  xmlUtil.saveXml(configXml, getFileHandler().append(getDomainHome(), "config.xml"));
}

代码示例来源:origin: org.codehaus.cargo/cargo-core-container-weblogic

/**
 * write the domain's config.xml to disk.
 * 
 * @param configXml document to write to disk
 */
public void writeConfigXml(Document configXml)
{
  XmlUtils xmlUtil = new XmlUtils(getFileHandler());
  xmlUtil.saveXml(configXml, getFileHandler().append(getDomainHome(), "config.xml"));
}

代码示例来源:origin: org.codehaus.cargo/cargo-core-container-weblogic

/**
 * {@inheritDoc}
 * @see org.codehaus.cargo.container.spi.configuration.AbstractStandaloneLocalConfiguration#AbstractStandaloneLocalConfiguration(String)
 */
public WebLogic9xStandaloneLocalConfiguration(String dir)
{
  super(dir);
  setProperty(WebLogicPropertySet.ADMIN_USER, "weblogic");
  setProperty(WebLogicPropertySet.ADMIN_PWD, "weblogic");
  setProperty(WebLogicPropertySet.SERVER, "server");
  setProperty(WebLogicPropertySet.CONFIGURATION_VERSION, "9.2.3.0");
  setProperty(WebLogicPropertySet.DOMAIN_VERSION, "9.2.3.0");
  setProperty(ServletPropertySet.PORT, "7001");
  setProperty(GeneralPropertySet.HOSTNAME, "localhost");
  namespaces = new HashMap<String, String>();
  namespaces.put("weblogic", "http://www.bea.com/ns/weblogic/920/domain");
  namespaces.put("jdbc", "http://www.bea.com/ns/weblogic/90");
  xmlTool = new XmlUtils();
  xmlTool.setNamespaces(namespaces);
  xmlTool.setFileHandler(getFileHandler());
}

代码示例来源:origin: codehaus-cargo/cargo

/**
 * {@inheritDoc}
 * @see org.codehaus.cargo.container.spi.configuration.AbstractStandaloneLocalConfiguration#AbstractStandaloneLocalConfiguration(String)
 */
public WebLogic9xStandaloneLocalConfiguration(String dir)
{
  super(dir);
  setProperty(WebLogicPropertySet.ADMIN_USER, "weblogic");
  setProperty(WebLogicPropertySet.ADMIN_PWD, "weblogic");
  setProperty(WebLogicPropertySet.SERVER, "server");
  setProperty(WebLogicPropertySet.CONFIGURATION_VERSION, "9.2.3.0");
  setProperty(WebLogicPropertySet.DOMAIN_VERSION, "9.2.3.0");
  setProperty(ServletPropertySet.PORT, "7001");
  setProperty(GeneralPropertySet.HOSTNAME, "localhost");
  namespaces = new HashMap<String, String>();
  namespaces.put("weblogic", "http://www.bea.com/ns/weblogic/920/domain");
  namespaces.put("jdbc", "http://www.bea.com/ns/weblogic/90");
  xmlTool = new XmlUtils();
  xmlTool.setNamespaces(namespaces);
  xmlTool.setFileHandler(getFileHandler());
}

代码示例来源:origin: codehaus-cargo/cargo

/**
 * Creates the various XML test elements. {@inheritDoc}
 * @throws Exception If anything goes wrong.
 */
@Override
public void setUp() throws Exception
{
  this.fsManager = new StandardFileSystemManager();
  ((StandardFileSystemManager) this.fsManager).init();
  this.fileHandler = new VFSFileHandler(this.fsManager);
  util = new XmlUtils(fileHandler);
  manager = new DefaultXmlFileBuilder(fileHandler);
  namespaces = new HashMap<String, String>();
  namespaces.put("weblogic", "http://www.bea.com/ns/weblogic/920/domain");
  NamespaceContext ctx = new SimpleNamespaceContext(namespaces);
  XMLUnit.setXpathNamespaceContext(ctx);
  DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
  builder = domFactory.newDocumentBuilder();
}

代码示例来源:origin: codehaus-cargo/cargo

/**
 * {@inheritDoc} undeploys files by removing their configuration to the config.xml file of the
 * WebLogic server.
 */
@Override
public void undeploy(Deployable deployable)
{
  XmlUtils xmlUtil = new XmlUtils(getFileHandler());
  Document configXml =
    xmlUtil.loadXmlFromFile(getFileHandler().append(getDomainHome(), "config.xml"));
  List<Element> results = xmlUtil.selectElementsMatchingXPath("//Application[@Path='"
    + getFileHandler().getParent(getAbsolutePath(deployable)) + "']",
      configXml.getDocumentElement());
  for (Element element : results)
  {
    configXml.removeChild(element);
  }
  this.writeConfigXml(configXml);
}

代码示例来源:origin: org.codehaus.cargo/cargo-core-container-weblogic

/**
 * {@inheritDoc} undeploys files by removing their configuration to the config.xml file of the
 * WebLogic server.
 */
@Override
public void undeploy(Deployable deployable)
{
  XmlUtils xmlUtil = new XmlUtils(getFileHandler());
  Document configXml =
    xmlUtil.loadXmlFromFile(getFileHandler().append(getDomainHome(), "config.xml"));
  List<Element> results = xmlUtil.selectElementsMatchingXPath("//Application[@Path='"
    + getFileHandler().getParent(getAbsolutePath(deployable)) + "']",
      configXml.getDocumentElement());
  for (Element element : results)
  {
    configXml.removeChild(element);
  }
  this.writeConfigXml(configXml);
}

代码示例来源:origin: org.codehaus.cargo/cargo-core-container-weblogic

/**
 * {@inheritDoc} deploys files by adding their configuration to the config.xml file of the
 * WebLogic server.
 */
@Override
public void deploy(Deployable deployable)
{
  XmlUtils xmlUtil = new XmlUtils(getFileHandler());
  Document configXml =
    xmlUtil.loadXmlFromFile(getFileHandler().append(getDomainHome(), "config.xml"));
  Element domain = xmlUtil.selectElementMatchingXPath("//Domain",
    configXml.getDocumentElement());
  if (deployable.getType() == DeployableType.WAR)
  {
    addWarToDomain((WAR) deployable, domain);
  }
  else if (deployable.getType() == DeployableType.EAR)
  {
    addEarToDomain((EAR) deployable, domain);
  }
  else
  {
    throw new ContainerException("Not supported");
  }
  this.writeConfigXml(configXml);
}

代码示例来源:origin: codehaus-cargo/cargo

/**
 * {@inheritDoc} deploys files by adding their configuration to the config.xml file of the
 * WebLogic server.
 */
@Override
public void deploy(Deployable deployable)
{
  XmlUtils xmlUtil = new XmlUtils(getFileHandler());
  Document configXml =
    xmlUtil.loadXmlFromFile(getFileHandler().append(getDomainHome(), "config.xml"));
  Element domain = xmlUtil.selectElementMatchingXPath("//Domain",
    configXml.getDocumentElement());
  if (deployable.getType() == DeployableType.WAR)
  {
    addWarToDomain((WAR) deployable, domain);
  }
  else if (deployable.getType() == DeployableType.EAR)
  {
    addEarToDomain((EAR) deployable, domain);
  }
  else
  {
    throw new ContainerException("Not supported");
  }
  this.writeConfigXml(configXml);
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com