org.deegree.services.wps.input
Class ComplexInputImpl

java.lang.Object
  extended by org.deegree.services.wps.input.ProcessletInputImpl
      extended by org.deegree.services.wps.input.ComplexInputImpl
All Implemented Interfaces:
ComplexInput, ProcessletInput
Direct Known Subclasses:
EmbeddedComplexInput, ReferencedComplexInput

public abstract class ComplexInputImpl
extends ProcessletInputImpl
implements ComplexInput

A complex data structure ProcessletInput parameter, e.g. an object encoded in GML or a raw binary stream.

Version:
$Revision: $, $Date: $
Author:
Markus Schneider, last edited by: $Author: schneider $

Field Summary
 
Fields inherited from class org.deegree.services.wps.input.ProcessletInputImpl
definition
 
Constructor Summary
protected ComplexInputImpl(ComplexInputDefinition definition, org.deegree.commons.tom.ows.LanguageString title, org.deegree.commons.tom.ows.LanguageString summary, ComplexFormatType format)
          Creates a new ComplexInputImpl instance.
 
Method Summary
 java.lang.String getEncoding()
          Returns the encoding information supplied with the input.
 java.lang.String getMimeType()
          Returns the mime type of the input.
 java.lang.String getSchema()
          Returns the schema URL supplied with the input.
abstract  java.io.InputStream getValueAsBinaryStream()
          Returns an InputStream for accessing the complex value as a raw stream of bytes (usually for binary input).
abstract  org.apache.axiom.om.OMElement getValueAsElement()
          Returns an OMElement for accessing the complex value as an XML element node.
abstract  javax.xml.stream.XMLStreamReader getValueAsXMLStream()
          Returns an XMLStreamReader for accessing the complex value as an XML event stream.
 
Methods inherited from class org.deegree.services.wps.input.ProcessletInputImpl
getAbstract, getDefinition, getIdentifier, getTitle, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deegree.services.wps.input.ProcessletInput
getAbstract, getIdentifier, getTitle
 

Constructor Detail

ComplexInputImpl

protected ComplexInputImpl(ComplexInputDefinition definition,
                           org.deegree.commons.tom.ows.LanguageString title,
                           org.deegree.commons.tom.ows.LanguageString summary,
                           ComplexFormatType format)
Creates a new ComplexInputImpl instance.

Parameters:
definition - corresponding input definition from process description
title - optional title supplied with the input parameter, may be null
summary - optional narrative description supplied with the input parameter, may be null
format - the XML schema, format, and encoding of the complex value (must be compatible with the parameter definition)
Method Detail

getMimeType

public java.lang.String getMimeType()
Returns the mime type of the input.

Specified by:
getMimeType in interface ComplexInput
Returns:
the mime type of the input, may be null (if not specified in the parameter definition)

getEncoding

public java.lang.String getEncoding()
Returns the encoding information supplied with the input.

Specified by:
getEncoding in interface ComplexInput
Returns:
the encoding information supplied with the input, may be null

getSchema

public java.lang.String getSchema()
Returns the schema URL supplied with the input.

Specified by:
getSchema in interface ComplexInput
Returns:
the schema URL supplied with the input, may be null

getValueAsBinaryStream

public abstract java.io.InputStream getValueAsBinaryStream()
                                                    throws java.io.IOException
Returns an InputStream for accessing the complex value as a raw stream of bytes (usually for binary input).

NOTE: Never use this method if the input parameter is encoded in XML -- use getValueAsXMLStream() or getValueAsElement() instead. Otherwise erroneous behaviour has to be expected (if the input value is given embedded in the execute request document).

Specified by:
getValueAsBinaryStream in interface ComplexInput
Returns:
the input value as a raw stream of bytes
Throws:
java.io.IOException - if accessing the value fails
See Also:
getValueAsXMLStream(), getValueAsElement()

getValueAsXMLStream

public abstract javax.xml.stream.XMLStreamReader getValueAsXMLStream()
                                                              throws java.io.IOException,
                                                                     javax.xml.stream.XMLStreamException
Description copied from interface: ComplexInput
Returns an XMLStreamReader for accessing the complex value as an XML event stream.

NOTE: Never use this method if the input parameter is a binary value -- use ComplexInput.getValueAsBinaryStream() instead.

The returned stream will point at the first START_ELEMENT event of the data.

Specified by:
getValueAsXMLStream in interface ComplexInput
Returns:
the input value as an XML event stream, current event is START_ELEMENT (the root element of the data object)
Throws:
java.io.IOException - if accessing the value fails
javax.xml.stream.XMLStreamException

getValueAsElement

public abstract org.apache.axiom.om.OMElement getValueAsElement()
                                                         throws java.io.IOException
Returns an OMElement for accessing the complex value as an XML element node.

NOTE: Never use this method if the input parameter is a binary value -- use getValueAsBinaryStream() instead.

Returns:
the input value as an XML element node
Throws:
java.io.IOException - if accessing the value fails


Copyright © 2011. All Rights Reserved.