|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.modules.java.bridge; // import java.beans.PropertyChangeEvent; import java.util.*; import java.util.Iterator; import org.openide.src.*; import javax.jmi.reflect.RefObject; import javax.jmi.reflect.InvalidObjectException; import org.netbeans.jmi.javamodel.JavaClass; import org.netbeans.modules.javacore.jmiimpl.javamodel.JavaClassImpl; class ClassesCollection extends ObjectsCollection { static final ClassElement[] EMPTY = new ClassElement[0]; public ClassesCollection(FeaturesCollection members) { super (members); } public RefObject createFeature(RefObject parent, Element elem) { return members.createClass ((ClassElement) elem); } public Element [] getEmptyArray () { return EMPTY; } public String getPropertyName () { return ElementProperties.PROP_CLASSES; } public boolean isOfType (RefObject feature) { return feature instanceof JavaClass; } public Element createElement (RefObject innerClass) { return (ClassElement) members.model.createInnerClass (members.getParentClass (), (JavaClass)innerClass).getElement (); } public ClassElement getClass(Identifier name) { try { String simpleName = name.getName(); JavaClass innerClass = members.javaClass.getInnerClass(simpleName, false); if (innerClass == null) return null; String fqn = name.getFullName (); if (!fqn.equals (name.getName ()) && !fqn.equals (innerClass.getName ())) return null; return (ClassElement) cachedElement (innerClass); } catch (InvalidObjectException e) { return null; } } public ClassElement[] getClasses () { return (ClassElement[]) getElements (); } public boolean matches (Element elem, RefObject f) { JavaClass javaClass = (JavaClass) f; ClassElement classElem = (ClassElement) elem; String simpleName = javaClass.getSimpleName(); return classElem.getName ().getName ().equals (simpleName); } public int getPositionalValue () { return ObjectsCollection.POS_VAL_CLASS; } } |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.