/*
* 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.
*/
// import com.sun.mirror.apt.AnnotationProcessorFactory;
/**
* Apt compiler phase.
*
* <p><b>This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own
* risk. This code and its internal interfaces are subject to change
* or deletion without notice.</b>
*/
@SuppressWarnings("deprecation")
return genSourceFileNames;
}
/** List of names of generated class files.
*/
return genClassFileNames;
}
/* AptEnvironment */
/** The context key for the todo list. */
/** Get the Apt instance for this context. */
return instance;
}
/** Create a new apt list. */
}
/**
* Used to scan javac trees to build data structures needed for
* bootstrapping the apt environment. In particular:
*
* <ul>
*
* <li> Generate list of canonical names of annotation types that
* appear in source files given on the command line
*
* <li> Collect list of javac symbols representing source files
* given on the command line
*
* </ul>
*/
// Set of fully qualified names of annotation types present in
// examined source
// Symbols to build bootstrapping declaration list
return annotationSet;
}
public AptTreeScanner() {
}
super.visitTopLevel(tree);
// Print out contents -- what are we dealing with?
if (d instanceof JCTree.JCClassDecl)
}
}
; // Do nothing.
}
// should add nested classes to packages, etc.
return;
}
super.visitClassDef(tree);
}
super.visitMethodDef(tree);
}
super.visitVarDef(tree);
}
super.visitAnnotation(tree);
}
}
}
return annotationSet;
}
}
}
}
// Determine what annotations are present on the input source
// files, create collections of specified type declarations,
// and type declarations.
}
// Turn collection of ClassSymbols into Collection of apt decls
}
}
// Process input class files
// System.out.println("Adding a class to spectypedecls");
}
}
}
throw new UsageMessageNeededException();
// Run the printing processor
AnnotationProcessor proc = (new BootstrapAPF()).getProcessorFor(new HashSet<AnnotationTypeDeclaration>(),
trivAPE);
} else {
// Discovery process
// List of annotation processory factory instances
{
/*
* If a factory is provided by the user, the
* "-factory" and "-factorypath" options are not used.
*
* Otherwise, if the "-factory" option is used, search
* the appropriate path for the named class.
* Otherwise, use sun.misc.Service to implement the
* default discovery policy.
*/
new LinkedList<AnnotationProcessorFactory>();
if (providedFactory != null) {
} else if (factoryName != null) {
try {
} catch (ClassNotFoundException cnfe) {
} catch (ClassCastException cce) {
} catch (Exception e ) {
} catch(Throwable t) {
throw new AnnotationProcessingError(t);
}
} else {
@SuppressWarnings("unchecked")
}
}
throw new UsageMessageNeededException();
return; // no processors; nothing else to do
} else {
// If there are no annotations, still give
// processors that match everything a chance to
// run.
try {
for(String s: supportedTypes)
for(String s: unmatchedAnnotations) {
for(Pattern p: supportedTypePatterns) {
matchedStrings.add(s);
break;
}
}
}
" matches " +
"nothing.": matchedStrings));
}
// convert annotation names to annotation
// type decls
// If a "*" processor is called on the
// empty string, pass in an empty set of
// annotation type declarations.
for(String s: matchedStrings) {
} else {
try {
} catch (ClassCastException cce) {
}
}
}
}
// If a factory provided a processor in a
// previous round but doesn't match any
// annotations this round, call it with an
// empty set of declarations.
}
break;
} catch (ClassCastException cce) {
}
}
}
// If the set difference of productiveFactories and
// currentRoundFactories is non-empty, call the remaining
// productive factories with an empty set of declarations.
{
try {
} catch (Exception e ) {
} catch(Throwable t) {
throw new AnnotationProcessingError(t);
}
}
}
// If there were no source files AND no factory matching "*",
// make sure the usage message is printed
throw new UsageMessageNeededException();
try {
trivAPE);
else
}
} catch(Throwable t) {
throw new AnnotationProcessingError(t);
}
try {
} catch (Throwable t) {
throw new AnnotationProcessingError(t);
}
// Invoke listener callback mechanism
}
}
/**
* Convert import-style string to regex matching that string. If
* the string is a valid import-style string, return a regex that
* won't match anything.
*/
} else {
}
}
}