|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Drives a schema context for serialization and deserialization.
Nested Class Summary | |
static interface |
SchemaContext.State
This interface is used by serialization context to store information about the current position on the serialization stack. |
Method Summary | |
SchemaContext.State |
enterCurrentMember()
Enters the current serialization member (if it is structure or array). |
QName |
getCurrentConstructName()
Returns the name of the current member. |
Type |
getCurrentConstructSchemaType()
Returns the type of the current member. |
SchemaConstruct.ConstructType |
getCurrentConstructType()
Returns the type of the current construct. |
Member |
getCurrentMember()
Deprecated. Use one of getCurrentSchemaConstruct() ,
getCurrentConstructName() , getCurrentConstructType() . |
SchemaConstruct |
getCurrentSchemaConstruct()
Returns the current member. |
Type |
getOriginalType()
Returns the original type found in WSDL/XMLSchema. |
Schema |
getSchema()
Returns the schema set up in this context. |
boolean |
isCurrentConstructArray()
Returns true if the current construct is an array. |
void |
leave(SchemaContext.State state)
Leaves the current serialization member (a structure or an array). |
Member |
nextMember()
Deprecated. Use nextSchemaConstruct() instead. |
SchemaConstruct |
nextSchemaConstruct()
Moves to the next member. |
SchemaConstruct |
nextSchemaConstruct(java.lang.String namespaceURI,
java.lang.String localPart)
Moves to the next named member. |
SchemaContext.State |
putMember(Member member)
Deprecated. use putSchemaConstruct instead |
SchemaContext.State |
putSchemaConstruct(SchemaConstruct schemaConstruct)
Sets the schema construct (element, type, attribute) being serialized. |
void |
replaceTopMember(QName name,
Type type)
Manually replaces top member. |
Type |
replaceTopMemberType(Type newType)
Replaces the type of the top-level member, returning the old type. |
boolean |
typeOfCurrentConstructReplaced()
Returns true if current type was replaced. |
Method Detail |
public Schema getSchema()
public SchemaContext.State putMember(Member member)
This call might be used anytime, previous members are preserved. This call must be ended by call to a leave() function.
member
- the member that will be serialized using this context
public SchemaContext.State putSchemaConstruct(SchemaConstruct schemaConstruct)
This call might be used anytime, previous constructs are preserved. This call must be ended by call to a leave() function.
schemaConstruct
- the schemaConstruct that will be serialized using this context
public SchemaContext.State enterCurrentMember()
The first member of the structure (the only of the array) will be given as a result of 'nextMember' call. Returns an object that should be passed back into the leave method. After the call to this method, the context is before the first child of the member. So, if this method is used from serializer, this call is typically followed by nextSchemaConstruct. If used from deserialization, the call is followed by a call to SerializationHelper or nextSchemaConstruct(namespaceURI, localPart).
public void leave(SchemaContext.State state)
state
- the state which should be set up, obtained by a
call to the corresponding enterCurrentMember() operation.public Member getCurrentMember()
getCurrentSchemaConstruct()
,
getCurrentConstructName()
, getCurrentConstructType()
.
In case of no current member (for example, just after call to enterCurrentMember) the call returns null.
public SchemaConstruct getCurrentSchemaConstruct()
In case of no current member (for example, just after call to enterCurrentMember) the call returns null.
Note: use getCurrentConstructName(), getCurrentConstructType for faster accessing type or name.
public Type getCurrentConstructSchemaType()
public QName getCurrentConstructName()
public SchemaConstruct.ConstructType getCurrentConstructType()
See SchemaConstruct.ConstructType
for symbolic constants.
public boolean isCurrentConstructArray()
public Member nextMember()
nextSchemaConstruct()
instead.
If the member has been the last one, leaves the containing structure.
public SchemaConstruct nextSchemaConstruct()
If the member has been the last one, leaves the containing structure.
public SchemaConstruct nextSchemaConstruct(java.lang.String namespaceURI, java.lang.String localPart)
If there is no such member, returns null and leaves the containing structure.
namespaceURI
- the namespaceURI of the element to be moved to.localPart
- the localPart of the element to be moved to.
public void replaceTopMember(QName name, Type type)
name
- the name of the contexttype
- the type of the contextpublic Type replaceTopMemberType(Type newType)
newType
- the new type to be returned.
public boolean typeOfCurrentConstructReplaced()
public Type getOriginalType()
Due to, for example, polymorphism, the original type might differ to the type found in topMember. To output the type only when required, just compare (using ==) getOriginalType() with getCurrentConstructSchemaType()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |