程序包 weka.core.xml

类 XMLOptions

java.lang.Object
weka.core.xml.XMLOptions
所有已实现的接口:
RevisionHandler

public class XMLOptions extends Object implements RevisionHandler
A class for transforming options listed in XML to a regular WEKA command line string.

版本:
$Revision: 1.4 $
作者:
FracPete (fracpete at waikato dot ac dot nz)
  • 字段详细资料

    • TAG_OPTION

      public static final String TAG_OPTION
      tag for a single option.
      另请参阅:
    • TAG_OPTIONS

      public static final String TAG_OPTIONS
      tag for a list of options.
      另请参阅:
    • ATT_NAME

      public static final String ATT_NAME
      the name attribute.
      另请参阅:
    • ATT_TYPE

      public static final String ATT_TYPE
      the type attribute.
      另请参阅:
    • ATT_VALUE

      public static final String ATT_VALUE
      the value attribute.
      另请参阅:
    • VAL_TYPE_FLAG

      public static final String VAL_TYPE_FLAG
      a value of the type attribute.
      另请参阅:
    • VAL_TYPE_SINGLE

      public static final String VAL_TYPE_SINGLE
      a value of the type attribute.
      另请参阅:
    • VAL_TYPE_HYPHENS

      public static final String VAL_TYPE_HYPHENS
      a value of the type attribute.
      另请参阅:
    • VAL_TYPE_QUOTES

      public static final String VAL_TYPE_QUOTES
      a value of the type attribute.
      另请参阅:
    • VAL_TYPE_CLASSIFIER

      public static final String VAL_TYPE_CLASSIFIER
      a value of the type attribute.
      另请参阅:
    • VAL_TYPE_OPTIONHANDLER

      public static final String VAL_TYPE_OPTIONHANDLER
      a value of the type attribute.
      另请参阅:
    • ROOT_NODE

      public static final String ROOT_NODE
      the root node.
      另请参阅:
    • DOCTYPE

      public static final String DOCTYPE
      the DTD for the XML file.
      另请参阅:
  • 构造器详细资料

    • XMLOptions

      public XMLOptions() throws Exception
      Creates a new instance of XMLOptions.
      抛出:
      Exception - if the construction of the DocumentBuilder fails
      另请参阅:
    • XMLOptions

      public XMLOptions(String xml) throws Exception
      Creates a new instance of XMLOptions.
      参数:
      xml - the xml to parse (if "<?xml" is not found then it is considered a file)
      抛出:
      Exception - if the construction of the DocumentBuilder fails
      另请参阅:
    • XMLOptions

      public XMLOptions(File file) throws Exception
      Creates a new instance of XMLOptions.
      参数:
      file - the XML file to parse
      抛出:
      Exception - if the construction of the DocumentBuilder fails
      另请参阅:
    • XMLOptions

      public XMLOptions(InputStream stream) throws Exception
      Creates a new instance of XMLOptions.
      参数:
      stream - the XML stream to parse
      抛出:
      Exception - if the construction of the DocumentBuilder fails
      另请参阅:
    • XMLOptions

      public XMLOptions(Reader reader) throws Exception
      Creates a new instance of XMLOptions.
      参数:
      reader - the XML reader to parse
      抛出:
      Exception - if the construction of the DocumentBuilder fails
      另请参阅:
  • 方法详细资料

    • getValidating

      public boolean getValidating()
      returns whether a validating parser is used.
      返回:
      whether a validating parser is used
    • setValidating

      public void setValidating(boolean validating) throws Exception
      sets whether to use a validating parser or not.
      Note: this does clear the current DOM document!
      参数:
      validating - whether to use a validating parser
      抛出:
      Exception - if the instantiating of the DocumentBuilder fails
    • getDocument

      public Document getDocument()
      returns the parsed DOM document.
      返回:
      the parsed DOM document
    • getXMLDocument

      public XMLDocument getXMLDocument()
      returns the handler of the XML document. the internal DOM document can be accessed via the getDocument() method.
      返回:
      the object handling the XML document
      另请参阅:
    • toCommandLine

      public String toCommandLine() throws Exception
      returns the given DOM document as command line.
      返回:
      the document as command line
      抛出:
      Exception - if anything goes wrong initializing the parsing
    • toArray

      public String[] toArray() throws Exception
      returns the current DOM document as string array.
      返回:
      the document as string array
      抛出:
      Exception - if anything goes wrong initializing the parsing
    • toString

      public String toString()
      returns the object in a string representation (as indented XML output).
      覆盖:
      toString 在类中 Object
      返回:
      the object in a string representation
    • getRevision

      public String getRevision()
      Returns the revision string.
      指定者:
      getRevision 在接口中 RevisionHandler
      返回:
      the revision
    • main

      public static void main(String[] args) throws Exception
      for testing only. prints the given XML file, the resulting commandline and the string array.
      参数:
      args - the commandline options.
      抛出:
      Exception - if something goes wrong