org.apache.commons.jocl
クラス JOCLContentHandler

java.lang.Object
  拡張org.xml.sax.helpers.DefaultHandler
      拡張org.apache.commons.jocl.JOCLContentHandler
すべての実装インタフェース:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class JOCLContentHandler
extends DefaultHandler
implements ContentHandler

Java Object Configuration Language のための ContentHandler です。

A {@link org.xml.sax.ContentHandler} for the Java Object Configuration Language.

JOCL は任意の Java Object インスタンスを生成するためのXMLの文法を提供します。 これは全てのXMLドキュメントタイプを定義するのではなく(ルートエレメントがありません)、XMLフラグメントの記述を 各 Object の生成に適用します。

JOCL provides an XML syntax for constructing arbitrary Java {@link java.lang.Object} instances. It does not define a full XML document type (there's no root element), but rather an XML fragment describing the {@link java.lang.Object Objects} to be constructed.

JOCLフラグメント内でオブジェクトを定義する場合には object エレメントを使用します。 以下に簡単な例を示します:

In a JOCL fragment, one may define a series of objects using the object element. A trivial example is:
 <object class="java.util.Date"/>
この記述は引数なしのコンストラクタで java.util.Date のインスタンスを生成します。
which constructs an instance of java.util.Date using the no-argument constructor.

ルートとなる <object> が処理された後(これはXMLReader から呼ばれる endElement(java.lang.String,java.lang.String,java.lang.String) に該当します)、この生成されたオブジェクトは JOCLContentHandler 内の Object のリストに追加されます。

After a "root-level" <object> element has been processed (that is, once {@link #endElement(java.lang.String,java.lang.String,java.lang.String)} has been invoked by the {@link XMLReader}), it will be appended to a list of Objects maintained by the JOCLContentHandler.

(size()clear()getType(int)getValue(int)getTypeArray()getValueArray() を参照ください。)

(See {@link #size}, {@link #clear}, {@link #clear(int)}, {@link #getType(int)}, {@link #getValue(int)}, {@link #getTypeArray}, and {@link #getValueArray}.)

複数の object エレメントをフラグメント内に列挙することができます。 例えば以下の JOCL フラグメントを処理し、:

You can list multiple object elements in a fragment. For example, after processing the JOCL fragment:
 <object class="java.util.Date"/>
 <object class="java.util.Date"/>
その後に getTypeArray() メソッドを呼んだ場合、2つの java.util.Date インスタンスが返されます。 配列内の Object の順番は JOCL フラグメント内の <object> エレメントの記述の順番と一致します。
The {@link #getTypeArray} method will return an composed of two instances of java.util.Date. The sequence of {@link java.lang.Object Objects} in the array will correspond to the sequence of <object> elements in the JOCL fragment.

上記のように子エレメントを使用しない場合、 <object> タグは指定されたクラスの引数のないコンストラクタを呼びますが、ネストした <object> タグを使用すればコンストラクタに引数を指定することができます。 例えば、:

As we've seen, when used with no child-elements, the <object> tag will cause the no-argument constructor of the specified class to be invoked. It is also possible to nest <object> tags to provide arguments for the constructor. For example, the fragment:
 <object class="mypackage.Foo">
   <object class="mypackage.Bar"/>
 </object>
このフラグメントは new mypackage.Foo(new mypackage.Bar()) で生成された mypackage.Foo インスタンスをオブジェクトリストに追加します。
will add an instance of mypackage.Foo to the object list, constructed via new mypackage.Foo(new mypackage.Bar()).

プリミティブ型と String の引数を生成する場合には上記とは別の文法を使用します。 以下にいくつかの例をあげます:

There is a special syntax available creating primative values and arguments, as well as for constructing {@link java.lang.String String}s. Some examples:

 <byte value="3"/>
 <boolean value="false"/>
 <char value="c"/>
 <double value="3.14159"/>
 <float value="3.14"/>
 <int value="17"/>
 <long value="1700000"/>
 <short value="1"/>
 <string value="The quick brown fox..."/>

ルートレベル(親に <object> を持たない位置)に上記プリミティブ型のフラグメントが合った場合には、 各プリミティブ型に該当するラッパークラスが生成され、Object のリストに追加されます。 しかし、これらのオブジェクトに対する type は適切なプリミティブ型を返します。 <object> を親に持つ状態で記述された場合には指定された Object のコンストラクタのプリミティブ型の引数として扱われます。例えば、:

 <int value="5"/>
 <int value="26"/>
 <int value="100"/>

の処理は3つの Integer インスタンスを値のリストに追加し、 Integer.TYPE を型のリストに追加します。

When invoked at the "root" level (that is, with no <object> parent), this will cause the corresponding "object wrapper" to be added to the list of {@link java.lang.Object Object}s. The {@link #getType type} for these objects will reflect the proper primative type, however. When invoked with an <object> parent, these will be treated as primitive arguments to the specified {@link java.lang.Object Object}'s constructor. For example, while:

 <int value="5"/>
 <int value="26"/>
 <int value="100"/>

results in three {@link java.lang.Integer} instances being added to the list of values, with types corresponding to {@link java.lang.Integer}, the fragment:

 <int value="5"/>
  <int value="26"/>
  <int value="100"/>

results in three {@link java.lang.Integer} instances being added to the list of values, with types corresponding to {@link java.lang.Integer#TYPE}.

[訳者コメント:

記述が重複していておかしい気がしたので構成しなおしてみました。

]
従って、 mypackage.Foo(java.lang.Integer,java.lang.Integer,java.lang.Integer) というコンストラクタを呼ぶ場合は以下のようになります:
Hence if you want to invoke the mypackage.Foo(java.lang.Integer,java.lang.Integer,java.lang.Integer) constructor, use:
 <object class="mypackage.Foo"/>
   <object class="java.lang.Integer"><int value="5"/></object>
   <object class="java.lang.Integer"><int value="26"/></object>
   <object class="java.lang.Integer"><int value="100"/></object>
 </object>

また、 mypackage.Foo(int,int,int) というコンストラクタを呼ぶ場合は以下のようになります:

If you want to invoke the mypackage.Foo(int,int,int) constructor, use:
 <object class="mypackage.Foo"/>
   <int value="5"/>
   <int value="26"/>
   <int value="100"/>
 </object>

null オブジェクトを生成したい場合には以下のようになります:

If you'd like to creat a null object, use:
 <object class="mypackage.Bar" null="true"/>

以下に単純ですが、全てのパターンを網羅した例を示します:

Here's a simple but complete example:
 <?xml version="1.0"?>
 <arbitrary-root xmlns="http://apache.org/xml/xmlns/jakarta/commons/jocl">
   <string value="Hello World!"/>
   <string/>
   <boolean/>
   <boolean value="true"/>
   <byte value="1"/>
   <short value="1"/>
   <int value="1"/>
   <long value="1"/>
   <float value="1.0"/>
   <double value="1.0"/>
   <object class="java.util.Date"/>
   <object class="java.util.Date">
    <int value="1"/>
    <int value="1"/>
    <int value="1"/>
   </object>
 </arbitrary-root>

正式な JOCL の文法を表す DTD は以下のようになります:

Formally, a DTD for the JOCL grammar is as follows:

 <!ELEMENT object (object|byte|boolean|char|double|float|int|long|short|string)*>
 <!ATTLIST object
   class CDATA #REQUIRED
   null (true|false) "false">

 <!ELEMENT byte EMPTY>
 <!ATTLIST byte value CDATA #REQUIRED>

 <!ELEMENT boolean EMPTY>
 <!ATTLIST boolean value (true|false) #REQUIRED>

 <!ELEMENT char EMPTY>
 <!ATTLIST char value CDATA #REQUIRED>

 <!ELEMENT double EMPTY>
 <!ATTLIST double value CDATA #REQUIRED>

 <!ELEMENT float EMPTY>
 <!ATTLIST float value CDATA #REQUIRED>

 <!ELEMENT int EMPTY>
 <!ATTLIST int value CDATA #REQUIRED>

 <!ELEMENT long EMPTY>
 <!ATTLIST long value CDATA #REQUIRED>

 <!ELEMENT short EMPTY>
 <!ATTLIST short value CDATA #REQUIRED>

 <!ELEMENT string EMPTY>
 <!ATTLIST string value CDATA #REQUIRED>
 

また、このクラスは文法の一部として JOCL を使用する ContentHandler の基底クラスとして使用することができます。 単純にこのクラスを継承し、新たなタグを処理するために startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)DefaultHandler.characters(char[], int, int) endElement(java.lang.String, java.lang.String, java.lang.String) をオーバーライドし、JOCL で定義されたエレメントとデータを処理するために親クラスのメソッド (例. super.XXX) をコールして下さい。

This class can also be used as a base class for {@link org.xml.sax.ContentHandler}s that include JOCL as part of their grammar. Simply extend this class, and override the {@link #startElement}, {@link #characters}, and {@link #endElement} methods to handle your tags, and invoke the method of the parent class (i.e., super.XXX for elements and data that you don't handle.

簡単に InputStreamReaderInputSource からオブジェクトのリストを読み込むことのできる複数の static メソッドが利用可能です。

A number of static methods are available for simply reading a list of objects from a {@link InputStream}, {@link Reader} or {@link InputSource}.

このクラスは synchronized ではない事に注意してください。

Note that this class is not synchronized.

バージョン:
$Id: JOCLContentHandler.java,v 1.1.1.1 2004/02/13 10:02:03 hioki Exp $
作成者:
Rodney Waldhoff
翻訳者:
日置 聡
翻訳状況:
初稿(校正者募集中)
翻訳更新日:
2003/09/05

フィールドの概要
protected  boolean _acceptEmptyNamespaceForAttributes
          true の場合、ネームスペースURIを持たない属性を JOCL ネームスペースの一部として扱います。
protected  boolean _acceptEmptyNamespaceForElements
          true の場合、ネームスペースURIを持たないエレメントを JOCL ネームスペースの一部として扱います。
protected  boolean _acceptJoclPrefixForAttributes
          true の場合、 JOCL_PREFIX を持つがネームスペースURIを持たない属性を JOCL ネームスペースにマッピングします。
protected  boolean _acceptJoclPrefixForElements
          true の場合、 JOCL_PREFIX を持つがネームスペースURIを持たないエレメントを JOCL ネームスペースにマッピングします。
protected  org.apache.commons.jocl.JOCLContentHandler.ConstructorDetails _cur
          現在処理中のオブジェクト。
protected  Locator _locator
          内部で使用する Locator
protected  ArrayList _typeList
          パース処理にて生成された型( Class )のリスト。
protected  ArrayList _valueList
          パース処理にて生成された値( Object )のリスト。
protected static String ATT_CLASS
          "object" エレメントの "class" 属性名。
protected static String ATT_ISNULL
          "object" エレメントの "isnull" 属性名。
protected static String ATT_VALUE
          "value" 属性名。
protected static String ELT_BOOLEAN
          "boolean" エレメント名。
protected static String ELT_BYTE
          "byte" エレメント名。
protected static String ELT_CHAR
          "char" エレメント名。
protected static String ELT_DOUBLE
          "double" エレメント名。
protected static String ELT_FLOAT
          "float" エレメント名。
protected static String ELT_INT
          "int" エレメント名。
protected static String ELT_LONG
          "long" エレメント名。
protected static String ELT_OBJECT
          "object" エレメント名。
protected static String ELT_SHORT
          "short" エレメント名。
protected static String ELT_STRING
          "string" エレメント名。
static String JOCL_NAMESPACE_URI
          JOCL ネームスペース URI、 http://apache.org/xml/xmlns/jakarta/commons/jocl
static String JOCL_PREFIX
          デフォルト JOCL プレフィックス、 jocl:
 
コンストラクタの概要
JOCLContentHandler()
          JOCLContentHandler(true,true,true,true) と同等です。
JOCLContentHandler(boolean emptyEltNS, boolean joclEltPrefix, boolean emptyAttrNS, boolean joclAttrPrefix)
          JOCLContentHandler を生成します。
 
メソッドの概要
protected  void addObject(Class type, Object val)
          指定されたオブジェクトを型/値のリストか、現在生成中ののオブジェクトのコンストラクタの引数のいずれかに追加します。
 void clear()
          リスト内の全ての値と型の数を削除します。
 void clear(int i)
          指定されたインデックスの値/型のペアを削除します。
 void endElement(String uri, String localName, String qname)
           
protected  String getAttributeValue(String localname, Attributes attr)
          getAttributeValue(localname,attr,null) と同等です。
protected  String getAttributeValue(String localname, Attributes attr, String implied)
          JOCL ネームスペース内の指定された localname に該当する属性の値を指定された Attributes の中から返します。
 Class getType(int i)
          指定されたインデックスのオブジェクトの型を返します。
 Object[] getTypeArray()
          型のリストのシャローコピーを返します。
 Object getValue(int i)
          指定されたインデックスのオブジェクトの値を返します。
 Object[] getValueArray()
          値のリストのシャローコピーを返します。
protected  boolean isJoclNamespace(String uri, String localname, String qname)
          指定されたエレメントを定義する属性が(現在の設定で) JOCL ネームスペースに含まれる場合、 true を返します。
static void main(String[] args)
          単純なテストメソッドです。
static JOCLContentHandler parse(File f)
          org.xml.sax.driver プロパティで指定された XMLReader を使用して指定されたファイルから JOCL ドキュメントを読み込み、パースします。
static JOCLContentHandler parse(File f, XMLReader reader)
          指定された XMLReader を使用して指定された ファイル から JOCL ドキュメントを読み込み、パースします。
static JOCLContentHandler parse(InputSource in)
          org.xml.sax.driver プロパティで指定された XMLReader を使用して指定された InputSource から JOCL ドキュメントを読み込み、パースします。
static JOCLContentHandler parse(InputSource in, XMLReader reader)
          指定された XMLReader を使用して指定された InputSource から JOCL ドキュメントを読み込み、パースします。
static JOCLContentHandler parse(InputStream in)
          org.xml.sax.driver プロパティで指定された XMLReader を使用して指定された InputStream から JOCL ドキュメントを読み込み、パースします。
static JOCLContentHandler parse(InputStream in, XMLReader reader)
          指定された XMLReader を使用して指定された InputStream から JOCL ドキュメントを読み込み、パースします。
static JOCLContentHandler parse(Reader in)
          org.xml.sax.driver プロパティで指定された XMLReader を使用して指定された Reader から JOCL ドキュメントを読み込み、パースします。
static JOCLContentHandler parse(Reader in, XMLReader reader)
          指定された XMLReader を使用して指定された Reader から JOCL ドキュメントを読み込み、パースします。
 void setDocumentLocator(Locator locator)
           
 int size()
          リスト内の値と型の数を返します。
 void startElement(String uri, String localName, String qname, Attributes attr)
           
 
クラス org.xml.sax.helpers.DefaultHandler から継承したメソッド
characters, endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
インタフェース org.xml.sax.ContentHandler から継承したメソッド
characters, endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, skippedEntity, startDocument, startPrefixMapping
 

フィールドの詳細

_acceptEmptyNamespaceForAttributes

protected boolean _acceptEmptyNamespaceForAttributes
true の場合、ネームスペースURIを持たない属性を JOCL ネームスペースの一部として扱います。
When true, I will treat attributes with an empty namespace URI as part of the JOCL namespace.

関連項目:
JOCL_NAMESPACE_URI

_acceptEmptyNamespaceForElements

protected boolean _acceptEmptyNamespaceForElements
true の場合、ネームスペースURIを持たないエレメントを JOCL ネームスペースの一部として扱います。
When true, I will treat elements with an empty namespace URI as part of the JOCL namespace.

関連項目:
JOCL_NAMESPACE_URI

_acceptJoclPrefixForAttributes

protected boolean _acceptJoclPrefixForAttributes
true の場合、 JOCL_PREFIX を持つがネームスペースURIを持たない属性を JOCL ネームスペースにマッピングします。
When true, I will treat attributes with the {@link #JOCL_PREFIX} but no namespace URI as being mapped to the jocl namespace.

関連項目:
JOCL_PREFIX, JOCL_NAMESPACE_URI

_acceptJoclPrefixForElements

protected boolean _acceptJoclPrefixForElements
true の場合、 JOCL_PREFIX を持つがネームスペースURIを持たないエレメントを JOCL ネームスペースにマッピングします。
When true, I will treat elements with the {@link #JOCL_PREFIX} but no namespace URI as being mapped to the jocl namespace.

関連項目:
JOCL_PREFIX, JOCL_NAMESPACE_URI

_cur

protected org.apache.commons.jocl.JOCLContentHandler.ConstructorDetails _cur
現在処理中のオブジェクト。
The object I'm currently working on.


_locator

protected Locator _locator
内部で使用する Locator
My {@link Locator}.


_typeList

protected ArrayList _typeList
パース処理にて生成された型( Class )のリスト。
A list of the types ({@link Class}es) already created via the parse.


_valueList

protected ArrayList _valueList
パース処理にて生成された値( Object )のリスト。
A list of the values ({@link Object}s) already created via the parse.


ATT_CLASS

protected static final String ATT_CLASS
"object" エレメントの "class" 属性名。
The name of the "object" element's "class" attribute.

関連項目:
定数フィールド値

ATT_ISNULL

protected static final String ATT_ISNULL
"object" エレメントの "isnull" 属性名。
The name of the "object" element's "isnull" attribute.

関連項目:
定数フィールド値

ATT_VALUE

protected static final String ATT_VALUE
"value" 属性名。
The name of the "value" attribute.

関連項目:
定数フィールド値

ELT_BOOLEAN

protected static final String ELT_BOOLEAN
"boolean" エレメント名。
The name of the "boolean" element.

関連項目:
定数フィールド値

ELT_BYTE

protected static final String ELT_BYTE
"byte" エレメント名。
The name of the "byte" element.

関連項目:
定数フィールド値

ELT_CHAR

protected static final String ELT_CHAR
"char" エレメント名。
The name of the "char" element.

関連項目:
定数フィールド値

ELT_DOUBLE

protected static final String ELT_DOUBLE
"double" エレメント名。
The name of the "double" element.

関連項目:
定数フィールド値

ELT_FLOAT

protected static final String ELT_FLOAT
"float" エレメント名。
The name of the "float" element.

関連項目:
定数フィールド値

ELT_INT

protected static final String ELT_INT
"int" エレメント名。
The name of the "int" element.

関連項目:
定数フィールド値

ELT_LONG

protected static final String ELT_LONG
"long" エレメント名。
The name of the "long" element.

関連項目:
定数フィールド値

ELT_OBJECT

protected static final String ELT_OBJECT
"object" エレメント名。
The name of the "object" element.

関連項目:
定数フィールド値

ELT_SHORT

protected static final String ELT_SHORT
"short" エレメント名。
The name of the "short" element.

関連項目:
定数フィールド値

ELT_STRING

protected static final String ELT_STRING
"string" エレメント名。
The name of the "string" element.

関連項目:
定数フィールド値

JOCL_NAMESPACE_URI

public static final String JOCL_NAMESPACE_URI
JOCL ネームスペース URI、 http://apache.org/xml/xmlns/jakarta/commons/jocl
The JOCL namespace URI, http://apache.org/xml/xmlns/jakarta/commons/jocl.

関連項目:
定数フィールド値

JOCL_PREFIX

public static final String JOCL_PREFIX
デフォルト JOCL プレフィックス、 jocl:
The default JOCL prefix, jocl:.

関連項目:
定数フィールド値
コンストラクタの詳細

JOCLContentHandler

public JOCLContentHandler()
JOCLContentHandler(true,true,true,true) と同等です。
Equivalent to {@link #JOCLContentHandler(boolean,boolean,boolean,boolean) JOCLContentHandler(true,true,true,true)}.


JOCLContentHandler

public JOCLContentHandler(boolean emptyEltNS,
                          boolean joclEltPrefix,
                          boolean emptyAttrNS,
                          boolean joclAttrPrefix)
JOCLContentHandler を生成します。
Construct a JOCLContentHandler.

パラメータ:
emptyEltNS - true の場合、ネームスペースのない全てのエレメントを JOCL ネームスペースに含まれるとみなします
when true I should assume any element with an empty namespace is within the JOCL namespace
joclEltPrefix - true の場合、jocl: のプレフィックスを持ち、ネームスペースのないエレメントを JOCL ネームスペースに含まれるとみなします
when true I should assume any element who's prefix is jocl: and who's namespace is empty is within the JOCL namespace
emptyAttrNS - true の場合、ネームスペースのない全ての属性を JOCL ネームスペースに含まれるとみなします
when true I should assume any attribute with an empty namespace is within the JOCL namespace
joclAttrPrefix - true の場合、jocl: のプレフィックスを持ち、ネームスペースのない属性を JOCL ネームスペースに含まれるとみなします
when true I should assume any attribute who's prefix is jocl: and who's namespace is empty is within the JOCL namespace
メソッドの詳細

addObject

protected void addObject(Class type,
                         Object val)
指定されたオブジェクトを型/値のリストか、現在生成中ののオブジェクトのコンストラクタの引数のいずれかに追加します。
Add the specified object either to my type/value list, or as an argument to the object I'm currently constructing.


clear

public void clear()
リスト内の全ての値と型の数を削除します。
Clears all the values and types in my list.


clear

public void clear(int i)
指定されたインデックスの値/型のペアを削除します。
Removes the value/type pair at the specified index.


endElement

public void endElement(String uri,
                       String localName,
                       String qname)
                throws SAXException
定義:
インタフェース ContentHandler 内の endElement
例外:
SAXException

getAttributeValue

protected String getAttributeValue(String localname,
                                   Attributes attr)
getAttributeValue(localname,attr,null) と同等です。
Equivalent to {@link #getAttributeValue(java.lang.String,org.xml.sax.Attributes,java.lang.String) getAttributeValue(localname,attr,null)}.


getAttributeValue

protected String getAttributeValue(String localname,
                                   Attributes attr,
                                   String implied)
JOCL ネームスペース内の指定された localname に該当する属性の値を指定された Attributes の中から返します。 該当する属性が見つからない場合、implied を返します。
Returns the value of attribute with the given localname within the JOCL namespace from the given set of {@link Attributes}. If no such attribute can be found, returns implied.

パラメータ:
localname - 前置修飾子を含まない検索対象となる属性名
the unqualified name of the attribute to look for
attr - 値を探す対象となる属性一覧
the Attributes in which to find the value
implied - 属性のデフォルトの値
the default value for the attribute
戻り値:
the Attributes の中の JOCL ネームスペース内の指定された localname に該当する属性の値、 該当する属性が見つからない場合、implied
the value of attribute with the given localname within the JOCL namespace from the given set of {@link Attributes}. If no such attribute can be found, returns implied.

getType

public Class getType(int i)
指定されたインデックスのオブジェクトの型を返します。
Returns the type of the object at the specified index.


getTypeArray

public Object[] getTypeArray()
型のリストのシャローコピーを返します。
Returns a shallow copy of my list of types.


getValue

public Object getValue(int i)
指定されたインデックスのオブジェクトの値を返します。
Returns the value of the object at the specified index.


getValueArray

public Object[] getValueArray()
値のリストのシャローコピーを返します。
Returns a shallow copy of my list of values.


isJoclNamespace

protected boolean isJoclNamespace(String uri,
                                  String localname,
                                  String qname)
指定されたエレメントを定義する属性が(現在の設定で) JOCL ネームスペースに含まれる場合、 true を返します。
Returns true if the given attributes define an element within the JOCL namespace (according to my current configuration.)

関連項目:
_acceptEmptyNamespaceForElements, _acceptJoclPrefixForElements

main

public static void main(String[] args)
                 throws Exception
単純なテストメソッドです。 標準入力から JOCL を読み込み、生成されたオブジェクトのリストを標準出力に書き出します。 (XMLReader を指定するためには org.xml.sax.driver システムプロパティを使用してください。)
A simple tester method. Reads a JOCL document from standard in and prints a list of the objects created to standard out. (Use the org.xml.sax.driver system property to specify an {@link XMLReader}.

例外:
Exception

parse

public static JOCLContentHandler parse(File f)
                                throws SAXException,
                                       FileNotFoundException,
                                       IOException
org.xml.sax.driver プロパティで指定された XMLReader を使用して指定されたファイルから JOCL ドキュメントを読み込み、パースします。 返される JOCLContentHandler はファイルに記述されたオブジェクトのリストを内部に持ちます。
Parses a JOCL document from the specified file, using the {@link XMLReader} specified by the org.xml.sax.driver property. The returned {@link JOCLContentHandler} will contain the list of objects described by the file.

パラメータ:
f - JOCL ドキュメントを含む File
a {@link File} containing the JOCL document
戻り値:
JOCL ドキュメントに記述されたオブジェクトの配列を内部に持つ JOCLContentHandler
a {@link JOCLContentHandler} containing the list of objects described by the JOCL document
例外:
SAXException
FileNotFoundException
IOException

parse

public static JOCLContentHandler parse(File f,
                                       XMLReader reader)
                                throws SAXException,
                                       FileNotFoundException,
                                       IOException
指定された XMLReader を使用して指定された ファイル から JOCL ドキュメントを読み込み、パースします。 返される JOCLContentHandler はファイルに記述されたオブジェクトのリストを内部に持ちます。
Parses a JOCL document from the specified file, using the {@link XMLReader} specified by the org.xml.sax.driver property. The returned {@link JOCLContentHandler} will contain the list of objects described by the file.

パラメータ:
f - JOCL ドキュメントを含む File
a {@link File} containing the JOCL document
reader - ファイルをパーすする際に使用される XMLReader
the {@link XMLReader} to use to parse the file
戻り値:
JOCL ドキュメントに記述されたオブジェクトの配列を内部に持つ JOCLContentHandler
a {@link JOCLContentHandler} containing the list of objects described by the JOCL document
例外:
SAXException
FileNotFoundException
IOException

parse

public static JOCLContentHandler parse(InputSource in)
                                throws SAXException,
                                       IOException
org.xml.sax.driver プロパティで指定された XMLReader を使用して指定された InputSource から JOCL ドキュメントを読み込み、パースします。 返される JOCLContentHandler はファイルに記述されたオブジェクトのリストを内部に持ちます。
Parses a JOCL document from the specified {@link InputSource}, using thethe {@link XMLReader} specified by the org.xml.sax.driver property. The returned {@link JOCLContentHandler} will contain the list of objects described by the file.

パラメータ:
in - JOCL ドキュメントを含む InputSource
a {@link InputSource} containing the JOCL document
戻り値:
JOCL ドキュメントに記述されたオブジェクトの配列を内部に持つ JOCLContentHandler
a {@link JOCLContentHandler} containing the list of objects described by the JOCL document
例外:
SAXException
IOException

parse

public static JOCLContentHandler parse(InputSource in,
                                       XMLReader reader)
                                throws SAXException,
                                       IOException
指定された XMLReader を使用して指定された InputSource から JOCL ドキュメントを読み込み、パースします。 返される JOCLContentHandler はファイルに記述されたオブジェクトのリストを内部に持ちます。
Parses a JOCL document from the specified {@link InputSource}, using the specified {@link XMLReader}. The returned {@link JOCLContentHandler} will contain the list of objects described by the file.

パラメータ:
in - JOCL ドキュメントを含む InputSource
a {@link InputSource} containing the JOCL document
reader - ファイルをパーすする際に使用される XMLReader
the {@link XMLReader} to use to parse the file
戻り値:
JOCL ドキュメントに記述されたオブジェクトの配列を内部に持つ JOCLContentHandler
a {@link JOCLContentHandler} containing the list of objects described by the JOCL document
例外:
SAXException
IOException

parse

public static JOCLContentHandler parse(InputStream in)
                                throws SAXException,
                                       IOException
org.xml.sax.driver プロパティで指定された XMLReader を使用して指定された InputStream から JOCL ドキュメントを読み込み、パースします。 返される JOCLContentHandler はファイルに記述されたオブジェクトのリストを内部に持ちます。
Parses a JOCL document from the specified {@link InputStream}, using the {@link XMLReader} specified by the org.xml.sax.driver property. The returned {@link JOCLContentHandler} will contain the list of objects described by the file.

パラメータ:
in - JOCL ドキュメントを含む InputStream
a {@link InputStream} containing the JOCL document
戻り値:
JOCL ドキュメントに記述されたオブジェクトの配列を内部に持つ JOCLContentHandler
a {@link JOCLContentHandler} containing the list of objects described by the JOCL document
例外:
SAXException
IOException

parse

public static JOCLContentHandler parse(InputStream in,
                                       XMLReader reader)
                                throws SAXException,
                                       IOException
指定された XMLReader を使用して指定された InputStream から JOCL ドキュメントを読み込み、パースします。 返される JOCLContentHandler はファイルに記述されたオブジェクトのリストを内部に持ちます。
Parses a JOCL document from the specified {@link InputStream}, using the specified {@link XMLReader}. The returned {@link JOCLContentHandler} will contain the list of objects described by the file.

パラメータ:
in - JOCL ドキュメントを含む InputStream
a {@link InputStream} containing the JOCL document
reader - ファイルをパーすする際に使用される XMLReader
the {@link XMLReader} to use to parse the file
戻り値:
JOCL ドキュメントに記述されたオブジェクトの配列を内部に持つ JOCLContentHandler
a {@link JOCLContentHandler} containing the list of objects described by the JOCL document
例外:
SAXException
IOException

parse

public static JOCLContentHandler parse(Reader in)
                                throws SAXException,
                                       IOException
org.xml.sax.driver プロパティで指定された XMLReader を使用して指定された Reader から JOCL ドキュメントを読み込み、パースします。 返される JOCLContentHandler はファイルに記述されたオブジェクトのリストを内部に持ちます。
Parses a JOCL document from the specified {@link Reader}, using the {@link XMLReader} specified by the org.xml.sax.driver property. The returned {@link JOCLContentHandler} will contain the list of objects described by the file.

パラメータ:
in - JOCL ドキュメントを含む Reader
a {@link Reader} containing the JOCL document
戻り値:
JOCL ドキュメントに記述されたオブジェクトの配列を内部に持つ JOCLContentHandler
a {@link JOCLContentHandler} containing the list of objects described by the JOCL document
例外:
SAXException
IOException

parse

public static JOCLContentHandler parse(Reader in,
                                       XMLReader reader)
                                throws SAXException,
                                       IOException
指定された XMLReader を使用して指定された Reader から JOCL ドキュメントを読み込み、パースします。 返される JOCLContentHandler はファイルに記述されたオブジェクトのリストを内部に持ちます。
Parses a JOCL document from the specified {@link Reader}, using the specified {@link XMLReader}. The returned {@link JOCLContentHandler} will contain the list of objects described by the file.

パラメータ:
in - JOCL ドキュメントを含む Reader
a {@link Reader} containing the JOCL document
reader - ファイルをパーすする際に使用される XMLReader
the {@link XMLReader} to use to parse the file
戻り値:
JOCL ドキュメントに記述されたオブジェクトの配列を内部に持つ JOCLContentHandler
a {@link JOCLContentHandler} containing the list of objects described by the JOCL document
例外:
SAXException
IOException

setDocumentLocator

public void setDocumentLocator(Locator locator)
定義:
インタフェース ContentHandler 内の setDocumentLocator

size

public int size()
リスト内の値と型の数を返します。
Returns the number of values and types in my list.

戻り値:
リスト内の値と型の数
the number of values and types in my list.

startElement

public void startElement(String uri,
                         String localName,
                         String qname,
                         Attributes attr)
                  throws SAXException
定義:
インタフェース ContentHandler 内の startElement
例外:
SAXException


このドキュメントは、Ja-Jakartaにより訳されました。 コメントがある場合は report@jajakarta.orgまでお願いします。
Translated into Japanese by jajakarta.org. The original page is here.
Copyright (c) 2002-2003 - Apache Software Foundation