public class DurboInput extends Object implements DurboConstants, DurboNamespaceResolver
DurboInput
class implements a reader on a inputstream that
contains durbo-serialized data. DurboOutput
for a more detailed
description of this protocol.Modifier and Type | Class and Description |
---|---|
class |
DurboInput.Element
Inner class that represents one element of the Durbo protocol
|
class |
DurboInput.Node |
class |
DurboInput.Property |
Modifier and Type | Field and Description |
---|---|
static int |
PROPERTY_TYPE_BINARY
Deprecated.
Use
PropertyType#BINARY instead |
static int |
PROPERTY_TYPE_BOOLEAN
Deprecated.
Use
PropertyType#BOOLEAN instead |
static int |
PROPERTY_TYPE_DATE
Deprecated.
Use
PropertyType#DATE instead |
static int |
PROPERTY_TYPE_DOUBLE
Deprecated.
Use
PropertyType#DOUBLE instead |
static int |
PROPERTY_TYPE_LONG
Deprecated.
Use
PropertyType#LONG instead |
static int |
PROPERTY_TYPE_NAME
Deprecated.
Use
PropertyType#NAME instead |
static int |
PROPERTY_TYPE_PATH
Deprecated.
Use
PropertyType#PATH instead |
static int |
PROPERTY_TYPE_REFERENCE
Deprecated.
Use
PropertyType#REFERENCE instead |
static int |
PROPERTY_TYPE_STRING
Deprecated.
Use
PropertyType#STRING instead |
static int |
PROPERTY_TYPE_UNDEFINED
Deprecated.
Use
PropertyType#UNDEFINED instead |
DEFAULT_CONTENT_TYPE, MULTIPLE, NAMESPACE, NODE_END, NODE_START, PROPERTY, PROPERTY_TYPE_MASK, PROTOCOL_CONTENT_TYPE, PROTOCOL_ENCODING, PROTOCOL_HEADER, PROTOCOL_VERSION, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, PROTOCOL_VERSION_2_1
Constructor and Description |
---|
DurboInput(File file)
Creates a new
DurboInput on the specified file. |
DurboInput(InputStream inputStream)
Creates a new
DurboInput on the specified input stream. |
Modifier and Type | Method and Description |
---|---|
String |
getContentType() |
String |
getEncoding() |
String |
getPrefix(String uri)
returns the namespace prefix for the given uri
|
String[] |
getPrefixes() |
String |
getURI(String prefix)
Returns the namespace uri for the given namespace
|
String[] |
getURIs() |
double |
getVersion()
Returns the version
|
DurboInput.Element |
read()
Reads an element from this input
|
void |
skipNode()
skips a node
|
public static final int PROPERTY_TYPE_UNDEFINED
PropertyType#UNDEFINED
insteadpublic static final int PROPERTY_TYPE_STRING
PropertyType#STRING
insteadpublic static final int PROPERTY_TYPE_BINARY
PropertyType#BINARY
insteadpublic static final int PROPERTY_TYPE_LONG
PropertyType#LONG
insteadpublic static final int PROPERTY_TYPE_DOUBLE
PropertyType#DOUBLE
insteadpublic static final int PROPERTY_TYPE_DATE
PropertyType#DATE
insteadpublic static final int PROPERTY_TYPE_BOOLEAN
PropertyType#BOOLEAN
insteadpublic static final int PROPERTY_TYPE_NAME
PropertyType#NAME
insteadpublic static final int PROPERTY_TYPE_PATH
PropertyType#PATH
insteadpublic static final int PROPERTY_TYPE_REFERENCE
PropertyType#REFERENCE
insteadpublic DurboInput(File file) throws IOException
DurboInput
on the specified file. This
also reads the header to check if the underlying stream is of the correct
format. In difference to the more generic DurboInput(InputStream)
constructor this operates on a file an can therefor be optimized.file
- underlying fileIOException
- if an I/O error occurspublic DurboInput(InputStream inputStream) throws IOException
DurboInput
on the specified input stream. This
also reads the header to check if the underlying stream is of the correct
format.inputStream
- the input streamIOException
- if an I/O error occurrspublic String getEncoding()
public String getContentType()
public double getVersion()
public DurboInput.Element read() throws IOException
null
if a end of the inputIOException
- if an I/O error occurs or if the data do not
match the protocol specificationpublic void skipNode() throws IOException
IOException
- if an I/O error occurspublic String getURI(String prefix)
getURI
in interface DurboNamespaceResolver
prefix
- the namespace prefixpublic String getPrefix(String uri) throws NamespaceException
getPrefix
in interface DurboNamespaceResolver
uri
- the namespace uriNamespaceException
public String[] getPrefixes()
public String[] getURIs()
"Copyright © 2010 - 2017 Adobe Systems Incorporated. All Rights Reserved"