Package org.openntf.domino.utils.xml

Examples of org.openntf.domino.utils.xml.XMLNode


    /* (non-Javadoc)
     * @see org.openntf.domino.design.FacesConfig.ManagedBean#getName()
     */
    public String getName() {
      XMLNode valueNode = node_.selectSingleNode("managed-bean-name");
      if (valueNode == null) {
        return "";
      }
      return valueNode.getText();
    }
View Full Code Here


    /* (non-Javadoc)
     * @see org.openntf.domino.design.FacesConfig.ManagedBean#setName(java.lang.String)
     */
    public void setName(final String name) {
      XMLNode valueNode = node_.selectSingleNode("managed-bean-name");
      if (valueNode == null) {
        valueNode = node_.addChildElement("managed-bean-name");
      }
      valueNode.setText(name);
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.openntf.domino.design.FacesConfig.ManagedBean#getClassName()
     */
    public String getClassName() {
      XMLNode valueNode = node_.selectSingleNode("managed-bean-class");
      if (valueNode == null) {
        return "";
      }
      return valueNode.getText();
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.openntf.domino.design.FacesConfig.ManagedBean#setClassName()
     */
    public void setClassName(final String className) {
      XMLNode valueNode = node_.selectSingleNode("managed-bean-class");
      if (valueNode == null) {
        valueNode = node_.addChildElement("managed-bean-class");
      }
      valueNode.setText(className);
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.openntf.domino.design.FacesConfig.ManagedBean#getScope()
     */
    public Scope getScope() {
      XMLNode valueNode = node_.selectSingleNode("managed-bean-scope");
      if (valueNode == null) {
        return Scope.NONE;
      }
      try {
        return Scope.valueOf(valueNode.getText().toUpperCase());
      } catch (IllegalArgumentException iae) {
        // This will crop up if the scope has an illegal/unknown value
        return Scope.NONE;
      }
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.openntf.domino.design.FacesConfig.ManagedBean#setScope(org.openntf.domino.design.FacesConfig.ManagedBean.Scope)
     */
    public void setScope(final Scope scope) {
      XMLNode valueNode = node_.selectSingleNode("managed-bean-scope");
      if (valueNode == null) {
        valueNode = node_.addChildElement("managed-bean-scope");
      }
      valueNode.setText(scope.toString().toLowerCase());
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.openntf.domino.design.FacesConfig.ManagedBean#addProperty()
     */
    public org.openntf.domino.design.FacesConfig.ManagedBean.Property addProperty() {
      XMLNode propertyNode = node_.addChildElement("managed-property");
      return new Property(propertyNode);
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.openntf.domino.design.FacesConfig.ManagedBean#setListEntries(java.util.Collection)
     */
    public void setListEntries(final Collection<?> listEntries) {
      XMLNode listEntriesNode = node_.selectSingleNode("list-entries");
      String valueClassName = getListValueClassName();
      if (listEntriesNode != null) {
        node_.removeChild(listEntriesNode);
      }
      listEntriesNode = node_.addChildElement("list-entries");
      XMLNode valueClassNode = listEntriesNode.addChildElement("value-class");
      valueClassNode.setText(valueClassName);
      for (Object entry : listEntries) {
        if (entry == null) {
          listEntriesNode.addChildElement("null-value");
        } else {
          XMLNode valueNode = listEntriesNode.addChildElement("value");
          valueNode.setText(String.valueOf(entry));
        }
      }

      // Clear out any map-entries, as they're mutually incompatible with list-entries
      XMLNode mapEntries = node_.selectSingleNode("map-entries");
      if (mapEntries != null) {
        node_.removeChild(mapEntries);
      }
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.openntf.domino.design.FacesConfig.ManagedBean#getValueClassName()
     */
    public String getListValueClassName() {
      XMLNode valueNode = node_.selectSingleNode("list-entries/value-class");
      if (valueNode == null) {
        return "";
      }
      return valueNode.getText();
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.openntf.domino.design.FacesConfig.ManagedBean#setValueClassName(java.lang.String)
     */
    public void setListValueClassName(final String className) {
      XMLNode valueNode = node_.selectSingleNode("list-entries/value-class");
      if (valueNode == null) {
        XMLNode listEntries = node_.selectSingleNode("list-entries");
        if (listEntries == null) {
          listEntries = node_.addChildElement("list-entries");
        }
        valueNode = listEntries.addChildElement("value-class");
      }
      valueNode.setText(className);

      // Clear out any map-entries, as they're mutually incompatible with list-entries
      XMLNode mapEntries = node_.selectSingleNode("map-entries");
      if (mapEntries != null) {
        node_.removeChild(mapEntries);
      }
    }
View Full Code Here

TOP

Related Classes of org.openntf.domino.utils.xml.XMLNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.