org.tridas.io
Class TridasIO

java.lang.Object
  extended by org.tridas.io.TridasIO

public class TridasIO
extends Object

Used to get readers/writers from name or extension. In order to include your writer/reader in the list, register it with registerFileReader(Class) and registerFileWriter(Class). Also, this class stores global properties for the library, such as charset detection when loading files.

Author:
daniel

Field Summary
static TreeMap<Integer,CoordinateReferenceSystem> crsMap
           
 
Constructor Summary
TridasIO()
           
 
Method Summary
static ArrayList<DendroFileFilter> getFileFilterArray()
           
static AbstractDendroFileReader getFileReader(String argFormatName)
          Get a file reader from the format name.
static AbstractDendroFileReader getFileReaderFromExtension(String argExtension)
          Gets the reader from the given extension.
static AbstractDendroCollectionWriter getFileWriter(String argFormatName)
          Get a file writer from the format name.
static AbstractDendroCollectionWriter getFileWriterFromExtension(String argExtension)
          Gets the writer from the given extension.
static String getReadingCharset()
           
static String[] getSupportedReadingFormats()
          Get all supported reading formats.
static String[] getSupportedWritingFormats()
          Get all supported writing formats
static String getWritingCharset()
           
static boolean isCharsetDetection()
          If the library detects the charset when loading files.
static void registerFileReader(Class<? extends AbstractDendroFileReader> argReader)
          Register a reader.
static void registerFileWriter(Class<? extends AbstractDendroCollectionWriter> argWriter)
          Register a writer
static void setCharsetDetection(boolean argCharsetDetection)
          Sets if charset detection is used when loading files.
static void setReadingCharset(String argCharset)
          sets the reading
static void setWritingCharset(String argCharset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

crsMap

public static TreeMap<Integer,CoordinateReferenceSystem> crsMap
Constructor Detail

TridasIO

public TridasIO()
Method Detail

setCharsetDetection

public static void setCharsetDetection(boolean argCharsetDetection)
Sets if charset detection is used when loading files. Usually this doesn't matter. Default of true.

Parameters:
argCharsetDetection -

isCharsetDetection

public static boolean isCharsetDetection()
If the library detects the charset when loading files.

Returns:

registerFileReader

public static void registerFileReader(Class<? extends AbstractDendroFileReader> argReader)
Register a reader.

Parameters:
argReader -

registerFileWriter

public static void registerFileWriter(Class<? extends AbstractDendroCollectionWriter> argWriter)
Register a writer

Parameters:
argWriter -

getFileWriter

public static AbstractDendroCollectionWriter getFileWriter(String argFormatName)
Get a file writer from the format name.

Parameters:
argFormatName -
Returns:
See Also:
getSupportedWritingFormats()

getFileReader

public static AbstractDendroFileReader getFileReader(String argFormatName)
Get a file reader from the format name.

Parameters:
argFormatName -
Returns:
See Also:
getSupportedReadingFormats()

getFileFilterArray

public static ArrayList<DendroFileFilter> getFileFilterArray()

getFileReaderFromExtension

public static AbstractDendroFileReader getFileReaderFromExtension(String argExtension)
Gets the reader from the given extension.

Parameters:
argExtension -
Returns:

getFileWriterFromExtension

public static AbstractDendroCollectionWriter getFileWriterFromExtension(String argExtension)
Gets the writer from the given extension.

Parameters:
argExtension -
Returns:

getSupportedReadingFormats

public static String[] getSupportedReadingFormats()
Get all supported reading formats.

Returns:

getSupportedWritingFormats

public static String[] getSupportedWritingFormats()
Get all supported writing formats

Returns:

setReadingCharset

public static void setReadingCharset(String argCharset)
sets the reading

Parameters:
argCharset - the charset to read with
Throws:
IllegalCharsetNameException - - If the given charset name is illegal
UnsupportedCharsetException - - If no support for the named charset is available in this instance of the Java virtual machine

getReadingCharset

public static String getReadingCharset()
Returns:
the charset

setWritingCharset

public static void setWritingCharset(String argCharset)
Parameters:
argCharset - the writingCharset to set

getWritingCharset

public static String getWritingCharset()
Returns:
the writingCharset


Copyright © 2011. All Rights Reserved.