Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## ix.util.xml
Class FileSyntaxManager

    java.lang.Object
      ix.util.xml.FileSyntaxManager

    public class FileSyntaxManager

extends java.lang.Object

Maps file names, URLs, etc to `FileSyntax`es.

Field Summary
`protected FileSyntax` | `defaultSyntax`
`protected java.util.List` | `syntaxes`

Constructor Summary
`FileSyntaxManager()`

Method Summary
`void` | `addAboutInfo(java.util.List about)`
`void` | `addSyntax(FileSyntax s)`
`protected void` | `addSyntaxes()`
`boolean` | `canRead(FileSyntax syntax, java.lang.Class c)`
`boolean` | `canWrite(FileSyntax syntax, java.lang.Class c)`
`protected void` | `checkSyntax(FileSyntax syntax, java.lang.Class objClass, java.lang.String direction)`
`java.util.List` | `getAllSyntaxes()`
`java.lang.String` | `getExceptType(java.lang.String filename)`
`java.io.File[]` | `getFiles(java.lang.Class desiredClass, java.lang.String directoryName)` Returns an array of Files in a specified directory that might contain instances of a desired class.
`java.util.Set` | `getInputTypesForClass(java.lang.Class c)`
`java.util.Set` | `getOutputTypesForClass(java.lang.Class c)`
`FileSyntax` | `getSyntax(java.io.File file)`
`FileSyntax` | `getSyntax(java.lang.String filename)`
`FileSyntax` | `getSyntax(java.net.URL url)`
`FileSyntax` | `getSyntaxForType(java.lang.String fileType)`
`java.lang.String` | `getType(java.lang.String filename)`
`java.util.SortedMap` | `readAllObjects(java.lang.Class desiredClass, java.lang.String directoryName)` Returns a sorted-map from the Files in a specified directory to objects that are instances of a desired class.
`java.lang.Object` | `readObject(java.lang.Class desiredClass, java.lang.String resourceName)`
`java.lang.Object` | `readObject(java.lang.Class desiredClass, java.net.URL url)`
`java.net.URL` | `requireURL(java.lang.String resourceName)` Like `toURL(String)` but throws an IllegalArgumentException rather than returning null.
`void` | `setDefault(FileSyntax s)`
`java.net.URL` | `toURL(java.lang.String resourceName)` Converts the name to a URL where the name can be a URL, the name of an existing file, or a resource accessible via this FileSyntaxManager's class's class loader.
`void` | `writeObject(java.lang.Object obj, java.lang.String filename)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### syntaxes

    protected java.util.List syntaxes

### defaultSyntax

    protected FileSyntax defaultSyntax

Constructor Detail

### FileSyntaxManager

    public FileSyntaxManager()

Method Detail

### addSyntaxes

    protected void addSyntaxes()

### getAllSyntaxes

    public java.util.List getAllSyntaxes()

### addSyntax

    public void addSyntax(FileSyntax s)

### setDefault

    public void setDefault(FileSyntax s)

### getSyntax

    public FileSyntax getSyntax(java.lang.String filename)

### getSyntax

    public FileSyntax getSyntax(java.io.File file)

### getSyntax

    public FileSyntax getSyntax(java.net.URL url)

### getType

    public java.lang.String getType(java.lang.String filename)

### getExceptType

    public java.lang.String getExceptType(java.lang.String filename)

### getSyntaxForType

    public FileSyntax getSyntaxForType(java.lang.String fileType)

### getInputTypesForClass

    public java.util.Set getInputTypesForClass(java.lang.Class c)

### getOutputTypesForClass

    public java.util.Set getOutputTypesForClass(java.lang.Class c)

### canRead

    public boolean canRead(FileSyntax syntax,
                           java.lang.Class c)

### canWrite

    public boolean canWrite(FileSyntax syntax,
                            java.lang.Class c)

### addAboutInfo

    public void addAboutInfo(java.util.List about)

### readObject

    public java.lang.Object readObject(java.lang.Class desiredClass,
                                       java.lang.String resourceName)

### readObject

    public java.lang.Object readObject(java.lang.Class desiredClass,
                                       java.net.URL url)

### readAllObjects

    public java.util.SortedMap readAllObjects(java.lang.Class desiredClass,
                                              java.lang.String directoryName)

  Returns a sorted-map from the Files in a specified directory to objects that are instances of a desired class. This method assumes that file types are a reliable guide to contents. If any file looks like it could contain a description (in some known syntax) of an instance of the desired class, then an exception is thrown if it instead contains a description of some other kind of object.

### getFiles

    public java.io.File[] getFiles(java.lang.Class desiredClass,
                                   java.lang.String directoryName)

  Returns an array of Files in a specified directory that might contain instances of a desired class. This method assumes that file types are a reliable guide to contents. If any file looks like it could contain a description (in some known syntax) of an instance of the desired class, then it is included.

  Throws:
    `java.lang.IllegalArgumentException` - if the directoryName is not the name of a directory.
    `Warning` - if the directory does not contain any suitable files.

### writeObject

    public void writeObject(java.lang.Object obj,
                            java.lang.String filename)

### checkSyntax

    protected void checkSyntax(FileSyntax syntax,
                               java.lang.Class objClass,
                               java.lang.String direction)

### toURL

    public java.net.URL toURL(java.lang.String resourceName)

  Converts the name to a URL where the name can be a URL, the name of an existing file, or a resource accessible via this FileSyntaxManager's class's class loader. Those 3 possibilities are tried in turn, and if none of them succeeds, the result is null.

  Returns:
    a URL or null

### requireURL

    public java.net.URL requireURL(java.lang.String resourceName)

  Like `toURL(String)` but throws an IllegalArgumentException rather than returning null.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD