StyleRubyPropertiesElement.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.style;

  29. import org.odftoolkit.odfdom.dom.DefaultElementVisitor;
  30. import org.odftoolkit.odfdom.dom.OdfDocumentNamespace;
  31. import org.odftoolkit.odfdom.dom.attribute.style.StyleRubyAlignAttribute;
  32. import org.odftoolkit.odfdom.dom.attribute.style.StyleRubyPositionAttribute;
  33. import org.odftoolkit.odfdom.dom.element.OdfStylePropertiesBase;
  34. import org.odftoolkit.odfdom.dom.style.props.OdfStylePropertiesSet;
  35. import org.odftoolkit.odfdom.dom.style.props.OdfStyleProperty;
  36. import org.odftoolkit.odfdom.pkg.ElementVisitor;
  37. import org.odftoolkit.odfdom.pkg.OdfFileDom;
  38. import org.odftoolkit.odfdom.pkg.OdfName;

  39. /** DOM implementation of OpenDocument element {@odf.element style:ruby-properties}. */
  40. public class StyleRubyPropertiesElement extends OdfStylePropertiesBase {

  41.   public static final OdfName ELEMENT_NAME =
  42.       OdfName.newName(OdfDocumentNamespace.STYLE, "ruby-properties");

  43.   /**
  44.    * Create the instance of <code>StyleRubyPropertiesElement</code>
  45.    *
  46.    * @param ownerDoc The type is <code>OdfFileDom</code>
  47.    */
  48.   public StyleRubyPropertiesElement(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 style:ruby-properties}.
  55.    */
  56.   public OdfName getOdfName() {
  57.     return ELEMENT_NAME;
  58.   }

  59.   public static final OdfStyleProperty RubyAlign =
  60.       OdfStyleProperty.get(
  61.           OdfStylePropertiesSet.RubyProperties,
  62.           OdfName.newName(OdfDocumentNamespace.STYLE, "ruby-align"));

  63.   public static final OdfStyleProperty RubyPosition =
  64.       OdfStyleProperty.get(
  65.           OdfStylePropertiesSet.RubyProperties,
  66.           OdfName.newName(OdfDocumentNamespace.STYLE, "ruby-position"));

  67.   /**
  68.    * Receives the value of the ODFDOM attribute representation <code>StyleRubyAlignAttribute</code>
  69.    * , See {@odf.attribute style:ruby-align}
  70.    *
  71.    * @return - the <code>String</code> , the value or <code>null</code>, if the attribute is not set
  72.    *     and no default value defined.
  73.    */
  74.   public String getStyleRubyAlignAttribute() {
  75.     StyleRubyAlignAttribute attr =
  76.         (StyleRubyAlignAttribute) getOdfAttribute(OdfDocumentNamespace.STYLE, "ruby-align");
  77.     if (attr != null) {
  78.       return String.valueOf(attr.getValue());
  79.     }
  80.     return null;
  81.   }

  82.   /**
  83.    * Sets the value of ODFDOM attribute representation <code>StyleRubyAlignAttribute</code> , See
  84.    * {@odf.attribute style:ruby-align}
  85.    *
  86.    * @param styleRubyAlignValue The type is <code>String</code>
  87.    */
  88.   public void setStyleRubyAlignAttribute(String styleRubyAlignValue) {
  89.     StyleRubyAlignAttribute attr = new StyleRubyAlignAttribute((OdfFileDom) this.ownerDocument);
  90.     setOdfAttribute(attr);
  91.     attr.setValue(styleRubyAlignValue);
  92.   }

  93.   /**
  94.    * Receives the value of the ODFDOM attribute representation <code>StyleRubyPositionAttribute
  95.    * </code> , See {@odf.attribute style:ruby-position}
  96.    *
  97.    * @return - the <code>String</code> , the value or <code>null</code>, if the attribute is not set
  98.    *     and no default value defined.
  99.    */
  100.   public String getStyleRubyPositionAttribute() {
  101.     StyleRubyPositionAttribute attr =
  102.         (StyleRubyPositionAttribute) getOdfAttribute(OdfDocumentNamespace.STYLE, "ruby-position");
  103.     if (attr != null) {
  104.       return String.valueOf(attr.getValue());
  105.     }
  106.     return null;
  107.   }

  108.   /**
  109.    * Sets the value of ODFDOM attribute representation <code>StyleRubyPositionAttribute</code> , See
  110.    * {@odf.attribute style:ruby-position}
  111.    *
  112.    * @param styleRubyPositionValue The type is <code>String</code>
  113.    */
  114.   public void setStyleRubyPositionAttribute(String styleRubyPositionValue) {
  115.     StyleRubyPositionAttribute attr =
  116.         new StyleRubyPositionAttribute((OdfFileDom) this.ownerDocument);
  117.     setOdfAttribute(attr);
  118.     attr.setValue(styleRubyPositionValue);
  119.   }

  120.   @Override
  121.   public void accept(ElementVisitor visitor) {
  122.     if (visitor instanceof DefaultElementVisitor) {
  123.       DefaultElementVisitor defaultVisitor = (DefaultElementVisitor) visitor;
  124.       defaultVisitor.visit(this);
  125.     } else {
  126.       visitor.visit(this);
  127.     }
  128.   }
  129. }