com.cedarsoft.serialization.stax
Class AbstractStaxBasedSerializer<T,C,S>
java.lang.Object
com.cedarsoft.serialization.AbstractSerializer<T,C,S,javax.xml.stream.XMLStreamReader,javax.xml.stream.XMLStreamException>
com.cedarsoft.serialization.stax.AbstractStaxBasedSerializer<T,C,S>
- Type Parameters:
T - the typeC - the type of the contextS - the object to serialize to
- All Implemented Interfaces:
- PluggableSerializer<T,C,S,javax.xml.stream.XMLStreamReader,javax.xml.stream.XMLStreamException>, Serializer<T,C>
- Direct Known Subclasses:
- AbstractStaxMateSerializer, AbstractStaxSerializer
public abstract class AbstractStaxBasedSerializer<T,C,S>
- extends AbstractSerializer<T,C,S,javax.xml.stream.XMLStreamReader,javax.xml.stream.XMLStreamException>
|
Method Summary |
protected void |
closeTag(javax.xml.stream.XMLStreamReader reader)
|
T |
deserialize(java.io.InputStream in,
C context)
Deserializes the object from the input stream |
protected void |
ensureTag(javax.xml.stream.XMLStreamReader deserializeFrom,
java.lang.String tagName)
|
protected java.lang.String |
getChildText(javax.xml.stream.XMLStreamReader reader,
java.lang.String tagName)
|
protected java.lang.String |
getProcessingInstructionData(javax.xml.stream.XMLStreamReader reader,
java.lang.String piTarget)
|
protected java.lang.String |
getText(javax.xml.stream.XMLStreamReader reader)
Returns the text and closes the tag |
protected void |
nextTag(javax.xml.stream.XMLStreamReader reader,
java.lang.String tagName)
|
protected void |
visitChildren(javax.xml.stream.XMLStreamReader streamReader,
AbstractStaxBasedSerializer.CB callback)
Attention! The current element will be closed! |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractStaxBasedSerializer
protected AbstractStaxBasedSerializer(@NotNull@NonNls
java.lang.String defaultElementName,
@NotNull
VersionRange formatVersionRange)
deserialize
@NotNull
public T deserialize(@NotNull
java.io.InputStream in,
@Nullable
C context)
throws java.io.IOException
- Description copied from interface:
Serializer
- Deserializes the object from the input stream
- Parameters:
in - the input streamcontext - the context (optional)
- Returns:
- the deserialized object
- Throws:
java.io.IOException
getProcessingInstructionData
@NotNull
@NonNls
protected java.lang.String getProcessingInstructionData(@NotNull
javax.xml.stream.XMLStreamReader reader,
@NotNull@NonNls
java.lang.String piTarget)
throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
ensureTag
protected void ensureTag(@NotNull
javax.xml.stream.XMLStreamReader deserializeFrom,
@NotNull@NonNls
java.lang.String tagName)
getText
@NotNull
protected java.lang.String getText(@NotNull
javax.xml.stream.XMLStreamReader reader)
throws javax.xml.stream.XMLStreamException
- Returns the text and closes the tag
- Parameters:
reader - the reader
- Returns:
- the text
- Throws:
javax.xml.stream.XMLStreamException
getChildText
@NotNull
protected java.lang.String getChildText(@NotNull
javax.xml.stream.XMLStreamReader reader,
@NotNull@NonNls
java.lang.String tagName)
throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
closeTag
protected void closeTag(@NotNull
javax.xml.stream.XMLStreamReader reader)
throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
nextTag
protected void nextTag(@NotNull
javax.xml.stream.XMLStreamReader reader,
@NotNull@NonNls
java.lang.String tagName)
throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
visitChildren
protected void visitChildren(@NotNull
javax.xml.stream.XMLStreamReader streamReader,
@NotNull
AbstractStaxBasedSerializer.CB callback)
throws javax.xml.stream.XMLStreamException,
java.io.IOException
- Attention! The current element will be closed!
- Parameters:
streamReader - the stream readercallback - the callback
- Throws:
javax.xml.stream.XMLStreamException
java.io.IOException
Copyright © 2009 cedarsoft GmbH. All Rights Reserved.