|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectjp.crestmuse.cmx.filewrappers.NodeInterface
public abstract class NodeInterface
The abstract class NodeInterface is the common superclass of classes that provide interfaces for accessing XML nodes.
抽象クラスNodeInterfaceは, XMLドキュメント内のノードに アクセスするためのインターフェースを提供するクラスの共通基底クラスです.
典型的な使いかたとしては, ファイルラッパ(CMXFileWrapperのサブクラス)内に, 対応するXMLフォーマットの仕様に合わせて, 各要素へのアクセスをサポートする クラスをこのクラスのサブクラスとして, またファイルラッパの内部クラスとして 定義します. たとえば, MusicXMLWrapperクラスにはNoteというクラスがあり, これがMusicXMLフォーマットのnote要素へのアクセスをサポートします. NoteクラスはMusicXMLWrapperの内部クラスで, NodeInterfaceクラスの サブクラスとなっています.
コンストラクタの概要 | |
---|---|
protected |
NodeInterface(org.w3c.dom.Node node)
Constructs an node interface for the specified node. |
メソッドの概要 | |
---|---|
protected static java.lang.String |
getAttribute(org.w3c.dom.Node node,
java.lang.String attrkey)
|
java.lang.String |
getAttribute(java.lang.String key)
|
protected static double |
getAttributeDouble(org.w3c.dom.Node node,
java.lang.String attrkey)
|
double |
getAttributeDouble(java.lang.String key)
|
protected static int |
getAttributeInt(org.w3c.dom.Node node,
java.lang.String attrkey)
|
int |
getAttributeInt(java.lang.String key)
|
java.lang.String |
getAttributeNS(java.lang.String key,
java.lang.String namespace)
|
protected org.w3c.dom.Node |
getChildByTagName(java.lang.String tagname)
Returns the child node with the specified tag name. |
protected org.w3c.dom.Node |
getChildByTagNameNS(java.lang.String tagname,
java.lang.String ns)
|
protected org.w3c.dom.NodeList |
getChildNodes()
Returns all the child nodes すべての子ノードを返します. |
java.lang.String |
getChildText(java.lang.String tagname)
Returns the text that a child with the specified tag name has. |
double |
getChildTextDouble(java.lang.String tagname)
Returns the text that a child with the specified tag name has as a real number. |
int |
getChildTextInt(java.lang.String tagname)
Returns the text that a child with the specified tag name has as an integer. |
protected org.w3c.dom.Node |
getFirstChild()
|
protected org.w3c.dom.Node |
getLastChild()
|
java.lang.String |
getNodeName()
Returns the name of the node wrapped by this object. |
protected abstract java.lang.String |
getSupportedNodeName()
Returns the node name supported by the class. |
java.lang.String |
getText()
|
protected static java.lang.String |
getText(org.w3c.dom.Node node)
|
protected static double |
getTextDouble(org.w3c.dom.Node node)
|
protected static int |
getTextInt(org.w3c.dom.Node node)
|
protected static boolean |
hasAttribute(org.w3c.dom.Node node,
java.lang.String attrkey)
|
boolean |
hasAttribute(java.lang.String key)
|
protected static boolean |
hasChild(java.lang.String tagname,
org.w3c.dom.Node node)
|
protected org.w3c.dom.Node |
node()
Returns the node wrapped by this object. |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
コンストラクタの詳細 |
---|
protected NodeInterface(org.w3c.dom.Node node)
Constructs an node interface for the specified node. When the specified node is not supported, UnsupportedNodeException is thrown.
指定されたノードに対するノードインターフェースを生成します. 指定されたノードがサポートされていない場合, UnsupportedNodeExceptionがスローされます.
UnsupportedNodeException
- when the specified node is not supported.メソッドの詳細 |
---|
protected final org.w3c.dom.Node node()
Returns the node wrapped by this object.
このオブジェクトがラップするノードを返します. 現在のところこのメソッドはpublicとなっていますが, publicにすべきかは 議論のあるところで, 今後変更される場合があります. (試験的にprotectedに変更しています)
protected abstract java.lang.String getSupportedNodeName()
Returns the node name supported by the class. Please override this method in a subclass.
このオブジェクトがサポートするノード名を返します. このメソッドはサブクラスでオーバーライドしてください.
public final java.lang.String getNodeName()
Returns the name of the node wrapped by this object.
このオブジェクトがラップしているノード名を返します.
public final java.lang.String getChildText(java.lang.String tagname)
Returns the text that a child with the specified tag name has.
指定されたタグ名の子が持つテキストを返します.
public final int getChildTextInt(java.lang.String tagname)
Returns the text that a child with the specified tag name has as an integer.
指定されたタグ名の子が持つテキストを整数値として返します.
public final double getChildTextDouble(java.lang.String tagname)
Returns the text that a child with the specified tag name has as a real number.
指定されたタグ名の子が持つテキストを実数値として返します.
public final java.lang.String getText()
public boolean hasAttribute(java.lang.String key)
public java.lang.String getAttributeNS(java.lang.String key, java.lang.String namespace)
public java.lang.String getAttribute(java.lang.String key)
public int getAttributeInt(java.lang.String key)
public double getAttributeDouble(java.lang.String key)
protected final org.w3c.dom.NodeList getChildNodes()
Returns all the child nodes
すべての子ノードを返します.
protected final org.w3c.dom.Node getFirstChild()
protected final org.w3c.dom.Node getLastChild()
protected final org.w3c.dom.Node getChildByTagName(java.lang.String tagname)
Returns the child node with the specified tag name.
指定されたタグ名の子ノードを返します.
protected final org.w3c.dom.Node getChildByTagNameNS(java.lang.String tagname, java.lang.String ns)
protected static boolean hasChild(java.lang.String tagname, org.w3c.dom.Node node)
protected static java.lang.String getText(org.w3c.dom.Node node)
protected static final int getTextInt(org.w3c.dom.Node node) throws java.lang.NullPointerException
java.lang.NullPointerException
protected static final double getTextDouble(org.w3c.dom.Node node) throws java.lang.NullPointerException
java.lang.NullPointerException
protected static final boolean hasAttribute(org.w3c.dom.Node node, java.lang.String attrkey)
protected static final java.lang.String getAttribute(org.w3c.dom.Node node, java.lang.String attrkey)
protected static final int getAttributeInt(org.w3c.dom.Node node, java.lang.String attrkey)
protected static final double getAttributeDouble(org.w3c.dom.Node node, java.lang.String attrkey)
|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |