Package org.odftoolkit.odfdom.dom.element.meta

Examples of org.odftoolkit.odfdom.dom.element.meta.MetaUserDefinedElement


   * <p>
   * <code>null</code>, if the element is not set.
   */
  public List<String> getUserDefinedDataNames() {
    List<String> definedNames = new ArrayList<String>();
    MetaUserDefinedElement definedEle = OdfElement.findFirstChildNode(
        MetaUserDefinedElement.class, mOfficeMetaElement);
    if (definedEle != null) {

      definedNames.add(definedEle.getMetaNameAttribute());
      MetaUserDefinedElement definedNext;
      while ((definedNext = OdfElement.findNextChildNode(
          MetaUserDefinedElement.class, definedEle)) != null) {

        definedNames.add(definedNext.getMetaNameAttribute());

        definedEle = definedNext;
      }
      return definedNames;
    } else {
View Full Code Here


   * <p>
   * <code>null</code>, if the element is not set.
   */
  public MetaUserDefinedElement getUserDefinedElementByAttributeName(
      String name) {
    MetaUserDefinedElement definedEle = OdfElement.findFirstChildNode(
        MetaUserDefinedElement.class, mOfficeMetaElement);
    if (definedEle != null) {
      if (definedEle.getMetaNameAttribute().equals(name)) {
        return definedEle;
      }
      MetaUserDefinedElement definedNext;
      while ((definedNext = OdfElement.findNextChildNode(
          MetaUserDefinedElement.class, definedEle)) != null) {

        if (definedNext.getMetaNameAttribute().equals(name)) {
          return definedNext;
        }

        definedEle = definedNext;
      }
View Full Code Here

   * @return the value of the user-defined metadata with the specified name;
   * <p>
   * <code>null</code>, if the element is not set.
   */
  public String getUserDefinedDataValue(String name) {
    MetaUserDefinedElement definedElement = getUserDefinedElementByAttributeName(name);
    if (definedElement != null) {
      return definedElement.getTextContent();
    }
    return null;
  }
View Full Code Here

   * @return the data type of the user-defined metadata with the specified name;
   * <p>
   * <code>null</code>, if the element is not set.
   */
  public String getUserDefinedDataType(String name) {
    MetaUserDefinedElement definedElement = getUserDefinedElementByAttributeName(name);
    if (definedElement != null) {
      return definedElement.getMetaValueTypeAttribute();
    }
    return null;
  }
View Full Code Here

   *  meta:user-defined}.
   *
   * @param name  the name of the user-defined metadata
   */
  public void removeUserDefinedDataByName(String name) {
    MetaUserDefinedElement definedElement = getUserDefinedElementByAttributeName(name);
    if (definedElement != null) {
      mOfficeMetaElement.removeChild(definedElement);
    }

  }
View Full Code Here

   *
   * @param name  the name need to set for the user-defined metadata
   * @param value  the value need to set for the user-defined metadata
   */
  public void setUserDefinedDataValue(String name, String value) {
    MetaUserDefinedElement definedElement = getUserDefinedElementByAttributeName(name);
    if (definedElement != null) {
      definedElement.setTextContent(value);
    }
  }
View Full Code Here

   *
   * @param name  the name need to set for the user-defined metadata
   * @param value  the value need to set for the user-defined metadata
   */
  public void setUserDefinedDataType(String name, String value) {
    MetaUserDefinedElement definedElement = getUserDefinedElementByAttributeName(name);
    if (definedElement != null) {
      definedElement.setMetaValueTypeAttribute(value);
    }

  }
View Full Code Here

   * @param type  the data type need to set for the user-defined metadata
   * @param value  the value need to set for the user-defined metadata
   */
  public void setUserDefinedData(String name, String type, String value) {
    // test if name exists
    MetaUserDefinedElement definedElement = getUserDefinedElementByAttributeName(name);
    // if exists, then update,if parameter is null, then don't change
    if (definedElement != null) {
      if (type != null) {
        definedElement.setMetaValueTypeAttribute(type);
      }
      if (value != null) {
        definedElement.setTextContent(value);
      }
    } else {
      // if not exists, add
      definedElement = mOfficeMetaElement.newMetaUserDefinedElement(name,
          type);
      definedElement.setTextContent(value);

    }

  }
View Full Code Here

   * <p>
   * <code>null</code>, if the element is not set.
   */
  public List<String> getUserDefinedDataNames() {
    List<String> definedNames = new ArrayList<String>();
    MetaUserDefinedElement definedEle = OdfElement.findFirstChildNode(
        MetaUserDefinedElement.class, mOfficeMetaElement);
    if (definedEle != null) {

      definedNames.add(definedEle.getMetaNameAttribute());
      MetaUserDefinedElement definedNext;
      while ((definedNext = OdfElement.findNextChildNode(
          MetaUserDefinedElement.class, definedEle)) != null) {

        definedNames.add(definedNext.getMetaNameAttribute());

        definedEle = definedNext;
      }
      return definedNames;
    } else {
View Full Code Here

   * <p>
   * <code>null</code>, if the element is not set.
   */
  public MetaUserDefinedElement getUserDefinedElementByAttributeName(
      String name) {
    MetaUserDefinedElement definedEle = OdfElement.findFirstChildNode(
        MetaUserDefinedElement.class, mOfficeMetaElement);
    if (definedEle != null) {
      if (definedEle.getMetaNameAttribute().equals(name)) {
        return definedEle;
      }
      MetaUserDefinedElement definedNext;
      while ((definedNext = OdfElement.findNextChildNode(
          MetaUserDefinedElement.class, definedEle)) != null) {

        if (definedNext.getMetaNameAttribute().equals(name)) {
          return definedNext;
        }

        definedEle = definedNext;
      }
View Full Code Here

TOP

Related Classes of org.odftoolkit.odfdom.dom.element.meta.MetaUserDefinedElement

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.