TableMovementElement.java

  1. /**
  2.  * **********************************************************************
  3.  *
  4.  * <p>DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
  5.  *
  6.  * <p>Copyright 2008, 2010 Oracle and/or its affiliates. All rights reserved.
  7.  *
  8.  * <p>Use is subject to license terms.
  9.  *
  10.  * <p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
  11.  * except in compliance with the License. You may obtain a copy of the License at
  12.  * http://www.apache.org/licenses/LICENSE-2.0. You can also obtain a copy of the License at
  13.  * http://odftoolkit.org/docs/license.txt
  14.  *
  15.  * <p>Unless required by applicable law or agreed to in writing, software distributed under the
  16.  * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  17.  * express or implied.
  18.  *
  19.  * <p>See the License for the specific language governing permissions and limitations under the
  20.  * License.
  21.  *
  22.  * <p>**********************************************************************
  23.  */

  24. /*
  25.  * This file is automatically generated.
  26.  * Don't edit manually.
  27.  */
  28. package org.odftoolkit.odfdom.dom.element.table;

  29. import org.odftoolkit.odfdom.dom.DefaultElementVisitor;
  30. import org.odftoolkit.odfdom.dom.OdfDocumentNamespace;
  31. import org.odftoolkit.odfdom.dom.attribute.table.TableAcceptanceStateAttribute;
  32. import org.odftoolkit.odfdom.dom.attribute.table.TableIdAttribute;
  33. import org.odftoolkit.odfdom.dom.attribute.table.TableRejectingChangeIdAttribute;
  34. import org.odftoolkit.odfdom.dom.element.office.OfficeChangeInfoElement;
  35. import org.odftoolkit.odfdom.pkg.ElementVisitor;
  36. import org.odftoolkit.odfdom.pkg.OdfElement;
  37. import org.odftoolkit.odfdom.pkg.OdfFileDom;
  38. import org.odftoolkit.odfdom.pkg.OdfName;

  39. /** DOM implementation of OpenDocument element {@odf.element table:movement}. */
  40. public class TableMovementElement extends OdfElement {

  41.   public static final OdfName ELEMENT_NAME =
  42.       OdfName.newName(OdfDocumentNamespace.TABLE, "movement");

  43.   /**
  44.    * Create the instance of <code>TableMovementElement</code>
  45.    *
  46.    * @param ownerDoc The type is <code>OdfFileDom</code>
  47.    */
  48.   public TableMovementElement(OdfFileDom ownerDoc) {
  49.     super(ownerDoc, ELEMENT_NAME);
  50.   }

  51.   /**
  52.    * Get the element name
  53.    *
  54.    * @return return <code>OdfName</code> the name of element {@odf.element table:movement}.
  55.    */
  56.   public OdfName getOdfName() {
  57.     return ELEMENT_NAME;
  58.   }

  59.   /**
  60.    * Receives the value of the ODFDOM attribute representation <code>TableAcceptanceStateAttribute
  61.    * </code> , See {@odf.attribute table:acceptance-state}
  62.    *
  63.    * @return - the <code>String</code> , the value or <code>null</code>, if the attribute is not set
  64.    *     and no default value defined.
  65.    */
  66.   public String getTableAcceptanceStateAttribute() {
  67.     TableAcceptanceStateAttribute attr =
  68.         (TableAcceptanceStateAttribute)
  69.             getOdfAttribute(OdfDocumentNamespace.TABLE, "acceptance-state");
  70.     if (attr != null) {
  71.       return String.valueOf(attr.getValue());
  72.     }
  73.     return TableAcceptanceStateAttribute.DEFAULT_VALUE;
  74.   }

  75.   /**
  76.    * Sets the value of ODFDOM attribute representation <code>TableAcceptanceStateAttribute</code> ,
  77.    * See {@odf.attribute table:acceptance-state}
  78.    *
  79.    * @param tableAcceptanceStateValue The type is <code>String</code>
  80.    */
  81.   public void setTableAcceptanceStateAttribute(String tableAcceptanceStateValue) {
  82.     TableAcceptanceStateAttribute attr =
  83.         new TableAcceptanceStateAttribute((OdfFileDom) this.ownerDocument);
  84.     setOdfAttribute(attr);
  85.     attr.setValue(tableAcceptanceStateValue);
  86.   }

  87.   /**
  88.    * Receives the value of the ODFDOM attribute representation <code>TableIdAttribute</code> , See
  89.    * {@odf.attribute table:id}
  90.    *
  91.    * <p>Attribute is mandatory.
  92.    *
  93.    * @return - the <code>String</code> , the value or <code>null</code>, if the attribute is not set
  94.    *     and no default value defined.
  95.    */
  96.   public String getTableIdAttribute() {
  97.     TableIdAttribute attr = (TableIdAttribute) getOdfAttribute(OdfDocumentNamespace.TABLE, "id");
  98.     if (attr != null) {
  99.       return String.valueOf(attr.getValue());
  100.     }
  101.     return null;
  102.   }

  103.   /**
  104.    * Sets the value of ODFDOM attribute representation <code>TableIdAttribute</code> , See
  105.    * {@odf.attribute table:id}
  106.    *
  107.    * @param tableIdValue The type is <code>String</code>
  108.    */
  109.   public void setTableIdAttribute(String tableIdValue) {
  110.     TableIdAttribute attr = new TableIdAttribute((OdfFileDom) this.ownerDocument);
  111.     setOdfAttribute(attr);
  112.     attr.setValue(tableIdValue);
  113.   }

  114.   /**
  115.    * Receives the value of the ODFDOM attribute representation <code>TableRejectingChangeIdAttribute
  116.    * </code> , See {@odf.attribute table:rejecting-change-id}
  117.    *
  118.    * @return - the <code>String</code> , the value or <code>null</code>, if the attribute is not set
  119.    *     and no default value defined.
  120.    */
  121.   public String getTableRejectingChangeIdAttribute() {
  122.     TableRejectingChangeIdAttribute attr =
  123.         (TableRejectingChangeIdAttribute)
  124.             getOdfAttribute(OdfDocumentNamespace.TABLE, "rejecting-change-id");
  125.     if (attr != null) {
  126.       return String.valueOf(attr.getValue());
  127.     }
  128.     return null;
  129.   }

  130.   /**
  131.    * Sets the value of ODFDOM attribute representation <code>TableRejectingChangeIdAttribute</code>
  132.    * , See {@odf.attribute table:rejecting-change-id}
  133.    *
  134.    * @param tableRejectingChangeIdValue The type is <code>String</code>
  135.    */
  136.   public void setTableRejectingChangeIdAttribute(String tableRejectingChangeIdValue) {
  137.     TableRejectingChangeIdAttribute attr =
  138.         new TableRejectingChangeIdAttribute((OdfFileDom) this.ownerDocument);
  139.     setOdfAttribute(attr);
  140.     attr.setValue(tableRejectingChangeIdValue);
  141.   }

  142.   /**
  143.    * Create child element {@odf.element office:change-info}.
  144.    *
  145.    * <p>Child element is mandatory.
  146.    *
  147.    * @return the element {@odf.element office:change-info}
  148.    */
  149.   public OfficeChangeInfoElement newOfficeChangeInfoElement() {
  150.     OfficeChangeInfoElement officeChangeInfo =
  151.         ((OdfFileDom) this.ownerDocument).newOdfElement(OfficeChangeInfoElement.class);
  152.     this.appendChild(officeChangeInfo);
  153.     return officeChangeInfo;
  154.   }

  155.   /**
  156.    * Create child element {@odf.element table:deletions}.
  157.    *
  158.    * @return the element {@odf.element table:deletions}
  159.    */
  160.   public TableDeletionsElement newTableDeletionsElement() {
  161.     TableDeletionsElement tableDeletions =
  162.         ((OdfFileDom) this.ownerDocument).newOdfElement(TableDeletionsElement.class);
  163.     this.appendChild(tableDeletions);
  164.     return tableDeletions;
  165.   }

  166.   /**
  167.    * Create child element {@odf.element table:dependencies}.
  168.    *
  169.    * @return the element {@odf.element table:dependencies}
  170.    */
  171.   public TableDependenciesElement newTableDependenciesElement() {
  172.     TableDependenciesElement tableDependencies =
  173.         ((OdfFileDom) this.ownerDocument).newOdfElement(TableDependenciesElement.class);
  174.     this.appendChild(tableDependencies);
  175.     return tableDependencies;
  176.   }

  177.   /**
  178.    * Create child element {@odf.element table:source-range-address}.
  179.    *
  180.    * <p>Child element is mandatory.
  181.    *
  182.    * @return the element {@odf.element table:source-range-address}
  183.    */
  184.   public TableSourceRangeAddressElement newTableSourceRangeAddressElement() {
  185.     TableSourceRangeAddressElement tableSourceRangeAddress =
  186.         ((OdfFileDom) this.ownerDocument).newOdfElement(TableSourceRangeAddressElement.class);
  187.     this.appendChild(tableSourceRangeAddress);
  188.     return tableSourceRangeAddress;
  189.   }

  190.   /**
  191.    * Create child element {@odf.element table:target-range-address}.
  192.    *
  193.    * <p>Child element is mandatory.
  194.    *
  195.    * @return the element {@odf.element table:target-range-address}
  196.    */
  197.   public TableTargetRangeAddressElement newTableTargetRangeAddressElement() {
  198.     TableTargetRangeAddressElement tableTargetRangeAddress =
  199.         ((OdfFileDom) this.ownerDocument).newOdfElement(TableTargetRangeAddressElement.class);
  200.     this.appendChild(tableTargetRangeAddress);
  201.     return tableTargetRangeAddress;
  202.   }

  203.   @Override
  204.   public void accept(ElementVisitor visitor) {
  205.     if (visitor instanceof DefaultElementVisitor) {
  206.       DefaultElementVisitor defaultVisitor = (DefaultElementVisitor) visitor;
  207.       defaultVisitor.visit(this);
  208.     } else {
  209.       visitor.visit(this);
  210.     }
  211.   }
  212. }