KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > apt > core > util > AptPreferenceConstants


1 /*******************************************************************************
2  * Copyright (c) 2005, 2007 BEA Systems, Inc.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * wharley@bea.com - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.jdt.apt.core.util;
13
14 import java.util.Collections JavaDoc;
15 import java.util.HashMap JavaDoc;
16 import java.util.Map JavaDoc;
17
18 /**
19  * String constants used to access APT preference store
20  */

21 public class AptPreferenceConstants {
22     public static final String JavaDoc APT_STRING_BASE = "org.eclipse.jdt.apt"; //$NON-NLS-1$
23
public static final String JavaDoc APT_GENSRCDIR = APT_STRING_BASE + ".genSrcDir"; //$NON-NLS-1$
24
public static final String JavaDoc APT_PROCESSOROPTIONS = APT_STRING_BASE + ".processorOptions"; //$NON-NLS-1$
25
public static final String JavaDoc APT_RECONCILEENABLED = APT_STRING_BASE + ".reconcileEnabled"; //$NON-NLS-1$
26
public static final String JavaDoc APT_PROCESSANNOTATIONS = "org.eclipse.jdt.core.compiler.processAnnotations"; //$NON-NLS-1$
27
// backward compatibility prior to Eclipse 3.3:
28
public static final String JavaDoc APT_ENABLED = APT_STRING_BASE + ".aptEnabled"; //$NON-NLS-1$
29

30     // used for APT_PROCESSANNOTATIONS setting:
31
public static final String JavaDoc ENABLED = "enabled"; //$NON-NLS-1$
32
public static final String JavaDoc DISABLED = "disabled"; //$NON-NLS-1$
33

34     // Used in preference to indicate null value for processor option
35
public static final String JavaDoc APT_NULLVALUE = APT_STRING_BASE + ".NULLVALUE"; //$NON-NLS-1$
36

37     public static final String JavaDoc DEFAULT_GENERATED_SOURCE_FOLDER_NAME = ".apt_generated"; //$NON-NLS-1$
38

39     /**
40      * Processors should report this option in {@link com.sun.mirror.apt.AnnotationProcessorFactory#supportedOptions()}
41      * in order to enable type generation while editing, that is, during reconcile.
42      */

43     public static final String JavaDoc RTTG_ENABLED_OPTION = "enableTypeGenerationInEditor"; //$NON-NLS-1$
44

45     public static Map JavaDoc<String JavaDoc,String JavaDoc> DEFAULT_OPTIONS_MAP;
46     
47     static {
48         Map JavaDoc<String JavaDoc,String JavaDoc> options = new HashMap JavaDoc<String JavaDoc,String JavaDoc>();
49         options.put(AptPreferenceConstants.APT_ENABLED, "false"); //$NON-NLS-1$
50
options.put(AptPreferenceConstants.APT_GENSRCDIR, DEFAULT_GENERATED_SOURCE_FOLDER_NAME);
51         options.put(AptPreferenceConstants.APT_PROCESSOROPTIONS, ""); //$NON-NLS-1$
52
options.put(AptPreferenceConstants.APT_RECONCILEENABLED, "true"); //$NON-NLS-1$
53
DEFAULT_OPTIONS_MAP = Collections.unmodifiableMap(options);
54     }
55     
56     /**
57      * Names of all apt settings that can be read from APT preference store.
58      * Order is unimportant. Note that not all "apt settings" may be in the
59      * APT preference store - for instance, the factory path is kept in a
60      * separate file. This list only applies to the information available
61      * from IPreferencesService. See AptConfig for usage.
62      */

63     public static final String JavaDoc[] OPTION_NAMES = {
64         APT_ENABLED,
65         APT_GENSRCDIR,
66         APT_PROCESSOROPTIONS,
67         APT_RECONCILEENABLED,
68     };
69     
70     /**
71      * Number of apt settings in the APT preference store.
72      */

73     public static final int NSETTINGS = OPTION_NAMES.length;
74 }
75
76
77
Popular Tags