TextReferenceMarkEndElement.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.text;

  29. import org.odftoolkit.odfdom.dom.DefaultElementVisitor;
  30. import org.odftoolkit.odfdom.dom.OdfDocumentNamespace;
  31. import org.odftoolkit.odfdom.dom.attribute.text.TextNameAttribute;
  32. import org.odftoolkit.odfdom.pkg.ElementVisitor;
  33. import org.odftoolkit.odfdom.pkg.OdfElement;
  34. import org.odftoolkit.odfdom.pkg.OdfFileDom;
  35. import org.odftoolkit.odfdom.pkg.OdfName;

  36. /** DOM implementation of OpenDocument element {@odf.element text:reference-mark-end}. */
  37. public class TextReferenceMarkEndElement extends OdfElement {

  38.   public static final OdfName ELEMENT_NAME =
  39.       OdfName.newName(OdfDocumentNamespace.TEXT, "reference-mark-end");

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

  48.   /**
  49.    * Get the element name
  50.    *
  51.    * @return return <code>OdfName</code> the name of element {@odf.element text:reference-mark-end}.
  52.    */
  53.   public OdfName getOdfName() {
  54.     return ELEMENT_NAME;
  55.   }

  56.   /**
  57.    * Receives the value of the ODFDOM attribute representation <code>TextNameAttribute</code> , See
  58.    * {@odf.attribute text:name}
  59.    *
  60.    * <p>Attribute is mandatory.
  61.    *
  62.    * @return - the <code>String</code> , the value or <code>null</code>, if the attribute is not set
  63.    *     and no default value defined.
  64.    */
  65.   public String getTextNameAttribute() {
  66.     TextNameAttribute attr = (TextNameAttribute) getOdfAttribute(OdfDocumentNamespace.TEXT, "name");
  67.     if (attr != null) {
  68.       return String.valueOf(attr.getValue());
  69.     }
  70.     return null;
  71.   }

  72.   /**
  73.    * Sets the value of ODFDOM attribute representation <code>TextNameAttribute</code> , See
  74.    * {@odf.attribute text:name}
  75.    *
  76.    * @param textNameValue The type is <code>String</code>
  77.    */
  78.   public void setTextNameAttribute(String textNameValue) {
  79.     TextNameAttribute attr = new TextNameAttribute((OdfFileDom) this.ownerDocument);
  80.     setOdfAttribute(attr);
  81.     attr.setValue(textNameValue);
  82.   }

  83.   @Override
  84.   public void accept(ElementVisitor visitor) {
  85.     if (visitor instanceof DefaultElementVisitor) {
  86.       DefaultElementVisitor defaultVisitor = (DefaultElementVisitor) visitor;
  87.       defaultVisitor.visit(this);
  88.     } else {
  89.       visitor.visit(this);
  90.     }
  91.   }
  92. }