/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Visitor that converts AST to reified types.
*/
factory = f;
}
/**
* Factory method. The resulting visitor will convert an AST
* representing generic signatures into corresponding reflective
* objects, using the provided factory, <tt>f</tt>.
* @param f - a factory that can be used to manufacture reflective
* objects returned by this visitor
* @return A visitor that can be used to reify ASTs representing
* generic type information into reflective objects
*/
return new Reifier(f);
}
// Helper method. Visits an array of TypeArgument and produces
// reified Type array.
ts[i] = resultType;
}
return ts;
}
/**
* Accessor for the result of the last visit by this visitor,
* @return The type computed by this visitor based on its last
* visit
*/
}
// This method examines the pathname stored in ct, which has the form
// n1.n2...nk<targs>....
// where n1 ... nk-1 might not exist OR
// nk might not exist (but not both). It may be that k equals 1.
// The idea is that nk is the simple class type name that has
// any type parameters associated with it.
// We process this path in two phases.
// First, we scan until we reach nk (if it exists).
// If nk does not exist, this identifies a raw class n1 ... nk-1
// which we can return.
// if nk does exist, we begin the 2nd phase.
// Here nk defines a parameterized type. Every further step nj (j > k)
// down the path must also be represented as a parameterized type,
// whose owner is the representation of the previous step in the path,
// n{j-1}.
// extract iterator on list of simple class type sigs
// phase 1: iterate over simple class types until
// we are either done or we hit one with non-empty type parameters
}
// Now, either sc is the last element of the list, or
// it has type arguments (or both)
// Create the raw type
// if there are no type arguments
//we have surely reached the end of the path
resultType = c; // the result is the raw type
} else {
// otherwise, we have type arguments, so we create a parameterized
// type, whose declaration is the raw type c, and whose owner is
// the declaring class of c (if any). This latter fact is indicated
// by passing null as the owner.
// First, we reify the type arguments
// phase 2: iterate over remaining simple class types
dollar =false;
// Create a parameterized type, based on type args, raw type
// and previous owner
}
resultType = owner;
}
}
// extract and reify component type
a.getComponentType().accept(this);
}
}
w.getLowerBounds());
}
}
}
}
}
}
}
}
}
}
}
}
}