public interface ModelReader extends Closeable
ModelStreamFactory
Modifier and Type | Method and Description |
---|---|
void |
close()
Free resources associated with this reader.
|
boolean |
getBoolean()
Converts available context data to
boolean . |
byte[] |
getBytes()
Converts available context data to
bytes . |
String |
getExpression()
Converts available context data to
expression . |
Number |
getNumber()
Converts available context data to
Number instance. |
String |
getString()
Converts available context data to
String . |
ModelType |
getType()
Converts available context data to
model type . |
boolean |
hasNext()
Detects if there is next DMR parsing event available.
|
boolean |
isBoolean()
Returns
true if current DMR parsing event is DMR boolean token, false otherwise. |
boolean |
isBytes()
Returns
true if current DMR parsing event is DMR bytes , false otherwise. |
boolean |
isExpression()
Returns
true if current DMR parsing event is DMR expression , false otherwise. |
boolean |
isListEnd()
Returns
true if current DMR parsing event is DMR list end token, false otherwise. |
boolean |
isListStart()
Returns
true if current DMR parsing event is DMR list start token, false otherwise. |
boolean |
isNumber()
Returns
true if current DMR parsing event is DMR number , false otherwise. |
boolean |
isObjectEnd()
Returns
true if current DMR parsing event is DMR object end token, false otherwise. |
boolean |
isObjectStart()
Returns
true if current DMR parsing event is DMR object start token, false otherwise. |
boolean |
isPropertyEnd()
Returns
true if current DMR parsing event is DMR property end token, false otherwise. |
boolean |
isPropertyStart()
Returns
true if current DMR parsing event is DMR property start token, false otherwise. |
boolean |
isString()
Returns
true if current DMR parsing event is DMR string , false otherwise. |
boolean |
isType()
Returns
true if current DMR parsing event is DMR type , false otherwise. |
boolean |
isUndefined()
Returns
true if current DMR parsing event is DMR undefined token, false otherwise. |
ModelEvent |
next()
Returns next DMR parsing event.
|
boolean hasNext()
next()
method.ModelEvent next() throws IOException, ModelException
hasNext()
before calling this method.IOException
- if some I/O error occursModelException
- if wrong DMR is detectedboolean isObjectStart()
true
if current DMR parsing event is DMR object start
token, false otherwise.
Users have to call next()
before calling this method.boolean isObjectEnd()
true
if current DMR parsing event is DMR object end
token, false otherwise.
Users have to call next()
before calling this method.boolean isPropertyStart()
true
if current DMR parsing event is DMR property start
token, false otherwise.
Users have to call next()
before calling this method.boolean isPropertyEnd()
true
if current DMR parsing event is DMR property end
token, false otherwise.
Users have to call next()
before calling this method.boolean isListStart()
true
if current DMR parsing event is DMR list start
token, false otherwise.
Users have to call next()
before calling this method.boolean isListEnd()
true
if current DMR parsing event is DMR list end
token, false otherwise.
Users have to call next()
before calling this method.boolean isUndefined()
true
if current DMR parsing event is DMR undefined
token, false otherwise.
Users have to call next()
before calling this method.boolean isType()
true
if current DMR parsing event is DMR type
, false otherwise.
Users have to call next()
before calling this method.ModelType getType()
model type
.
Users have to call next()
and should call isType()
before calling this method.IllegalStateException
- if cursor isn't pointing to DMR typeboolean isString()
true
if current DMR parsing event is DMR string
, false otherwise.
Users have to call next()
before calling this method.String getString()
String
.
Users have to call next()
and should call isString()
before calling this method.IllegalStateException
- if cursor isn't pointing to DMR Stringboolean isExpression()
true
if current DMR parsing event is DMR expression
, false otherwise.
Users have to call next()
before calling this method.String getExpression()
expression
.
Users have to call next()
and should call isExpression()
before calling this method.IllegalStateException
- if cursor isn't pointing to DMR expressionboolean isBytes()
true
if current DMR parsing event is DMR bytes
, false otherwise.
Users have to call next()
before calling this method.byte[] getBytes()
bytes
.
Users have to call next()
and should call isBytes()
before calling this method.IllegalStateException
- if cursor isn't pointing to DMR Bytesboolean isBoolean()
true
if current DMR parsing event is DMR boolean
token, false otherwise.
Users have to call next()
before calling this method.boolean getBoolean()
boolean
.
Users have to call next()
and should call isBoolean()
before calling this method.IllegalStateException
- if cursor isn't pointing to DMR boolean tokenboolean isNumber()
true
if current DMR parsing event is DMR number
, false otherwise.
Users have to call next()
before calling this method.Number getNumber()
Number
instance.
Users have to call next()
and should call isNumber()
before calling this method.NumberFormatException
- if DMR number is not convertible to number
void close() throws ModelException
close
in interface AutoCloseable
close
in interface Closeable
ModelException
- if attempting to close this reader before reaching EOF.Copyright © 2016 JBoss, a division of Red Hat, Inc.