/** * 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()]); }
/** * 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()]); }
/** * 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()]); }
/** * 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()]); }
/** * 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()]); }
/** * 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()]); }
/** * 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()]); }
/** * 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()]); }
/** * 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()]); }
/** * 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()]); }
/** * 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; }
/** * 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; }
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; } }
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; } }
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; } }
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; } }
outer: for (BCClass bc = _pc; bc != null; bc = bc.getSuperclassBC()) { BCField[] fields = AccessController .doPrivileged(J2DoPrivHelper.getBCClassFieldsAction(bc,
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; } }
outer: for (BCClass bc = _pc; bc != null; bc = bc.getSuperclassBC()) { BCField[] fields = AccessController .doPrivileged(J2DoPrivHelper.getBCClassFieldsAction(bc,
outer: for (BCClass bc = _pc; bc != null; bc = bc.getSuperclassBC()) { BCField[] fields = AccessController .doPrivileged(J2DoPrivHelper.getBCClassFieldsAction(bc,