org.idoox.xmlrpc.header
Class Header

java.lang.Object
  extended byorg.idoox.xmlrpc.header.Header

public class Header
extends java.lang.Object

Class represents header given header processor produces or consumes.

Header shoud be described either by Java class which is mapped to schema or by schema.

Example how to specify header using java class

 HeaderProcessors hp = ...;

 Header header = new Header(new QName("http://test.com", "myHeader"),
                          MyHeader.class, Header.DIRECTION_IN);

 hp.insert(myHeaderProcessor, HeaderProcessors.DIRECTION_IN, false,
                          new Header [] { header }, null);
 

Example how to specify header using java XML Schema

 HeaderProcessors hp = ...;

 Header header = new Header(new QName("http://test.com", "myHeader"),
                          Header.DIRECTION_IN);

 Schema schema = new Schema("resource:/myHeader.xsd", "http://test.com");

 hp.insert(myHeaderProcessor, HeaderProcessors.DIRECTION_IN, false,
                          new Header [] { header }, new Schema [] { schema });
 

Since:
4.5
See Also:
Schema, HeaderProcessors
Component:
Core

Field Summary
static int DIRECTION_IN
          Marks given header as to be consumed by header processor.
static int DIRECTION_INOUT
          Marks given header as to be consumed and produced by header processor.
static int DIRECTION_NONE
           
static int DIRECTION_OUT
          Marks given header as to be produced by header processor.
 
Constructor Summary
Header()
          Construct an empty Header.
Header(QName name, java.lang.Class clazz, int direction)
           Construct Header using it's QName> Java class and direction.
Header(QName name, int direction)
           Construct Header using it's QName and direction.
Header(QName name, QName type, java.lang.Class clazz, int direction)
           Construct Header using it's QName name, QName type, java class and direction.
 
Method Summary
 java.lang.Class getClazz()
          Gets name of class which will be used for header's XML schema generation.
 int getDirection()
          Gets direction os this header.
 QName getName()
          Gets QName of header.
 QName getType()
          Retrives QName of XML schema type used in encoded use.
 void setClazz(java.lang.Class clazz)
          Sets name of class which will be used for header's XML schema generation.
 void setDirection(int direction)
          Sets direction os this header.
 void setName(QName name)
          Sets QName of header.
 void setType(QName type)
          Sets XML schma type QName used in encoded use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIRECTION_IN

public static final int DIRECTION_IN
Marks given header as to be consumed by header processor.

See Also:
Constant Field Values

DIRECTION_OUT

public static final int DIRECTION_OUT
Marks given header as to be produced by header processor.

See Also:
Constant Field Values

DIRECTION_INOUT

public static final int DIRECTION_INOUT
Marks given header as to be consumed and produced by header processor.

See Also:
Constant Field Values

DIRECTION_NONE

public static final int DIRECTION_NONE
See Also:
Constant Field Values
Constructor Detail

Header

public Header()
Construct an empty Header.


Header

public Header(QName name,
              int direction)

Construct Header using it's QName and direction. This constructor is the most usefull when you specify header using schema.

Parameters:
name - QName of header
direction - one of DIRECTION_IN, DIRECTION_OUT, DIRECTION_INOUT

Header

public Header(QName name,
              java.lang.Class clazz,
              int direction)

Construct Header using it's QName> Java class and direction. This constructor is the most usefull when you specify header using Java class.

Parameters:
name - QName of header
clazz - class which will be used for header's XML schema generation
direction - one of DIRECTION_IN, DIRECTION_OUT, DIRECTION_INOUT

Header

public Header(QName name,
              QName type,
              java.lang.Class clazz,
              int direction)

Construct Header using it's QName name, QName type, java class and direction.

In WASP, literal use is default use. For this use you need specify QName of header element name. But if you nead encoded use, insted name specify type QName and leave name null. You can specify both names to allow use of the header in both uses.

Parameters:
name - QName of header name
type - QName of header type
clazz - class which will be used for header's XML schema generation
direction - one of DIRECTION_IN, DIRECTION_OUT, DIRECTION_INOUT
Method Detail

getName

public QName getName()
Gets QName of header.

Returns:
QName of header

setName

public void setName(QName name)
Sets QName of header.

Parameters:
name - QName of header

getClazz

public java.lang.Class getClazz()
Gets name of class which will be used for header's XML schema generation.

Returns:
header class

setClazz

public void setClazz(java.lang.Class clazz)
Sets name of class which will be used for header's XML schema generation.

Parameters:
clazz - header class

getDirection

public int getDirection()
Gets direction os this header. It shoud be DIRECTION_IN, DIRECTION_OUT or DIRECTION_INOUT.

Returns:
header direction

setDirection

public void setDirection(int direction)
Sets direction os this header. It shoud be DIRECTION_IN, DIRECTION_OUT or DIRECTION_INOUT.

Parameters:
direction - header direction

getType

public QName getType()
Retrives QName of XML schema type used in encoded use.

Returns:
XML schmea type QName

setType

public void setType(QName type)
Sets XML schma type QName used in encoded use.

Parameters:
type - XML schmea type QName