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

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

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

BCClass.getSuperclassBC介绍

[英]Return the bytecode of the superclass of this class, or null for types without superclasses.
[中]返回该类的超类的字节码,对于没有超类的类型,返回null。

代码示例

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

/**
 * Return all the fields of this class, including those of all
 * superclasses, or an empty array if none.
 */
public BCField[] getFields() {
  Collection allFields = new LinkedList();
  BCField[] fields;
  for (BCClass type = this; type != null; type = type.getSuperclassBC()) {
    fields = type.getDeclaredFields();
    for (int i = 0; i < fields.length; i++)
      allFields.add(fields[i]);
  }
  return (BCField[]) allFields.toArray(new BCField[allFields.size()]);
}

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

/**
 * Return all the fields of this class, including those of all
 * superclasses, or an empty array if none.
 */
public BCField[] getFields() {
  Collection allFields = new LinkedList();
  BCField[] fields;
  for (BCClass type = this; type != null; type = type.getSuperclassBC()) {
    fields = type.getDeclaredFields();
    for (int i = 0; i < fields.length; i++)
      allFields.add(fields[i]);
  }
  return (BCField[]) allFields.toArray(new BCField[allFields.size()]);
}

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

/**
 * Return the bytecode of all unique interfaces implemented by this class,
 * including those of all superclasses.
 * This method does not recurse into interfaces-of-interfaces.
 */
public BCClass[] getInterfaceBCs() {
  Collection allTypes = new LinkedList();
  BCClass[] types;
  for (BCClass type = this; type != null; type = type.getSuperclassBC()) {
    types = type.getDeclaredInterfaceBCs();
    for (int i = 0; i < types.length; i++)
      allTypes.add(types[i]);
  }
  return (BCClass[]) allTypes.toArray(new BCClass[allTypes.size()]);
}

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

/**
 * Return the names of all unique interfaces implemented by this class,
 * including those of all superclasses. The names will be returned in a
 * form suitable for a {@link Class#forName} call.
 * This method does not recurse into interfaces-of-interfaces.
 */
public String[] getInterfaceNames() {
  Collection allNames = new LinkedList();
  String[] names;
  for (BCClass type = this; type != null; type = type.getSuperclassBC()) {
    names = type.getDeclaredInterfaceNames();
    for (int i = 0; i < names.length; i++)
      allNames.add(names[i]);
  }
  return (String[]) allNames.toArray(new String[allNames.size()]);
}

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

/**
 * Return the {@link Class} objects of all unique interfaces implemented
 * by this class, including those of all superclasses.
 * This method does not recurse into interfaces-of-interfaces.
 */
public Class[] getInterfaceTypes() {
  Collection allTypes = new LinkedList();
  Class[] types;
  for (BCClass type = this; type != null; type = type.getSuperclassBC()) {
    types = type.getDeclaredInterfaceTypes();
    for (int i = 0; i < types.length; i++)
      allTypes.add(types[i]);
  }
  return (Class[]) allTypes.toArray(new Class[allTypes.size()]);
}

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

/**
 * Return the {@link Class} objects of all unique interfaces implemented
 * by this class, including those of all superclasses.
 * This method does not recurse into interfaces-of-interfaces.
 */
public Class[] getInterfaceTypes() {
  Collection allTypes = new LinkedList();
  Class[] types;
  for (BCClass type = this; type != null; type = type.getSuperclassBC()) {
    types = type.getDeclaredInterfaceTypes();
    for (int i = 0; i < types.length; i++)
      allTypes.add(types[i]);
  }
  return (Class[]) allTypes.toArray(new Class[allTypes.size()]);
}

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

/**
 * Return the bytecode of all unique interfaces implemented by this class,
 * including those of all superclasses.
 * This method does not recurse into interfaces-of-interfaces.
 */
public BCClass[] getInterfaceBCs() {
  Collection allTypes = new LinkedList();
  BCClass[] types;
  for (BCClass type = this; type != null; type = type.getSuperclassBC()) {
    types = type.getDeclaredInterfaceBCs();
    for (int i = 0; i < types.length; i++)
      allTypes.add(types[i]);
  }
  return (BCClass[]) allTypes.toArray(new BCClass[allTypes.size()]);
}

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

/**
 * Return the names of all unique interfaces implemented by this class,
 * including those of all superclasses. The names will be returned in a
 * form suitable for a {@link Class#forName} call.
 * This method does not recurse into interfaces-of-interfaces.
 */
public String[] getInterfaceNames() {
  Collection allNames = new LinkedList();
  String[] names;
  for (BCClass type = this; type != null; type = type.getSuperclassBC()) {
    names = type.getDeclaredInterfaceNames();
    for (int i = 0; i < names.length; i++)
      allNames.add(names[i]);
  }
  return (String[]) allNames.toArray(new String[allNames.size()]);
}

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

/**
 * Return the methods of this class, including those of all superclasses,
 * or an empty array if none.
 * The base version of methods that are overridden will be included, as
 * will all constructors and static initializers.
 * The methods will be ordered from those in the most-specific type up to
 * those in {@link Object}.
 */
public BCMethod[] getMethods() {
  Collection allMethods = new LinkedList();
  BCMethod[] methods;
  for (BCClass type = this; type != null; type = type.getSuperclassBC()) {
    methods = type.getDeclaredMethods();
    for (int i = 0; i < methods.length; i++)
      allMethods.add(methods[i]);
  }
  return (BCMethod[]) allMethods.toArray(new BCMethod[allMethods.size()]);
}

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

/**
 * Return the methods of this class, including those of all superclasses,
 * or an empty array if none.
 * The base version of methods that are overridden will be included, as
 * will all constructors and static initializers.
 * The methods will be ordered from those in the most-specific type up to
 * those in {@link Object}.
 */
public BCMethod[] getMethods() {
  Collection allMethods = new LinkedList();
  BCMethod[] methods;
  for (BCClass type = this; type != null; type = type.getSuperclassBC()) {
    methods = type.getDeclaredMethods();
    for (int i = 0; i < methods.length; i++)
      allMethods.add(methods[i]);
  }
  return (BCMethod[]) allMethods.toArray(new BCMethod[allMethods.size()]);
}

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

/**
 * Return true if this class or any of its superclasses implement/extend
 * the given interface/class.
 * This method does not recurse into interfaces-of-interfaces.
 */
public boolean isInstanceOf(String name) {
  name = _project.getNameCache().getExternalForm(name, false);
  String[] interfaces = getInterfaceNames();
  for (int i = 0; i < interfaces.length; i++)
    if (interfaces[i].equals(name))
      return true;
  for (BCClass type = this; type != null; type = type.getSuperclassBC())
    if (type.getName().equals(name))
      return true;
  return false;
}

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

/**
 * Return true if this class or any of its superclasses implement/extend
 * the given interface/class.
 * This method does not recurse into interfaces-of-interfaces.
 */
public boolean isInstanceOf(String name) {
  name = _project.getNameCache().getExternalForm(name, false);
  String[] interfaces = getInterfaceNames();
  for (int i = 0; i < interfaces.length; i++)
    if (interfaces[i].equals(name))
      return true;
  for (BCClass type = this; type != null; type = type.getSuperclassBC())
    if (type.getName().equals(name))
      return true;
  return false;
}

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

private void configureBCs() {
  if (!_bcsConfigured) {
    if (getRedefine()) {
      if (_managedType.getAttribute(REDEFINED_ATTRIBUTE) == null)
        _managedType.addAttribute(REDEFINED_ATTRIBUTE);
      else
        _isAlreadyRedefined = true;
    }
    if (getCreateSubclass()) {
      PCSubclassValidator val = new PCSubclassValidator(
        _meta, _managedType, _log, _fail);
      val.assertCanSubclass();
      _pc = _managedType.getProject().loadClass(
        toPCSubclassName(_managedType.getType()));
      if (_pc.getSuperclassBC() != _managedType) {
        _pc.setSuperclass(_managedType);
        _pc.setAbstract(_managedType.isAbstract());
        _pc.declareInterface(DynamicPersistenceCapable.class);
      } else {
        _isAlreadySubclassed = true;
      }
    }
    _bcsConfigured = true;
  }
}

代码示例来源:origin: org.apache.openejb.patch/openjpa-kernel

private void configureBCs() {
  if (!_bcsConfigured) {
    if (getRedefine()) {
      if (_managedType.getAttribute(REDEFINED_ATTRIBUTE) == null)
        _managedType.addAttribute(REDEFINED_ATTRIBUTE);
      else
        _isAlreadyRedefined = true;
    }
    if (getCreateSubclass()) {
      PCSubclassValidator val = new PCSubclassValidator(
        _meta, _managedType, _log, _fail);
      val.assertCanSubclass();
      _pc = _managedType.getProject().loadClass(
        toPCSubclassName(_managedType.getType()));
      if (_pc.getSuperclassBC() != _managedType) {
        _pc.setSuperclass(_managedType);
        _pc.setAbstract(_managedType.isAbstract());
        _pc.declareInterface(DynamicPersistenceCapable.class);
      } else {
        _isAlreadySubclassed = true;
      }
    }
    _bcsConfigured = true;
  }
}

代码示例来源:origin: org.apache.openejb.patch/openjpa

private void configureBCs() {
  if (!_bcsConfigured) {
    if (getRedefine()) {
      if (_managedType.getAttribute(REDEFINED_ATTRIBUTE) == null)
        _managedType.addAttribute(REDEFINED_ATTRIBUTE);
      else
        _isAlreadyRedefined = true;
    }
    if (getCreateSubclass()) {
      PCSubclassValidator val = new PCSubclassValidator(
        _meta, _managedType, _log, _fail);
      val.assertCanSubclass();
      _pc = _managedType.getProject().loadClass(
        toPCSubclassName(_managedType.getType()));
      if (_pc.getSuperclassBC() != _managedType) {
        _pc.setSuperclass(_managedType);
        _pc.setAbstract(_managedType.isAbstract());
        _pc.declareInterface(DynamicPersistenceCapable.class);
      } else {
        _isAlreadySubclassed = true;
      }
    }
    _bcsConfigured = true;
  }
}

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

private void configureBCs() {
  if (!_bcsConfigured) {
    if (getRedefine()) {
      if (_managedType.getAttribute(REDEFINED_ATTRIBUTE) == null)
        _managedType.addAttribute(REDEFINED_ATTRIBUTE);
      else
        _isAlreadyRedefined = true;
    }
    if (getCreateSubclass()) {
      PCSubclassValidator val = new PCSubclassValidator(
        _meta, _managedType, _log, _fail);
      val.assertCanSubclass();
      _pc = _managedType.getProject().loadClass(
        toPCSubclassName(_managedType.getType()));
      if (_pc.getSuperclassBC() != _managedType) {
        _pc.setSuperclass(_managedType);
        _pc.setAbstract(_managedType.isAbstract());
        _pc.declareInterface(DynamicPersistenceCapable.class);
      } else {
        _isAlreadySubclassed = true;
      }
    }
    _bcsConfigured = true;
  }
}

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

outer: for (BCClass bc = _pc; bc != null; bc = bc.getSuperclassBC()) {
  BCField[] fields = AccessController
    .doPrivileged(J2DoPrivHelper.getBCClassFieldsAction(bc,

代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa

private void configureBCs() {
  if (!_bcsConfigured) {
    if (getRedefine()) {
      if (_managedType.getAttribute(REDEFINED_ATTRIBUTE) == null)
        _managedType.addAttribute(REDEFINED_ATTRIBUTE);
      else
        _isAlreadyRedefined = true;
    }
    if (getCreateSubclass()) {
      PCSubclassValidator val = new PCSubclassValidator(
        _meta, _managedType, _log, _fail);
      val.assertCanSubclass();
      _pc = _managedType.getProject().loadClass(
        toPCSubclassName(_managedType.getType()));
      if (_pc.getSuperclassBC() != _managedType) {
        _pc.setSuperclass(_managedType);
        _pc.setAbstract(_managedType.isAbstract());
        _pc.declareInterface(DynamicPersistenceCapable.class);
      } else {
        _isAlreadySubclassed = true;
      }
    }
    _bcsConfigured = true;
  }
}

代码示例来源:origin: org.apache.openejb.patch/openjpa

outer: for (BCClass bc = _pc; bc != null; bc = bc.getSuperclassBC()) {
  BCField[] fields = AccessController
    .doPrivileged(J2DoPrivHelper.getBCClassFieldsAction(bc,

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

outer: for (BCClass bc = _pc; bc != null; bc = bc.getSuperclassBC()) {
  BCField[] fields = AccessController
    .doPrivileged(J2DoPrivHelper.getBCClassFieldsAction(bc,

相关文章

微信公众号

最新文章

更多