public class TransitFactory extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TransitFactory.Format
Transit formats
|
| Constructor and Description |
|---|
TransitFactory() |
| Modifier and Type | Method and Description |
|---|---|
static DefaultReadHandler<TaggedValue<Object>> |
defaultDefaultReadHandler()
Returns the DefaultReadHandler that is used by default
|
static Map<String,ReadHandler<?,?>> |
defaultReadHandlers()
Returns a map of tags to ReadHandlers that is used by default
|
static Map<Class,WriteHandler<?,?>> |
defaultWriteHandlers()
Returns a map of classes to Handlers that is used by default
|
static Keyword |
keyword(Object o)
Converts a string or keyword to a keyword
|
static Link |
link(String href,
String rel)
Creates a Link
|
static Link |
link(String href,
String rel,
String name,
String prompt,
String render)
Creates a Link
|
static Link |
link(URI href,
String rel)
Creates a Link
|
static Link |
link(URI href,
String rel,
String name,
String prompt,
String render)
Creates a Link
|
static Reader |
reader(TransitFactory.Format type,
InputStream in)
Creates a reader instance.
|
static Reader |
reader(TransitFactory.Format type,
InputStream in,
DefaultReadHandler<?> customDefaultHandler)
Creates a reader instance.
|
static Reader |
reader(TransitFactory.Format type,
InputStream in,
Map<String,ReadHandler<?,?>> customHandlers)
Creates a reader instance.
|
static Reader |
reader(TransitFactory.Format type,
InputStream in,
Map<String,ReadHandler<?,?>> customHandlers,
DefaultReadHandler<?> customDefaultHandler)
Creates a reader instance.
|
static Map<String,ReadHandler<?,?>> |
readHandlerMap(Map<String,ReadHandler<?,?>> customHandlers)
Creates a read-only Map of String to ReadHandler containing
default ReadHandlers with customHandlers merged in.
|
static Symbol |
symbol(Object o)
Converts a string or a symbol to a symbol
|
static <T> TaggedValue<T> |
taggedValue(String tag,
T rep)
Creates a TaggedValue
|
static URI |
uri(String uri)
Creates a URI
|
static Map<Class,WriteHandler<?,?>> |
writeHandlerMap(Map<Class,WriteHandler<?,?>> customHandlers)
Creates a read-only Map of Class to WriteHandler containing
default WriteHandlers with customHandlers merged in.
|
static <T> Writer<T> |
writer(TransitFactory.Format type,
OutputStream out)
Creates a writer instance.
|
static <T> Writer<T> |
writer(TransitFactory.Format type,
OutputStream out,
Map<Class,WriteHandler<?,?>> customHandlers)
Creates a writer instance.
|
public static <T> Writer<T> writer(TransitFactory.Format type, OutputStream out)
type - format to write inout - output stream to write topublic static <T> Writer<T> writer(TransitFactory.Format type, OutputStream out, Map<Class,WriteHandler<?,?>> customHandlers)
type - format to write inout - output stream to write tocustomHandlers - additional WriteHandlers to use in addition
to or in place of the default WriteHandlerspublic static Reader reader(TransitFactory.Format type, InputStream in)
type - the format to read inin - the input stream to read frompublic static Reader reader(TransitFactory.Format type, InputStream in, Map<String,ReadHandler<?,?>> customHandlers)
type - the format to read inin - the input stream to read fromcustomHandlers - a map of custom ReadHandlers to use in addition
or in place of the default ReadHandlerspublic static Reader reader(TransitFactory.Format type, InputStream in, DefaultReadHandler<?> customDefaultHandler)
type - the format to read inin - the input stream to read fromcustomDefaultHandler - a DefaultReadHandler to use for processing
encoded values for which there is no read handlerpublic static Reader reader(TransitFactory.Format type, InputStream in, Map<String,ReadHandler<?,?>> customHandlers, DefaultReadHandler<?> customDefaultHandler)
type - the format to read inin - the input stream to read fromcustomHandlers - a map of custom ReadHandlers to use in addition
or in place of the default ReadHandlerscustomDefaultHandler - a DefaultReadHandler to use for processing
encoded values for which there is no read handlerpublic static Keyword keyword(Object o)
o - A string or a keywordpublic static Symbol symbol(Object o)
o - a string or a symbolpublic static <T> TaggedValue<T> taggedValue(String tag, T rep)
tag - tag stringrep - value representationpublic static Link link(String href, String rel)
href - an href valuerel - a rel valuepublic static Link link(URI href, String rel)
href - an href valuerel - a rel valuepublic static Link link(String href, String rel, String name, String prompt, String render)
href - an href valuerel - a rel valuename - an optional name valueprompt - an optional prompt valuerender - an optional render valuepublic static Link link(URI href, String rel, String name, String prompt, String render)
href - an href valuerel - a rel valuename - an optional name valueprompt - an optional prompt valuerender - an optional render valuepublic static DefaultReadHandler<TaggedValue<Object>> defaultDefaultReadHandler()
public static Map<String,ReadHandler<?,?>> defaultReadHandlers()
public static Map<String,ReadHandler<?,?>> readHandlerMap(Map<String,ReadHandler<?,?>> customHandlers)
customHandlers - a map of custom ReadHandlers to use in addition
or in place of the default ReadHandlerspublic static Map<Class,WriteHandler<?,?>> defaultWriteHandlers()
public static Map<Class,WriteHandler<?,?>> writeHandlerMap(Map<Class,WriteHandler<?,?>> customHandlers)
customHandlers - a map of custom WriteHandler to use in addition
or in place of the default WriteHandlerCopyright © 2017. All rights reserved.