本文整理匯總了Java中org.codehaus.jackson.map.DeserializationContext.instantiationException方法的典型用法代碼示例。如果您正苦於以下問題:Java DeserializationContext.instantiationException方法的具體用法?Java DeserializationContext.instantiationException怎麽用?Java DeserializationContext.instantiationException使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.codehaus.jackson.map.DeserializationContext
的用法示例。
在下文中一共展示了DeserializationContext.instantiationException方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: deserialize
import org.codehaus.jackson.map.DeserializationContext; //導入方法依賴的package包/類
public Map<Object, Object> deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
throws IOException, JsonProcessingException
{
JsonToken localJsonToken = paramJsonParser.getCurrentToken();
if ((localJsonToken != JsonToken.START_OBJECT) && (localJsonToken != JsonToken.FIELD_NAME) && (localJsonToken != JsonToken.END_OBJECT))
throw paramDeserializationContext.mappingException(getMapClass());
if (this._propertyBasedCreator != null)
return _deserializeUsingCreator(paramJsonParser, paramDeserializationContext);
if (this._defaultCtor == null)
throw paramDeserializationContext.instantiationException(getMapClass(), "No default constructor found");
try
{
Map localMap = (Map)this._defaultCtor.newInstance(new Object[0]);
_readAndBind(paramJsonParser, paramDeserializationContext, localMap);
return localMap;
}
catch (Exception localException)
{
}
throw paramDeserializationContext.instantiationException(getMapClass(), localException);
}
示例2: deserialize
import org.codehaus.jackson.map.DeserializationContext; //導入方法依賴的package包/類
public Calendar deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
throws IOException, JsonProcessingException
{
java.util.Date localDate = _parseDate(paramJsonParser, paramDeserializationContext);
if (localDate == null)
return null;
if (this._calendarClass == null)
return paramDeserializationContext.constructCalendar(localDate);
try
{
Calendar localCalendar = (Calendar)this._calendarClass.newInstance();
localCalendar.setTimeInMillis(localDate.getTime());
return localCalendar;
}
catch (Exception localException)
{
}
throw paramDeserializationContext.instantiationException(this._calendarClass, localException);
}
示例3: deserializeFromString
import org.codehaus.jackson.map.DeserializationContext; //導入方法依賴的package包/類
public Object deserializeFromString(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
throws IOException, JsonProcessingException
{
if (this._stringCreator != null)
return this._stringCreator.construct(paramJsonParser.getText());
if (this._delegatingCreator != null)
return this._delegatingCreator.deserialize(paramJsonParser, paramDeserializationContext);
if ((paramDeserializationContext.isEnabled(DeserializationConfig.Feature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT)) && (paramJsonParser.getTextLength() == 0))
return null;
throw paramDeserializationContext.instantiationException(getBeanClass(), "no suitable creator method found to deserialize from JSON String");
}
示例4: wrapInstantiationProblem
import org.codehaus.jackson.map.DeserializationContext; //導入方法依賴的package包/類
protected void wrapInstantiationProblem(Throwable paramThrowable, DeserializationContext paramDeserializationContext)
throws IOException
{
while (((paramThrowable instanceof InvocationTargetException)) && (paramThrowable.getCause() != null))
paramThrowable = paramThrowable.getCause();
if ((paramThrowable instanceof Error))
throw ((Error)paramThrowable);
if ((paramDeserializationContext == null) || (paramDeserializationContext.isEnabled(DeserializationConfig.Feature.WRAP_EXCEPTIONS)));
for (int i = 1; (paramThrowable instanceof IOException); i = 0)
throw ((IOException)paramThrowable);
if ((i == 0) && ((paramThrowable instanceof RuntimeException)))
throw ((RuntimeException)paramThrowable);
throw paramDeserializationContext.instantiationException(this._beanType.getRawClass(), paramThrowable);
}
示例5: deserialize
import org.codehaus.jackson.map.DeserializationContext; //導入方法依賴的package包/類
public Collection<Object> deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
throws IOException, JsonProcessingException
{
try
{
Collection localCollection = (Collection)this._defaultCtor.newInstance(new Object[0]);
return deserialize(paramJsonParser, paramDeserializationContext, localCollection);
}
catch (Exception localException)
{
}
throw paramDeserializationContext.instantiationException(this._collectionType.getRawClass(), localException);
}
示例6: deserialize
import org.codehaus.jackson.map.DeserializationContext; //導入方法依賴的package包/類
public Collection<String> deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
throws IOException, JsonProcessingException
{
try
{
Collection localCollection = (Collection)this._defaultCtor.newInstance(new Object[0]);
return deserialize(paramJsonParser, paramDeserializationContext, localCollection);
}
catch (Exception localException)
{
}
throw paramDeserializationContext.instantiationException(this._collectionType.getRawClass(), localException);
}
示例7: deserialize
import org.codehaus.jackson.map.DeserializationContext; //導入方法依賴的package包/類
public Object deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
throws IOException, JsonProcessingException
{
throw paramDeserializationContext.instantiationException(this._baseType.getRawClass(), "abstract types can only be instantiated with additional type information");
}