Package org.jboss.dmr.stream
Interface ModelWriter
-
- All Superinterfaces:
AutoCloseable,Flushable
public interface ModelWriter extends Flushable, AutoCloseable
DMR writer. Instances of this interface are not thread safe.- Author:
- Richard Opalka
- See Also:
ModelStreamFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Free resources associated with this writer.voidflush()Writes all cached data.ModelWriterwriteBigDecimal(BigDecimal data)Writes DMRnumber.ModelWriterwriteBigInteger(BigInteger data)Writes DMRnumber.ModelWriterwriteBoolean(boolean data)Writes DMRtrueorfalsetoken.ModelWriterwriteBytes(byte[] data)Writes DMRbytes.ModelWriterwriteDouble(double data)Writes DMRnumber.ModelWriterwriteExpression(String data)Writes DMRexpression.ModelWriterwriteInt(int data)Writes DMRnumber.ModelWriterwriteListEnd()Writes DMRlist endtoken.ModelWriterwriteListStart()Writes DMRlist starttoken.ModelWriterwriteLong(long data)Writes DMRnumber.ModelWriterwriteObjectEnd()Writes DMRobject endtoken.ModelWriterwriteObjectStart()Writes DMRobject starttoken.ModelWriterwritePropertyEnd()Writes DMRproperty endtoken.ModelWriterwritePropertyStart()Writes DMRproperty starttoken.ModelWriterwriteString(String data)Writes DMRstring.ModelWriterwriteType(ModelType data)Writes DMRtype.ModelWriterwriteUndefined()Writes DMRundefinedtoken.
-
-
-
Method Detail
-
writeObjectStart
ModelWriter writeObjectStart() throws IOException, ModelException
Writes DMRobject starttoken.- Returns:
- this writer instance
- Throws:
IOException- if some I/O error occursModelException- if invalid DMR write attempt is detected
-
writeObjectEnd
ModelWriter writeObjectEnd() throws IOException, ModelException
Writes DMRobject endtoken.- Returns:
- this writer instance
- Throws:
IOException- if some I/O error occursModelException- if invalid DMR write attempt is detected
-
writePropertyStart
ModelWriter writePropertyStart() throws IOException, ModelException
Writes DMRproperty starttoken.- Returns:
- this writer instance
- Throws:
IOException- if some I/O error occursModelException- if invalid DMR write attempt is detected
-
writePropertyEnd
ModelWriter writePropertyEnd() throws IOException, ModelException
Writes DMRproperty endtoken.- Returns:
- this writer instance
- Throws:
IOException- if some I/O error occursModelException- if invalid DMR write attempt is detected
-
writeListStart
ModelWriter writeListStart() throws IOException, ModelException
Writes DMRlist starttoken.- Returns:
- this writer instance
- Throws:
IOException- if some I/O error occursModelException- if invalid DMR write attempt is detected
-
writeListEnd
ModelWriter writeListEnd() throws IOException, ModelException
Writes DMRlist endtoken.- Returns:
- this writer instance
- Throws:
IOException- if some I/O error occursModelException- if invalid DMR write attempt is detected
-
writeUndefined
ModelWriter writeUndefined() throws IOException, ModelException
Writes DMRundefinedtoken.- Returns:
- this writer instance
- Throws:
IOException- if some I/O error occursModelException- if invalid DMR write attempt is detected
-
writeString
ModelWriter writeString(String data) throws IOException, ModelException
Writes DMRstring.- Parameters:
data- to encode- Returns:
- this writer instance
- Throws:
IOException- if some I/O error occursModelException- if invalid DMR write attempt is detected
-
writeExpression
ModelWriter writeExpression(String data) throws IOException, ModelException
Writes DMRexpression.- Parameters:
data- to encode- Returns:
- this writer instance
- Throws:
IOException- if some I/O error occursModelException- if invalid DMR write attempt is detected
-
writeBytes
ModelWriter writeBytes(byte[] data) throws IOException, ModelException
Writes DMRbytes.- Parameters:
data- to encode- Returns:
- this writer instance
- Throws:
IOException- if some I/O error occursModelException- if invalid DMR write attempt is detected
-
writeBoolean
ModelWriter writeBoolean(boolean data) throws IOException, ModelException
Writes DMRtrueorfalsetoken.- Parameters:
data- to encode- Returns:
- this writer instance
- Throws:
IOException- if some I/O error occursModelException- if invalid DMR write attempt is detected
-
writeInt
ModelWriter writeInt(int data) throws IOException, ModelException
Writes DMRnumber.- Parameters:
data- to encode- Returns:
- this writer instance
- Throws:
IOException- if some I/O error occursModelException- if invalid DMR write attempt is detected
-
writeLong
ModelWriter writeLong(long data) throws IOException, ModelException
Writes DMRnumber.- Parameters:
data- to encode- Returns:
- this writer instance
- Throws:
IOException- if some I/O error occursModelException- if invalid DMR write attempt is detected
-
writeBigInteger
ModelWriter writeBigInteger(BigInteger data) throws IOException, ModelException
Writes DMRnumber.- Parameters:
data- to encode- Returns:
- this writer instance
- Throws:
IOException- if some I/O error occursModelException- if invalid DMR write attempt is detected
-
writeBigDecimal
ModelWriter writeBigDecimal(BigDecimal data) throws IOException, ModelException
Writes DMRnumber.- Parameters:
data- to encode- Returns:
- this writer instance
- Throws:
IOException- if some I/O error occursModelException- if invalid DMR write attempt is detected
-
writeDouble
ModelWriter writeDouble(double data) throws IOException, ModelException
Writes DMRnumber.- Parameters:
data- to encode- Returns:
- this writer instance
- Throws:
IOException- if some I/O error occursModelException- if invalid DMR write attempt is detected
-
writeType
ModelWriter writeType(ModelType data) throws IOException, ModelException
Writes DMRtype.- Parameters:
data- to encode- Returns:
- this writer instance
- Throws:
IOException- if some I/O error occursModelException- if invalid DMR write attempt is detected
-
flush
void flush() throws IOExceptionWrites all cached data.- Specified by:
flushin interfaceFlushable- Throws:
IOException- if some I/O error occurs
-
close
void close() throws IOException, ModelExceptionFree resources associated with this writer. Never closes underlying input stream or writer.- Specified by:
closein interfaceAutoCloseable- Throws:
IOException- if some I/O error occursModelException- if invalid DMR write attempt is detected
-
-