本文整理匯總了Java中org.codehaus.jackson.map.JsonDeserializer.deserialize方法的典型用法代碼示例。如果您正苦於以下問題:Java JsonDeserializer.deserialize方法的具體用法?Java JsonDeserializer.deserialize怎麽用?Java JsonDeserializer.deserialize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.codehaus.jackson.map.JsonDeserializer
的用法示例。
在下文中一共展示了JsonDeserializer.deserialize方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: handlePolymorphic
import org.codehaus.jackson.map.JsonDeserializer; //導入方法依賴的package包/類
protected Object handlePolymorphic(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Object paramObject, TokenBuffer paramTokenBuffer)
throws IOException, JsonProcessingException
{
JsonDeserializer localJsonDeserializer = _findSubclassDeserializer(paramDeserializationContext, paramObject, paramTokenBuffer);
if (localJsonDeserializer != null)
{
if (paramTokenBuffer != null)
{
paramTokenBuffer.writeEndObject();
JsonParser localJsonParser = paramTokenBuffer.asParser();
localJsonParser.nextToken();
paramObject = localJsonDeserializer.deserialize(localJsonParser, paramDeserializationContext, paramObject);
}
if (paramJsonParser != null)
paramObject = localJsonDeserializer.deserialize(paramJsonParser, paramDeserializationContext, paramObject);
return paramObject;
}
if (paramTokenBuffer != null)
paramObject = handleUnknownProperties(paramDeserializationContext, paramObject, paramTokenBuffer);
if (paramJsonParser != null)
paramObject = deserialize(paramJsonParser, paramDeserializationContext, paramObject);
return paramObject;
}
示例2: handleNonArray
import org.codehaus.jackson.map.JsonDeserializer; //導入方法依賴的package包/類
private final Collection<Object> handleNonArray(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Collection<Object> paramCollection)
throws IOException, JsonProcessingException
{
if (!paramDeserializationContext.isEnabled(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY))
throw paramDeserializationContext.mappingException(this._collectionType.getRawClass());
JsonDeserializer localJsonDeserializer = this._valueDeserializer;
TypeDeserializer localTypeDeserializer = this._valueTypeDeserializer;
Object localObject;
if (paramJsonParser.getCurrentToken() == JsonToken.VALUE_NULL)
localObject = null;
while (true)
{
paramCollection.add(localObject);
return paramCollection;
if (localTypeDeserializer == null)
{
localObject = localJsonDeserializer.deserialize(paramJsonParser, paramDeserializationContext);
continue;
}
localObject = localJsonDeserializer.deserializeWithType(paramJsonParser, paramDeserializationContext, localTypeDeserializer);
}
}
示例3: deserializeUsingCustom
import org.codehaus.jackson.map.JsonDeserializer; //導入方法依賴的package包/類
private Collection<String> deserializeUsingCustom(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Collection<String> paramCollection)
throws IOException, JsonProcessingException
{
JsonDeserializer localJsonDeserializer = this._valueDeserializer;
JsonToken localJsonToken = paramJsonParser.nextToken();
if (localJsonToken != JsonToken.END_ARRAY)
{
if (localJsonToken == JsonToken.VALUE_NULL);
for (Object localObject = null; ; localObject = (String)localJsonDeserializer.deserialize(paramJsonParser, paramDeserializationContext))
{
paramCollection.add(localObject);
break;
}
}
return (Collection<String>)paramCollection;
}
示例4: handleNonArray
import org.codehaus.jackson.map.JsonDeserializer; //導入方法依賴的package包/類
private final Collection<String> handleNonArray(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Collection<String> paramCollection)
throws IOException, JsonProcessingException
{
if (!paramDeserializationContext.isEnabled(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY))
throw paramDeserializationContext.mappingException(this._collectionType.getRawClass());
JsonDeserializer localJsonDeserializer = this._valueDeserializer;
if (paramJsonParser.getCurrentToken() == JsonToken.VALUE_NULL)
{
localObject = null;
paramCollection.add(localObject);
return paramCollection;
}
if (localJsonDeserializer == null);
for (Object localObject = paramJsonParser.getText(); ; localObject = (String)localJsonDeserializer.deserialize(paramJsonParser, paramDeserializationContext))
break;
}
示例5: deserialize
import org.codehaus.jackson.map.JsonDeserializer; //導入方法依賴的package包/類
@Override
public List<Map<Term, String>> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {
if (jp.getCurrentToken() == JsonToken.START_ARRAY) {
JsonDeserializer<Object> deserializer =
ctxt.getDeserializerProvider().findTypedValueDeserializer(ctxt.getConfig(),
ctxt.constructType(List.class),null);
List<Map<String, String>> verbatimTerms = (List<Map<String, String>>) deserializer.deserialize(jp, ctxt);
List<Map<Term, String>> interpretedTerms = Lists.newArrayList();
for (Map<String, String> verbExtension : verbatimTerms) {
Map<Term, String> extension = new HashMap<Term, String>();
for (Entry<String, String> entry : verbExtension.entrySet()) {
Term term = termFactory.findTerm(entry.getKey());
if (term == null && ctxt.getConfig().isEnabled(Feature.FAIL_ON_UNKNOWN_PROPERTIES)) {
throw ctxt.mappingException("Term not found " + entry.getKey());
}
extension.put(term, entry.getValue());
}
interpretedTerms.add(extension);
}
return interpretedTerms;
}
throw ctxt.mappingException("Expected JSON String");
}
示例6: handlePolymorphic
import org.codehaus.jackson.map.JsonDeserializer; //導入方法依賴的package包/類
protected Object handlePolymorphic(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Object paramObject, TokenBuffer paramTokenBuffer)
{
JsonDeserializer localJsonDeserializer = _findSubclassDeserializer(paramDeserializationContext, paramObject, paramTokenBuffer);
JsonParser localJsonParser;
if (localJsonDeserializer != null)
{
if (paramTokenBuffer == null)
break label101;
paramTokenBuffer.writeEndObject();
localJsonParser = paramTokenBuffer.asParser();
localJsonParser.nextToken();
}
label101: for (Object localObject = localJsonDeserializer.deserialize(localJsonParser, paramDeserializationContext, paramObject); ; localObject = paramObject)
{
if (paramJsonParser != null)
localObject = localJsonDeserializer.deserialize(paramJsonParser, paramDeserializationContext, localObject);
while (true)
{
return localObject;
if (paramTokenBuffer != null);
for (localObject = handleUnknownProperties(paramDeserializationContext, paramObject, paramTokenBuffer); paramJsonParser != null; localObject = paramObject)
return deserialize(paramJsonParser, paramDeserializationContext, localObject);
}
}
}
示例7: handleNonArray
import org.codehaus.jackson.map.JsonDeserializer; //導入方法依賴的package包/類
private final Collection<String> handleNonArray(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Collection<String> paramCollection)
{
if (!paramDeserializationContext.isEnabled(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY))
throw paramDeserializationContext.mappingException(this._collectionType.getRawClass());
JsonDeserializer localJsonDeserializer = this._valueDeserializer;
Object localObject;
if (paramJsonParser.getCurrentToken() == JsonToken.VALUE_NULL)
localObject = null;
while (true)
{
paramCollection.add(localObject);
return paramCollection;
if (localJsonDeserializer == null)
localObject = paramJsonParser.getText();
else
localObject = (String)localJsonDeserializer.deserialize(paramJsonParser, paramDeserializationContext);
}
}
示例8: handleNonArray
import org.codehaus.jackson.map.JsonDeserializer; //導入方法依賴的package包/類
private final Collection<Object> handleNonArray(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Collection<Object> paramCollection)
{
if (!paramDeserializationContext.isEnabled(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY))
throw paramDeserializationContext.mappingException(this._collectionType.getRawClass());
JsonDeserializer localJsonDeserializer = this._valueDeserializer;
TypeDeserializer localTypeDeserializer = this._valueTypeDeserializer;
Object localObject;
if (paramJsonParser.getCurrentToken() == JsonToken.VALUE_NULL)
localObject = null;
while (true)
{
paramCollection.add(localObject);
return paramCollection;
if (localTypeDeserializer == null)
localObject = localJsonDeserializer.deserialize(paramJsonParser, paramDeserializationContext);
else
localObject = localJsonDeserializer.deserializeWithType(paramJsonParser, paramDeserializationContext, localTypeDeserializer);
}
}
示例9: _deserialize
import org.codehaus.jackson.map.JsonDeserializer; //導入方法依賴的package包/類
private final Object _deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
throws IOException, JsonProcessingException
{
if (paramJsonParser.getCurrentToken() != JsonToken.START_OBJECT)
throw paramDeserializationContext.wrongTokenException(paramJsonParser, JsonToken.START_OBJECT, "need JSON Object to contain As.WRAPPER_OBJECT type information for class " + baseTypeName());
if (paramJsonParser.nextToken() != JsonToken.FIELD_NAME)
throw paramDeserializationContext.wrongTokenException(paramJsonParser, JsonToken.FIELD_NAME, "need JSON String that contains type id (for subtype of " + baseTypeName() + ")");
JsonDeserializer localJsonDeserializer = _findDeserializer(paramDeserializationContext, paramJsonParser.getText());
paramJsonParser.nextToken();
Object localObject = localJsonDeserializer.deserialize(paramJsonParser, paramDeserializationContext);
if (paramJsonParser.nextToken() != JsonToken.END_OBJECT)
throw paramDeserializationContext.wrongTokenException(paramJsonParser, JsonToken.END_OBJECT, "expected closing END_OBJECT after type information and deserialized value");
return localObject;
}
示例10: deserialize
import org.codehaus.jackson.map.JsonDeserializer; //導入方法依賴的package包/類
public Collection<Object> deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Collection<Object> paramCollection)
throws IOException, JsonProcessingException
{
if (!paramJsonParser.isExpectedStartArrayToken())
paramCollection = handleNonArray(paramJsonParser, paramDeserializationContext, paramCollection);
JsonDeserializer localJsonDeserializer;
TypeDeserializer localTypeDeserializer;
JsonToken localJsonToken;
do
{
return paramCollection;
localJsonDeserializer = this._valueDeserializer;
localTypeDeserializer = this._valueTypeDeserializer;
localJsonToken = paramJsonParser.nextToken();
}
while (localJsonToken == JsonToken.END_ARRAY);
Object localObject;
if (localJsonToken == JsonToken.VALUE_NULL)
localObject = null;
while (true)
{
paramCollection.add(localObject);
break;
if (localTypeDeserializer == null)
{
localObject = localJsonDeserializer.deserialize(paramJsonParser, paramDeserializationContext);
continue;
}
localObject = localJsonDeserializer.deserializeWithType(paramJsonParser, paramDeserializationContext, localTypeDeserializer);
}
}
示例11: deserialize
import org.codehaus.jackson.map.JsonDeserializer; //導入方法依賴的package包/類
@Override
public Collection<Object> deserialize(JsonParser jp, DeserializationContext ctxt,
Collection<Object> result)
throws IOException, JsonProcessingException
{
// Ok: must point to START_ARRAY
if (jp.getCurrentToken() != JsonToken.START_ARRAY) {
throw ctxt.mappingException(_collectionClass);
}
JsonDeserializer<Object> valueDes = _valueDeserializer;
JsonToken t;
final TypeDeserializer typeDeser = _valueTypeDeserializer;
while ((t = jp.nextToken()) != JsonToken.END_ARRAY) {
Object value;
if (t == JsonToken.VALUE_NULL) {
value = null;
} else if (typeDeser == null) {
value = valueDes.deserialize(jp, ctxt);
} else {
value = valueDes.deserializeWithType(jp, ctxt, typeDeser);
}
result.add(value);
}
return result;
}
示例12: _deserializeTypedUsingDefaultImpl
import org.codehaus.jackson.map.JsonDeserializer; //導入方法依賴的package包/類
protected Object _deserializeTypedUsingDefaultImpl(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, TokenBuffer paramTokenBuffer)
{
if (this._defaultImpl != null)
{
JsonDeserializer localJsonDeserializer = _findDefaultImplDeserializer(paramDeserializationContext);
if (paramTokenBuffer != null)
{
paramTokenBuffer.writeEndObject();
paramJsonParser = paramTokenBuffer.asParser(paramJsonParser);
paramJsonParser.nextToken();
}
return localJsonDeserializer.deserialize(paramJsonParser, paramDeserializationContext);
}
throw paramDeserializationContext.wrongTokenException(paramJsonParser, JsonToken.FIELD_NAME, "missing property '" + this._typePropertyName + "' that is to contain type id (for class " + baseTypeName() + ")");
}
示例13: _deserialize
import org.codehaus.jackson.map.JsonDeserializer; //導入方法依賴的package包/類
private final Object _deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
{
if (paramJsonParser.getCurrentToken() != JsonToken.START_OBJECT)
throw paramDeserializationContext.wrongTokenException(paramJsonParser, JsonToken.START_OBJECT, "need JSON Object to contain As.WRAPPER_OBJECT type information for class " + baseTypeName());
if (paramJsonParser.nextToken() != JsonToken.FIELD_NAME)
throw paramDeserializationContext.wrongTokenException(paramJsonParser, JsonToken.FIELD_NAME, "need JSON String that contains type id (for subtype of " + baseTypeName() + ")");
JsonDeserializer localJsonDeserializer = _findDeserializer(paramDeserializationContext, paramJsonParser.getText());
paramJsonParser.nextToken();
Object localObject = localJsonDeserializer.deserialize(paramJsonParser, paramDeserializationContext);
if (paramJsonParser.nextToken() != JsonToken.END_OBJECT)
throw paramDeserializationContext.wrongTokenException(paramJsonParser, JsonToken.END_OBJECT, "expected closing END_OBJECT after type information and deserialized value");
return localObject;
}
示例14: deserializeUsingCustom
import org.codehaus.jackson.map.JsonDeserializer; //導入方法依賴的package包/類
private Collection<String> deserializeUsingCustom(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Collection<String> paramCollection)
{
JsonDeserializer localJsonDeserializer = this._valueDeserializer;
JsonToken localJsonToken = paramJsonParser.nextToken();
if (localJsonToken != JsonToken.END_ARRAY)
{
if (localJsonToken == JsonToken.VALUE_NULL);
for (Object localObject = null; ; localObject = (String)localJsonDeserializer.deserialize(paramJsonParser, paramDeserializationContext))
{
paramCollection.add(localObject);
break;
}
}
return paramCollection;
}
示例15: deserialize
import org.codehaus.jackson.map.JsonDeserializer; //導入方法依賴的package包/類
public Collection<Object> deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Collection<Object> paramCollection)
{
if (!paramJsonParser.isExpectedStartArrayToken())
paramCollection = handleNonArray(paramJsonParser, paramDeserializationContext, paramCollection);
JsonDeserializer localJsonDeserializer;
TypeDeserializer localTypeDeserializer;
JsonToken localJsonToken;
do
{
return paramCollection;
localJsonDeserializer = this._valueDeserializer;
localTypeDeserializer = this._valueTypeDeserializer;
localJsonToken = paramJsonParser.nextToken();
}
while (localJsonToken == JsonToken.END_ARRAY);
Object localObject;
if (localJsonToken == JsonToken.VALUE_NULL)
localObject = null;
while (true)
{
paramCollection.add(localObject);
break;
if (localTypeDeserializer == null)
localObject = localJsonDeserializer.deserialize(paramJsonParser, paramDeserializationContext);
else
localObject = localJsonDeserializer.deserializeWithType(paramJsonParser, paramDeserializationContext, localTypeDeserializer);
}
}