TableTitleElement.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.pkg.ElementVisitor;
  32. import org.odftoolkit.odfdom.pkg.OdfElement;
  33. import org.odftoolkit.odfdom.pkg.OdfFileDom;
  34. import org.odftoolkit.odfdom.pkg.OdfName;

  35. /** DOM implementation of OpenDocument element {@odf.element table:title}. */
  36. public class TableTitleElement extends OdfElement {

  37.   public static final OdfName ELEMENT_NAME = OdfName.newName(OdfDocumentNamespace.TABLE, "title");

  38.   /**
  39.    * Create the instance of <code>TableTitleElement</code>
  40.    *
  41.    * @param ownerDoc The type is <code>OdfFileDom</code>
  42.    */
  43.   public TableTitleElement(OdfFileDom ownerDoc) {
  44.     super(ownerDoc, ELEMENT_NAME);
  45.   }

  46.   /**
  47.    * Get the element name
  48.    *
  49.    * @return return <code>OdfName</code> the name of element {@odf.element table:title}.
  50.    */
  51.   public OdfName getOdfName() {
  52.     return ELEMENT_NAME;
  53.   }

  54.   @Override
  55.   public void accept(ElementVisitor visitor) {
  56.     if (visitor instanceof DefaultElementVisitor) {
  57.       DefaultElementVisitor defaultVisitor = (DefaultElementVisitor) visitor;
  58.       defaultVisitor.visit(this);
  59.     } else {
  60.       visitor.visit(this);
  61.     }
  62.   }
  63.   /** Add text content. Only elements which are allowed to have text content offer this method. */
  64.   public void newTextNode(String content) {
  65.     if (content != null && !content.equals("")) {
  66.       this.appendChild(this.getOwnerDocument().createTextNode(content));
  67.     }
  68.   }
  69. }