|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Object java.lang.Enum<SourceEnum> sk.uniba.euromath.gene.SourceEnum
public enum SourceEnum
Enumerates all possible source types that exporter can accept as an input.
Enum Constant Summary | |
---|---|
DOM
The DOM Document instance source. |
|
OBJECT
Java Object source. |
|
SAX
The DocumentHandler instance source. |
|
STREAM
InputStream source. |
Field Summary | |
---|---|
static List<SourceEnum> |
priorityList
List describing priorities for target-to-source conversion. |
Method Summary | |
---|---|
abstract Source |
convert(Source source,
ThreadGroup group)
Tries to convert given source to this source type. |
abstract ResultEnum |
getPair()
Returns result type that has the same type as this source. |
static EnumSet<ResultEnum> |
getPairSet(EnumSet<SourceEnum> sourceTypes)
Returns set consisting of pairs for all items in given set. |
static EnumSet<SourceEnum> |
getRedirectKinds(EnumSet<ResultEnum> products)
Computes all kinds of sources, that the product kinds are able to be redirected to. |
Class<? extends Source> |
getSourceClass()
Returns the class of Source object that is represented by the enum item. |
boolean |
represents(Class<? extends Source> sourceClass)
Returns true if this enum constant represents Source object of required instance. |
static SourceEnum |
valueOf(Class<? extends Source> sourceClass)
Finds appropriate enum item for the source instance. |
static SourceEnum |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static SourceEnum[] |
values()
Returns an array containing the constants of this enum type, in the order they're declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final SourceEnum DOM
public static final SourceEnum SAX
public static final SourceEnum STREAM
public static final SourceEnum OBJECT
Field Detail |
---|
public static final List<SourceEnum> priorityList
List describing priorities for target-to-source conversion. First item has the highest priority. Items priorities are as follows:
SourceEnum.OBJECT
- native data exchangeSourceEnum.SAX
- lowest memory consumption,SourceEnum.DOM
SourceEnum.STREAM
Method Detail |
---|
public static final SourceEnum[] values()
for(SourceEnum c : SourceEnum.values()) System.out.println(c);
public static SourceEnum valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified namepublic Class<? extends Source> getSourceClass()
public boolean represents(Class<? extends Source> sourceClass)
sourceClass
-
true
if this enum constant represents this class,
false
otherwise.public static SourceEnum valueOf(Class<? extends Source> sourceClass)
sourceClass
- class of Source object instance.
public abstract ResultEnum getPair()
public abstract Source convert(Source source, ThreadGroup group) throws IOException, TransformerException
Tries to convert given source to this source type. Conversion follows this table:
From | To | Description |
DOM | SAX | Standard conversion |
SAX | DOM | Standard conversion |
DOM, SAX | Stream | Serialization is performed. Result is valid XML file. Output document formatting is undefined. |
Stream | DOM, SAX | Stream is not parsed - one Text node containing stream contents is constructed instead. Stream is expected to be in UTF-8 encoding. |
Object | Stream, DOM, SAX | Object's toString() is called and result is returned
in form of stream (in case of Stream result; UTF-8
encoding), or as a Text node. |
DOM, SAX, Stream | Object | Returns null |
If both kinds are same then source
is simply returned.
The conversion may be performed by a background thread, to save memory space.
source
- source to convert.group
- attaches the thread to this group. For more info please look
on Thread.Thread(ThreadGroup, String)
description.
null
.
IOException
- if i/o error occurs during source reading.
TransformerException
- if transformer fails while processing
source.public static EnumSet<ResultEnum> getPairSet(EnumSet<SourceEnum> sourceTypes)
sourceTypes
- the source types.
public static final EnumSet<SourceEnum> getRedirectKinds(EnumSet<ResultEnum> products)
products
- set of result kinds.
products
set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |