Package aQute.lib.json
Class Decoder
- java.lang.Object
-
- aQute.lib.json.Decoder
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class Decoder extends java.lang.Object implements java.io.Closeable
-
-
Field Summary
Fields Modifier and Type Field Description (package private) JSONCodeccodec(package private) intcurrent(package private) java.security.MessageDigestdigest(package private) java.nio.charset.Charsetencoding(package private) java.util.Map<java.lang.String,java.lang.Object>extra(package private) booleaninflate(package private) booleankeepOpen(package private) java.io.Readerreader(package private) booleanstrict
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Decodercharset(java.lang.String encoding)Decodercharset(java.nio.charset.Charset encoding)voidclose()(package private) intcurrent()byte[]digest()(package private) voidexpect(java.lang.String s)Decoderfaq(java.lang.String in)Decoderfrom(byte[] data)Decoderfrom(java.io.File file)Decoderfrom(java.io.InputStream in)Decoderfrom(java.io.Reader in)Decoderfrom(java.lang.String in)java.lang.Objectget()<T> Tget(TypeReference<T> ref)<T> Tget(java.lang.Class<T> clazz)java.lang.Objectget(java.lang.reflect.Type type)java.util.Map<java.lang.String,java.lang.Object>getExtra()Decoderinflate()booleanisEof()DecoderkeepOpen()Decodermark()(package private) intnext()Skip any whitespace.(package private) intread()(package private) intskipWs()Skip any whitespace.Decoderstrict()
-
-
-
Field Detail
-
codec
final JSONCodec codec
-
reader
java.io.Reader reader
-
current
int current
-
digest
java.security.MessageDigest digest
-
extra
java.util.Map<java.lang.String,java.lang.Object> extra
-
encoding
java.nio.charset.Charset encoding
-
strict
boolean strict
-
inflate
boolean inflate
-
keepOpen
boolean keepOpen
-
-
Constructor Detail
-
Decoder
Decoder(JSONCodec codec)
-
-
Method Detail
-
from
public Decoder from(java.io.File file) throws java.lang.Exception
- Throws:
java.lang.Exception
-
from
public Decoder from(java.io.InputStream in) throws java.lang.Exception
- Throws:
java.lang.Exception
-
from
public Decoder from(byte[] data) throws java.lang.Exception
- Throws:
java.lang.Exception
-
charset
public Decoder charset(java.lang.String encoding)
-
charset
public Decoder charset(java.nio.charset.Charset encoding)
-
strict
public Decoder strict()
-
from
public Decoder from(java.io.Reader in) throws java.lang.Exception
- Throws:
java.lang.Exception
-
faq
public Decoder faq(java.lang.String in) throws java.lang.Exception
- Throws:
java.lang.Exception
-
from
public Decoder from(java.lang.String in) throws java.lang.Exception
- Throws:
java.lang.Exception
-
mark
public Decoder mark() throws java.security.NoSuchAlgorithmException
- Throws:
java.security.NoSuchAlgorithmException
-
digest
public byte[] digest()
-
get
public <T> T get(java.lang.Class<T> clazz) throws java.lang.Exception- Throws:
java.lang.Exception
-
get
public java.lang.Object get(java.lang.reflect.Type type) throws java.lang.Exception- Throws:
java.lang.Exception
-
get
public java.lang.Object get() throws java.lang.Exception- Throws:
java.lang.Exception
-
get
public <T> T get(TypeReference<T> ref) throws java.lang.Exception
- Throws:
java.lang.Exception
-
keepOpen
public Decoder keepOpen()
-
read
int read() throws java.lang.Exception
- Throws:
java.lang.Exception
-
current
int current()
-
skipWs
int skipWs() throws java.lang.ExceptionSkip any whitespace.- Throws:
java.lang.Exception
-
next
int next() throws java.lang.Exception
Skip any whitespace.- Throws:
java.lang.Exception
-
expect
void expect(java.lang.String s) throws java.lang.Exception- Throws:
java.lang.Exception
-
isEof
public boolean isEof() throws java.lang.Exception- Throws:
java.lang.Exception
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
getExtra
public java.util.Map<java.lang.String,java.lang.Object> getExtra()
-
inflate
public Decoder inflate()
-
-