serp.bytecode.BCClass.setState()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(63)

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

BCClass.setState介绍

[英]Set the class state. For use by the owning project only.
[中]设置类状态。仅供所属项目使用。

代码示例

代码示例来源:origin: org.apache.openjpa/openjpa-all

ret.setState(new PrimitiveState(type, _names));
else if (type.isArray())
  ret.setState(new ArrayState(type.getName(), _names.getExternalForm
    (type.getComponentType().getName(), false)));
else {
  ret.setState(new ObjectState(_names));
  try {
    ret.read(type);

代码示例来源:origin: net.sourceforge.serp/serp

ret.setState(new PrimitiveState(type, _names));
else if (type.isArray())
  ret.setState(new ArrayState(type.getName(), _names.getExternalForm
    (type.getComponentType().getName(), false)));
else {
  ret.setState(new ObjectState(_names));
  try {
    ret.read(type);

代码示例来源:origin: org.apache.openjpa/openjpa-all

/**
 * Load the bytecode from the given stream.
 * If this project already contains the class in the given stream,
 * it will be returned. Otherwise a new {@link BCClass} will be created
 * from the given bytecode.
 *
 * @throws RuntimeException on parse error
 */
public BCClass loadClass(InputStream in, ClassLoader loader) {
  BCClass ret = new BCClass(this);
  ret.setState(new ObjectState(_names));
  try {
    ret.read(in, loader);
  } catch (IOException ioe) {
    throw new RuntimeException(ioe.toString());
  }
  String name = ret.getName();
  BCClass cached = checkCache(name);
  if (cached != null)
    return cached;
  cache(name, ret);
  return ret;
}

代码示例来源:origin: org.apache.openjpa/openjpa-all

/**
 * Load the bytecode from the given class file.
 * If this project already contains the class in the given file, it will
 * be returned. Otherwise a new {@link BCClass} will be created from the
 * given bytecode.
 *
 * @throws RuntimeException on parse error
 */
public BCClass loadClass(File classFile, ClassLoader loader) {
  // parse the bytecode from the file
  BCClass ret = new BCClass(this);
  ret.setState(new ObjectState(_names));
  try {
    ret.read(classFile, loader);
  } catch (IOException ioe) {
    throw new RuntimeException(ioe.toString());
  }
  String name = ret.getName();
  BCClass cached = checkCache(name);
  if (cached != null)
    return cached;
  cache(name, ret);
  return ret;
}

代码示例来源:origin: net.sourceforge.serp/serp

/**
 * Load the bytecode from the given stream.
 * If this project already contains the class in the given stream,
 * it will be returned. Otherwise a new {@link BCClass} will be created
 * from the given bytecode.
 *
 * @throws RuntimeException on parse error
 */
public BCClass loadClass(InputStream in, ClassLoader loader) {
  BCClass ret = new BCClass(this);
  ret.setState(new ObjectState(_names));
  try {
    ret.read(in, loader);
  } catch (IOException ioe) {
    throw new RuntimeException(ioe.toString());
  }
  String name = ret.getName();
  BCClass cached = checkCache(name);
  if (cached != null)
    return cached;
  cache(name, ret);
  return ret;
}

代码示例来源:origin: net.sourceforge.serp/serp

/**
 * Load the bytecode from the given class file.
 * If this project already contains the class in the given file, it will
 * be returned. Otherwise a new {@link BCClass} will be created from the
 * given bytecode.
 *
 * @throws RuntimeException on parse error
 */
public BCClass loadClass(File classFile, ClassLoader loader) {
  // parse the bytecode from the file
  BCClass ret = new BCClass(this);
  ret.setState(new ObjectState(_names));
  try {
    ret.read(classFile, loader);
  } catch (IOException ioe) {
    throw new RuntimeException(ioe.toString());
  }
  String name = ret.getName();
  BCClass cached = checkCache(name);
  if (cached != null)
    return cached;
  cache(name, ret);
  return ret;
}

代码示例来源:origin: net.sourceforge.serp/serp

/**
 * Import the given bytecode from another project. If a {@link BCClass}
 * with the same name already exists in this project, it will be returned.
 * Otherwise, a new {@link BCClass} will be created from the
 * information in the given class.
 */
public BCClass loadClass(BCClass bc) {
  String name = bc.getName();
  BCClass cached = checkCache(name);
  if (cached != null)
    return cached;
  BCClass ret = new BCClass(this);
  if (bc.isPrimitive())
    ret.setState(new PrimitiveState(bc.getType(), _names));
  else if (bc.isArray())
    ret.setState(new ArrayState(bc.getName(), bc.getComponentName()));
  else {
    ret.setState(new ObjectState(_names));
    ret.read(bc);
  }
  cache(name, ret);
  return ret;
}

代码示例来源:origin: org.apache.openjpa/openjpa-all

/**
 * Import the given bytecode from another project. If a {@link BCClass}
 * with the same name already exists in this project, it will be returned.
 * Otherwise, a new {@link BCClass} will be created from the
 * information in the given class.
 */
public BCClass loadClass(BCClass bc) {
  String name = bc.getName();
  BCClass cached = checkCache(name);
  if (cached != null)
    return cached;
  BCClass ret = new BCClass(this);
  if (bc.isPrimitive())
    ret.setState(new PrimitiveState(bc.getType(), _names));
  else if (bc.isArray())
    ret.setState(new ArrayState(bc.getName(), bc.getComponentName()));
  else {
    ret.setState(new ObjectState(_names));
    ret.read(bc);
  }
  cache(name, ret);
  return ret;
}

代码示例来源:origin: net.sourceforge.serp/serp

BCClass ret = new BCClass(this);
if (componentName != null)
  ret.setState(new ArrayState(name, componentName));
else {
  ret.setState(new ObjectState(_names));
  ret.setName(name);
  ret.setSuperclass(Object.class);

代码示例来源:origin: org.apache.openjpa/openjpa-all

BCClass ret = new BCClass(this);
if (componentName != null)
  ret.setState(new ArrayState(name, componentName));
else {
  ret.setState(new ObjectState(_names));
  ret.setName(name);
  ret.setSuperclass(Object.class);

相关文章

微信公众号

最新文章

更多