01: /*******************************************************************************
02: * Copyright (c) 2005 BEA Systems, Inc.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * sbandow@bea.com - initial API and implementation
10: *
11: *******************************************************************************/package org.eclipse.jdt.apt.tests.annotations.filegen;
12:
13: import java.io.IOException;
14: import java.io.PrintWriter;
15:
16: import org.eclipse.jdt.apt.tests.annotations.BaseProcessor;
17:
18: import com.sun.mirror.apt.AnnotationProcessorEnvironment;
19: import com.sun.mirror.apt.Filer;
20:
21: public class SecondGenAnnotationProcessor extends BaseProcessor {
22:
23: public SecondGenAnnotationProcessor(
24: AnnotationProcessorEnvironment env) {
25: super (env);
26: }
27:
28: public void process() {
29: try {
30: Filer f = _env.getFiler();
31: PrintWriter pw = f.createSourceFile("duptest.DupFile"); //$NON-NLS-1$
32: pw.print(CODE_OVERWRITE);
33: pw.close();
34:
35: Filer fr = _env.getFiler();
36: PrintWriter pwr = fr.createSourceFile("reftest.RefFile"); //$NON-NLS-1$
37: pwr.print(CODE_REF);
38: pwr.close();
39: } catch (IOException e) {
40: e.printStackTrace();
41: }
42: }
43:
44: @SuppressWarnings("nls")
45: protected String CODE_OVERWRITE = "package duptest;" + "\n"
46: + "public class DupFile" + "\n" + "{" + "\n"
47: + " public class Inner" + "\n" + " {" + "\n"
48: + " }" + "\n" + "}";
49:
50: @SuppressWarnings("nls")
51: protected String CODE_REF = "package reftest;" + "\n"
52: + "public class RefFile" + "\n" + "{" + "\n"
53: + " duptest.DupFile.Inner i;" + "\n" + "}";
54: }
|