com.fasterxml.jackson.jr.ob.impl
Class EnumReader

java.lang.Object
  extended by com.fasterxml.jackson.jr.ob.impl.ValueReader
      extended by com.fasterxml.jackson.jr.ob.impl.EnumReader

public class EnumReader
extends ValueReader

Reader for Enum values: needed because we need a simple Map for efficient conversion from id (gotten with Enum.toString() to value.

In future we could consider alternatively allowing use of Enum.name() for id.


Field Summary
protected  Object[] _byIndex
           
protected  Map<String,Object> _byName
           
 
Constructor Summary
EnumReader(Object[] byIndex, Map<String,Object> byName)
           
 
Method Summary
 Object read(JSONReader reader, JsonParser p)
           
 Object readNext(JSONReader reader, JsonParser p)
           
 
Methods inherited from class com.fasterxml.jackson.jr.ob.impl.ValueReader
_tokenDesc, _tokenDesc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_byIndex

protected final Object[] _byIndex

_byName

protected final Map<String,Object> _byName
Constructor Detail

EnumReader

public EnumReader(Object[] byIndex,
                  Map<String,Object> byName)
Method Detail

readNext

public Object readNext(JSONReader reader,
                       JsonParser p)
                throws IOException
Specified by:
readNext in class ValueReader
Throws:
IOException

read

public Object read(JSONReader reader,
                   JsonParser p)
            throws IOException
Specified by:
read in class ValueReader
Throws:
IOException


Copyright © 2016 FasterXML. All rights reserved.