gpt4 book ai didi

com.izforge.izpack.api.adaptator.impl.XMLElementImpl.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 00:09:05 28 4
gpt4 key购买 nike

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

XMLElementImpl.<init>介绍

[英]Create a new root element in a new document.
[中]在新文档中创建新的根元素。

代码示例

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

public class MyClass implements Tagged, XMLElement {
 private Tagged tagged;
 private XMLElement xmlElement;
 public MyClass(/*...*/) {
  tagged = new TaggedImpl();
  xmlElement = new XMLElementImpl();
 }
 @Override
 public void someTaggedMethod() {
  tagged.someTaggedMethod();
 }
}

代码示例来源:origin: org.codehaus.izpack/izpack-api

@Override
public IXMLElement getFirstChildNamed(String name)
{
  XMLElementImpl res = null;
  NodeList nodeList = element.getElementsByTagName(name);
  if (nodeList.getLength() > 0)
  {
    res = new XMLElementImpl(nodeList.item(0));
  }
  return res;
}

代码示例来源:origin: org.codehaus.izpack/izpack-api

private IXMLElement searchFirstElement(DOMResult domResult)
{
  for (Node child = domResult.getNode().getFirstChild(); child != null; child = child.getNextSibling())
  {
    if (child.getNodeType() == Node.ELEMENT_NODE)
    {
      return new XMLElementImpl(child);
    }
  }
  return null;
}

代码示例来源:origin: org.codehaus.izpack/izpack-api

private void initChildrenList()
{
  if (hasChanged)
  {
    hasChanged = false;
    childrenList = new ArrayList<IXMLElement>();
    for (Node child = element.getFirstChild(); child != null; child = child.getNextSibling())
    {
      if (child.getNodeType() == Node.ELEMENT_NODE)
      {
        childrenList.add(new XMLElementImpl(child));
      }
    }
  }
}

代码示例来源:origin: org.codehaus.izpack/izpack-core

@Override
public void makeXMLData(IXMLElement conditionRoot)
{
  XMLElementImpl packel = new XMLElementImpl("name", conditionRoot);
  packel.setContent(this.name);
  conditionRoot.addChild(packel);
}

代码示例来源:origin: org.codehaus.izpack/izpack-core

@Override
public IXMLElement createConditionElement(Condition condition, IXMLElement root)
{
  XMLElementImpl xml = new XMLElementImpl("condition", root);
  xml.setAttribute("id", condition.getId());
  xml.setAttribute("type", condition.getClass().getCanonicalName());
  return xml;
}

代码示例来源:origin: org.codehaus.izpack/izpack-core

@Override
public void makeXMLData(IXMLElement conditionRoot)
{
  XMLElementImpl nameEl = new XMLElementImpl("name", conditionRoot);
  nameEl.setContent(this.variablename);
  conditionRoot.addChild(nameEl);
  XMLElementImpl valueEl = new XMLElementImpl("value", conditionRoot);
  valueEl.setContent(this.value);
  conditionRoot.addChild(valueEl);
}

代码示例来源:origin: org.codehaus.izpack/izpack-core

/**
 * {@inheritDoc}
 */
@Override
public void makeXMLData(IXMLElement conditionRoot)
{
  XMLElementImpl requiredUserEl = new XMLElementImpl("requiredusername", conditionRoot);
  requiredUserEl.setContent(this.requiredUsername);
  conditionRoot.addChild(requiredUserEl);
}

代码示例来源:origin: org.codehaus.izpack/izpack-api

@Override
public List<IXMLElement> getChildrenNamed(String name)
{
  List<IXMLElement> res = new ArrayList<IXMLElement>();
  for (IXMLElement child : getChildren())
  {
    if (child.getName() != null && child.getName().equals(name))
    {
      res.add(new XMLElementImpl(child.getElement()));
    }
  }
  return res;
}

代码示例来源:origin: org.codehaus.izpack/izpack-api

@Override
  public void makeXMLData(IXMLElement conditionRoot)
  {
    XMLElementImpl nameXml = new XMLElementImpl("arg1", conditionRoot);
    nameXml.setContent(this.operand1);
    conditionRoot.addChild(nameXml);
    XMLElementImpl valueXml = new XMLElementImpl("arg2", conditionRoot);
    valueXml.setContent(this.operand2);
    conditionRoot.addChild(valueXml);
    XMLElementImpl opXml = new XMLElementImpl("operator", conditionRoot);
    opXml.setContent(this.operator.getAttribute());
    conditionRoot.addChild(opXml);
  }
}

代码示例来源:origin: org.codehaus.izpack/izpack-core

@Override
public void makeXMLData(IXMLElement conditionRoot)
{
  XMLElementImpl el = new XMLElementImpl(this.contentType.getAttribute(), conditionRoot);
  el.setContent(this.content);
  conditionRoot.addChild(el);
}

代码示例来源:origin: org.codehaus.izpack/izpack-core

@Override
public void makeXMLData(IXMLElement conditionRoot)
{
  XMLElementImpl el = new XMLElementImpl(this.contentType.getAttribute(), conditionRoot);
  el.setContent(this.content);
  conditionRoot.addChild(el);
}

代码示例来源:origin: org.codehaus.izpack/izpack-core

@Override
public void makeXMLData(IXMLElement conditionRoot)
{
 XMLElementImpl el1 = new XMLElementImpl(this.contentType.getAttribute(),
   conditionRoot);
 el1.setContent(this.source);
 conditionRoot.addChild(el1);
 XMLElementImpl el2 = new XMLElementImpl(VALUE_ELEMENT_NAME, conditionRoot);
 el2.setContent(this.value);
 el2.setAttribute(VALUE_ATTR_REGEX_NAME, Boolean.toString(isRegEx));
 el2.setAttribute(VALUE_ATTR_CASEINSENSITIVE_NAME, Boolean.toString(isCaseInsensitive));
 conditionRoot.addChild(el2);
}

代码示例来源:origin: org.codehaus.izpack/izpack-panel

@Override
public void createInstallationRecord(InstallData installData, IXMLElement rootElement)
{
  String jdkVarName = installData.getVariable("jdkVarName");
  String jdkPathName = installData.getVariable(jdkVarName);
  IXMLElement jdkPath = new XMLElementImpl("jdkPath", rootElement);
  jdkPath.setContent(jdkPathName);
  rootElement.addChild(jdkPath);
  IXMLElement jdkVar = new XMLElementImpl("jdkVarName", rootElement);
  jdkVar.setContent(jdkVarName);
  rootElement.addChild(jdkVar);
}

代码示例来源:origin: org.codehaus.izpack/izpack-panel

@Override
public void createInstallationRecord(InstallData installData, IXMLElement panelRoot)
{
  // We add each pack to the panelRoot element
  for (int i = 0; i < installData.getAvailablePacks().size(); i++)
  {
    Pack pack = installData.getAvailablePacks().get(i);
    IXMLElement packElement = new XMLElementImpl("pack", panelRoot);
    packElement.setAttribute("index", Integer.toString(i));
    packElement.setAttribute("name", pack.getName());
    Boolean selected = installData.getSelectedPacks().contains(pack);
    packElement.setAttribute("selected", selected.toString());
    panelRoot.addChild(packElement);
  }
}

代码示例来源:origin: org.codehaus.izpack/izpack-installer

/**
 * Creates an empty root element prepared for adding auto-installation records for this panel.
 *
 * @return IXMLElement The prepared panel record XML
 */
public final IXMLElement createPanelRootRecord()
{
  IXMLElement panelRoot = new XMLElementImpl(panel.getClassName(), installData.getInstallationRecord());
  String panelId = panel.getPanelId();
  if (panelId != null)
  {
    panelRoot.setAttribute(AutomatedInstallData.AUTOINSTALL_PANELROOT_ATTR_ID, panelId);
  }
  return panelRoot;
}

代码示例来源:origin: org.codehaus.izpack/izpack-panel

@Override
public void createInstallationRecord(InstallData idata, IXMLElement panelRoot)
{
  // Installation path markup
  IXMLElement ipath = new XMLElementImpl(UserPathPanel.pathElementName, panelRoot);
  // check this writes even if value is the default,
  // because without the constructor, default does not get set.
  ipath.setContent(idata.getVariable(UserPathPanel.pathVariableName));
  // Checkings to fix bug #1864
  IXMLElement prev = panelRoot.getFirstChildNamed(UserPathPanel.pathElementName);
  if (prev != null)
  {
    panelRoot.removeChild(prev);
  }
  panelRoot.addChild(ipath);
}

代码示例来源:origin: org.codehaus.izpack/izpack-panel

@Override
public void createInstallationRecord(InstallData idata, IXMLElement panelRoot)
{
  // Installation path markup
  IXMLElement ipath = new XMLElementImpl("installpath", panelRoot);
  // check this writes even if value is the default,
  // because without the constructor, default does not get set.
  ipath.setContent(idata.getInstallPath());
  // Checkings to fix bug #1864
  IXMLElement prev = panelRoot.getFirstChildNamed("installpath");
  if (prev != null)
  {
    panelRoot.removeChild(prev);
  }
  panelRoot.addChild(ipath);
}

代码示例来源:origin: org.codehaus.izpack/izpack-panel

@Override
public void createInstallationRecord(InstallData installData, IXMLElement panelRoot)
{
  // Installation path markup
  IXMLElement ipath = new XMLElementImpl("installpath", panelRoot);
  // check this writes even if value is the default,
  // because without the constructor, default does not get set.
  ipath.setContent(installData.getInstallPath());
  // Checkings to fix bug #1864
  IXMLElement prev = panelRoot.getFirstChildNamed("installpath");
  if (prev != null)
  {
    panelRoot.removeChild(prev);
  }
  panelRoot.addChild(ipath);
}

代码示例来源:origin: org.codehaus.izpack/izpack-installer

/**
 * Load a default locale in the installData
 *
 * @param installData the installation data
 * @param locales     the supported locales
 * @throws IOException for any I/O error
 */
protected void loadDefaultLocale(AutomatedInstallData installData, Locales locales)
{
  Locale locale = locales.getLocale();
  if (locale != null)
  {
    installData.setInstallationRecord(new XMLElementImpl("AutomatedInstallation"));
    installData.setLocale(locale, locales.getISOCode());
    installData.setMessages(locales.getMessages());
  }
}

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