Class Binary

All Implemented Interfaces:
Serializable, Cloneable, CharacterData, Node, Text, Binable, Item, Textual

public class Binary extends AbstractTextual implements Text, Binable
The binary item. It is iDOM's extension to W3C/DOM, which allows only String-type value. However, XML files doesn't convey the type information, so, when loading back an XML file, Binary vertices become CData vertices.

To be compatible with W3C/DOM utility, it fakes as Text. Thus, getNodeName returns "#text", rather than getName ("#binary").

Author:
tomyeh
See Also:
  • Constructor Details

    • Binary

      public Binary(String value)
      Constructor.
    • Binary

      public Binary(Object value)
      Constructor.
    • Binary

      public Binary()
      Constructor.
  • Method Details

    • checkText

      protected void checkText(String text)
      Description copied from class: AbstractTextual
      Checks whether the text is valid. It is usually overridden by the deriving classes to check more specifically.
      Overrides:
      checkText in class AbstractTextual
    • getValue

      public final Object getValue()
      Description copied from interface: Binable
      Gets the value of a item that accepts any type as its value.
      Specified by:
      getValue in interface Binable
    • setValue

      public final void setValue(Object o)
      Description copied from interface: Binable
      Sets the value of a item that accepts any type as its value.
      Specified by:
      setValue in interface Binable
    • getText

      public final String getText()
      Gets the text representation of the value. Never null.
      Specified by:
      getText in interface Item
      Overrides:
      getText in class AbstractTextual
    • setText

      public final void setText(String text)
      Description copied from interface: Item
      Sets the text of this item.
      Specified by:
      setText in interface Item
      Overrides:
      setText in class AbstractTextual
    • getName

      public final String getName()
      Description copied from interface: Item
      Gets the name of the item. For vertices that support namespace (implements Namespaceable), it is the same as getTagName.
      Specified by:
      getName in interface Item
      See Also:
    • getNodeName

      public final String getNodeName()
      Specified by:
      getNodeName in interface Node
      Overrides:
      getNodeName in class AbstractItem
    • getNodeType

      public final short getNodeType()
      Specified by:
      getNodeType in interface Node
    • toString

      public String toString()
      Gets the textual representation for debug.
      Overrides:
      toString in class AbstractTextual