com.day.durbo
Class DurboInput

java.lang.Object
  extended by com.day.durbo.DurboInput
All Implemented Interfaces:
DurboConstants, DurboNamespaceResolver

public class DurboInput
extends Object
implements DurboConstants, DurboNamespaceResolver

The DurboInput class implements a reader on a inputstream that contains durbo-serialized data. DurboOutput for a more detailed description of this protocol.


Nested Class Summary
 class DurboInput.Element
          Inner class that represents one element of the Durbo protocol
 class DurboInput.Node
           
 class DurboInput.Property
           
 
Field Summary
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
 
Fields inherited from interface com.day.durbo.DurboConstants
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 Summary
DurboInput(File file)
          Creates a new DurboInput on the specified file.
DurboInput(InputStream inputStream)
          Creates a new DurboInput on the specified input stream.
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_TYPE_UNDEFINED

public static final int PROPERTY_TYPE_UNDEFINED
Deprecated. Use PropertyType.UNDEFINED instead
the 'undefined' property type.

See Also:
Constant Field Values

PROPERTY_TYPE_STRING

public static final int PROPERTY_TYPE_STRING
Deprecated. Use PropertyType.STRING instead
the 'string' property type.

See Also:
Constant Field Values

PROPERTY_TYPE_BINARY

public static final int PROPERTY_TYPE_BINARY
Deprecated. Use PropertyType.BINARY instead
the 'binary' property type.

See Also:
Constant Field Values

PROPERTY_TYPE_LONG

public static final int PROPERTY_TYPE_LONG
Deprecated. Use PropertyType.LONG instead
the 'long' property type.

See Also:
Constant Field Values

PROPERTY_TYPE_DOUBLE

public static final int PROPERTY_TYPE_DOUBLE
Deprecated. Use PropertyType.DOUBLE instead
the 'double' property type.

See Also:
Constant Field Values

PROPERTY_TYPE_DATE

public static final int PROPERTY_TYPE_DATE
Deprecated. Use PropertyType.DATE instead
the 'date' property type.

See Also:
Constant Field Values

PROPERTY_TYPE_BOOLEAN

public static final int PROPERTY_TYPE_BOOLEAN
Deprecated. Use PropertyType.BOOLEAN instead
the 'boolean' property type.

See Also:
Constant Field Values

PROPERTY_TYPE_NAME

public static final int PROPERTY_TYPE_NAME
Deprecated. Use PropertyType.NAME instead
the 'name' property type.

See Also:
Constant Field Values

PROPERTY_TYPE_PATH

public static final int PROPERTY_TYPE_PATH
Deprecated. Use PropertyType.PATH instead
the 'path' property type.

See Also:
Constant Field Values

PROPERTY_TYPE_REFERENCE

public static final int PROPERTY_TYPE_REFERENCE
Deprecated. Use PropertyType.REFERENCE instead
the 'reference' property type.

See Also:
Constant Field Values
Constructor Detail

DurboInput

public DurboInput(File file)
           throws IOException
Creates a new 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.

Parameters:
file - underlying file
Throws:
IOException - if an I/O error occurs

DurboInput

public DurboInput(InputStream inputStream)
           throws IOException
Creates a new DurboInput on the specified input stream. This also reads the header to check if the underlying stream is of the correct format.

Parameters:
inputStream - the input stream
Throws:
IOException - if an I/O error occurrs
Method Detail

getEncoding

public String getEncoding()

getContentType

public String getContentType()

getVersion

public double getVersion()
Returns the version

Returns:
the version

read

public DurboInput.Element read()
                        throws IOException
Reads an element from this input

Returns:
an durbo element or null if a end of the input
Throws:
IOException - if an I/O error occurs or if the data do not match the protocol specification

skipNode

public void skipNode()
              throws IOException
skips a node

Throws:
IOException - if an I/O error occurs

getURI

public String getURI(String prefix)
Returns the namespace uri for the given namespace

Specified by:
getURI in interface DurboNamespaceResolver
Parameters:
prefix - the namespace prefix
Returns:
the namespace uri

getPrefix

public String getPrefix(String uri)
                 throws NamespaceException
returns the namespace prefix for the given uri

Specified by:
getPrefix in interface DurboNamespaceResolver
Parameters:
uri - the namespace uri
Returns:
the namespace prefix
Throws:
NamespaceException

getPrefixes

public String[] getPrefixes()

getURIs

public String[] getURIs()


Copyright © 2011-2013 Adobe Systems Incorporated. All Rights Reserved.