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 void
close()
Free resources associated with this writer.void
flush()
Writes all cached data.ModelWriter
writeBigDecimal(BigDecimal data)
Writes DMRnumber
.ModelWriter
writeBigInteger(BigInteger data)
Writes DMRnumber
.ModelWriter
writeBoolean(boolean data)
Writes DMRtrue
orfalse
token.ModelWriter
writeBytes(byte[] data)
Writes DMRbytes
.ModelWriter
writeDouble(double data)
Writes DMRnumber
.ModelWriter
writeExpression(String data)
Writes DMRexpression
.ModelWriter
writeInt(int data)
Writes DMRnumber
.ModelWriter
writeListEnd()
Writes DMRlist end
token.ModelWriter
writeListStart()
Writes DMRlist start
token.ModelWriter
writeLong(long data)
Writes DMRnumber
.ModelWriter
writeObjectEnd()
Writes DMRobject end
token.ModelWriter
writeObjectStart()
Writes DMRobject start
token.ModelWriter
writePropertyEnd()
Writes DMRproperty end
token.ModelWriter
writePropertyStart()
Writes DMRproperty start
token.ModelWriter
writeString(String data)
Writes DMRstring
.ModelWriter
writeType(ModelType data)
Writes DMRtype
.ModelWriter
writeUndefined()
Writes DMRundefined
token.
-
-
-
Method Detail
-
writeObjectStart
ModelWriter writeObjectStart() throws IOException, ModelException
Writes DMRobject start
token.- 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 end
token.- 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 start
token.- 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 end
token.- 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 start
token.- 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 end
token.- 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 DMRundefined
token.- 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 DMRtrue
orfalse
token.- 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 IOException
Writes all cached data.- Specified by:
flush
in interfaceFlushable
- Throws:
IOException
- if some I/O error occurs
-
close
void close() throws IOException, ModelException
Free resources associated with this writer. Never closes underlying input stream or writer.- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
- if some I/O error occursModelException
- if invalid DMR write attempt is detected
-
-