當前位置: 首頁>>代碼示例>>Java>>正文


Java DeserializationContext.instantiationException方法代碼示例

本文整理匯總了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);
}
 
開發者ID:zhangjianying,項目名稱:12306-android-Decompile,代碼行數:22,代碼來源:MapDeserializer.java

示例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);
}
 
開發者ID:zhangjianying,項目名稱:12306-android-Decompile,代碼行數:20,代碼來源:StdDeserializer.java

示例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");
}
 
開發者ID:zhangjianying,項目名稱:12306-android-Decompile,代碼行數:12,代碼來源:BeanDeserializer.java

示例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);
}
 
開發者ID:zhangjianying,項目名稱:12306-android-Decompile,代碼行數:15,代碼來源:BeanDeserializer.java

示例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);
}
 
開發者ID:zhangjianying,項目名稱:12306-android-Decompile,代碼行數:14,代碼來源:CollectionDeserializer.java

示例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);
}
 
開發者ID:zhangjianying,項目名稱:12306-android-Decompile,代碼行數:14,代碼來源:StringCollectionDeserializer.java

示例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");
}
 
開發者ID:zhangjianying,項目名稱:12306-android-Decompile,代碼行數:6,代碼來源:AbstractDeserializer.java


注:本文中的org.codehaus.jackson.map.DeserializationContext.instantiationException方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。