java.lang.NoSuchFieldException.getLocalizedMessage()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(70)

本文整理了Java中java.lang.NoSuchFieldException.getLocalizedMessage()方法的一些代码示例,展示了NoSuchFieldException.getLocalizedMessage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NoSuchFieldException.getLocalizedMessage()方法的具体详情如下:
包路径:java.lang.NoSuchFieldException
类名称:NoSuchFieldException
方法名:getLocalizedMessage

NoSuchFieldException.getLocalizedMessage介绍

暂无

代码示例

代码示例来源:origin: geotools/geotools

/**
 * Constructs the {@link PlanarImage} from the {@linkplain SerializableRenderedImage} after
 * deserialization.
 */
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
  in.defaultReadObject();
  try {
    /*
     * Set the 'image' field using reflection, because this field is final.
     * This is a legal usage for deserialization according Field.set(...)
     * documentation in J2SE 1.5.
     */
    final Field field = GridCoverage2D.class.getDeclaredField("image");
    field.setAccessible(true);
    field.set(this, PlanarImage.wrapRenderedImage(serializedImage));
  } catch (NoSuchFieldException cause) {
    InvalidClassException e = new InvalidClassException(cause.getLocalizedMessage());
    e.initCause(cause);
    throw e;
  } catch (IllegalAccessException cause) {
    InvalidObjectException e = new InvalidObjectException(cause.getLocalizedMessage());
    e.initCause(cause);
    throw e;
  }
}

代码示例来源:origin: nailperry-zd/LazierTracker

private static void getClassFragmentActivity(Class clazz) {
  while ((clazz != null) && (!clazz.equals(android.support.v4.app.FragmentActivity.class))) {
    try {
      fieldmFragments = clazz.getDeclaredField("mFragments");
    } catch (NoSuchFieldException e) {
      Log.e(EXCEPTION, e.getLocalizedMessage());
    }
    if (fieldmFragments != null) {
      return;
    }
    clazz = clazz.getSuperclass();
  }
}

代码示例来源:origin: ymex/banner

private void replaceViewPagerScroll() {
  try {
    Field field = ViewPager.class.getDeclaredField("mScroller");
    field.setAccessible(true);
    BannerScroller mScroller = new BannerScroller(getContext(), sInterpolator);
    mScroller.setDuration(mScroller.mDuration);
    field.set(this, mScroller);
  } catch (IllegalAccessException e) {
    e.printStackTrace();
    System.err.println(e.getLocalizedMessage());
  } catch (NoSuchFieldException e) {
    e.printStackTrace();
    System.err.println(e.getLocalizedMessage());
  }
}

代码示例来源:origin: org.geotools/gt-coverage

/**
 * Constructs the {@link PlanarImage} from the {@linkplain SerializableRenderedImage}
 * after deserialization.
 */
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
  in.defaultReadObject();
  try {
    /*
     * Set the 'image' field using reflection, because this field is final.
     * This is a legal usage for deserialization according Field.set(...)
     * documentation in J2SE 1.5.
     */
    final Field field = GridCoverage2D.class.getDeclaredField("image");
    field.setAccessible(true);
    field.set(this, PlanarImage.wrapRenderedImage(serializedImage));
  } catch (NoSuchFieldException cause) {
    InvalidClassException e = new InvalidClassException(cause.getLocalizedMessage());
    e.initCause(cause);
    throw e;
  } catch (IllegalAccessException cause) {
    InvalidObjectException e = new InvalidObjectException(cause.getLocalizedMessage());
    e.initCause(cause);
    throw e;
  }
}

代码示例来源:origin: org.geotools/gt2-coverage

/**
 * Constructs the {@link PlanarImage} from the {@linkplain SerializableRenderedImage}
 * after deserialization.
 */
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
  in.defaultReadObject();
  try {
    /*
     * Set the 'image' field using reflection, because this field is final.
     * This is a legal usage for deserialization according Field.set(...)
     * documentation in J2SE 1.5.
     */
    final Field field = GridCoverage2D.class.getDeclaredField("image");
    field.setAccessible(true);
    field.set(this, PlanarImage.wrapRenderedImage(serializedImage));
  } catch (NoSuchFieldException cause) {
    InvalidClassException e = new InvalidClassException(cause.getLocalizedMessage());
    e.initCause(cause);
    throw e;
  } catch (IllegalAccessException cause) {
    InvalidObjectException e = new InvalidObjectException(cause.getLocalizedMessage());
    e.initCause(cause);
    throw e;
  }
}

代码示例来源:origin: Refinitiv/Elektron-SDK

fail(e.getLocalizedMessage());

相关文章