Stuart McCulloch | 5ec302d | 2008-12-04 07:58:07 +0000 | [diff] [blame] | 1 | package aQute.lib.osgi; |
| 2 | |
| 3 | import java.util.*; |
| 4 | import java.util.regex.*; |
| 5 | |
| 6 | public interface Constants { |
| 7 | public final static String BUNDLE_CLASSPATH = "Bundle-ClassPath"; |
| 8 | public final static String BUNDLE_COPYRIGHT = "Bundle-Copyright"; |
| 9 | public final static String BUNDLE_DESCRIPTION = "Bundle-Description"; |
| 10 | public final static String BUNDLE_NAME = "Bundle-Name"; |
| 11 | public final static String BUNDLE_NATIVECODE = "Bundle-NativeCode"; |
| 12 | public final static String EXPORT_PACKAGE = "Export-Package"; |
| 13 | public final static String EXPORT_SERVICE = "Export-Service"; |
| 14 | public final static String IMPORT_PACKAGE = "Import-Package"; |
| 15 | public final static String DYNAMICIMPORT_PACKAGE = "DynamicImport-Package"; |
| 16 | public final static String IMPORT_SERVICE = "Import-Service"; |
| 17 | public final static String BUNDLE_VENDOR = "Bundle-Vendor"; |
| 18 | public final static String BUNDLE_VERSION = "Bundle-Version"; |
| 19 | public final static String BUNDLE_DOCURL = "Bundle-DocURL"; |
| 20 | public final static String BUNDLE_CONTACTADDRESS = "Bundle-ContactAddress"; |
| 21 | public final static String BUNDLE_ACTIVATOR = "Bundle-Activator"; |
| 22 | public final static String BUNDLE_REQUIREDEXECUTIONENVIRONMENT = "Bundle-RequiredExecutionEnvironment"; |
| 23 | public final static String BUNDLE_SYMBOLICNAME = "Bundle-SymbolicName"; |
| 24 | public final static String BUNDLE_LOCALIZATION = "Bundle-Localization"; |
| 25 | public final static String REQUIRE_BUNDLE = "Require-Bundle"; |
| 26 | public final static String FRAGMENT_HOST = "Fragment-Host"; |
| 27 | public final static String BUNDLE_MANIFESTVERSION = "Bundle-ManifestVersion"; |
| 28 | public final static String SERVICE_COMPONENT = "Service-Component"; |
| 29 | public final static String BUNDLE_LICENSE = "Bundle-License"; |
| 30 | public static final String PRIVATE_PACKAGE = "Private-Package"; |
| 31 | public static final String IGNORE_PACKAGE = "Ignore-Package"; |
| 32 | public static final String INCLUDE_RESOURCE = "Include-Resource"; |
| 33 | public static final String CONDITIONAL_PACKAGE = "Conditional-Package"; |
| 34 | public static final String BND_LASTMODIFIED = "Bnd-LastModified"; |
| 35 | public static final String CREATED_BY = "Created-By"; |
| 36 | public static final String TOOL = "Tool"; |
| 37 | |
| 38 | public final static String headers[] = { |
| 39 | BUNDLE_ACTIVATOR, BUNDLE_CONTACTADDRESS, BUNDLE_COPYRIGHT, |
| 40 | BUNDLE_DESCRIPTION, BUNDLE_DOCURL, BUNDLE_LOCALIZATION, |
| 41 | BUNDLE_NATIVECODE, BUNDLE_VENDOR, BUNDLE_VERSION, BUNDLE_LICENSE, |
| 42 | BUNDLE_CLASSPATH, SERVICE_COMPONENT, EXPORT_PACKAGE, |
| 43 | IMPORT_PACKAGE, BUNDLE_LOCALIZATION, BUNDLE_MANIFESTVERSION, |
| 44 | BUNDLE_NAME, BUNDLE_NATIVECODE, |
| 45 | BUNDLE_REQUIREDEXECUTIONENVIRONMENT, BUNDLE_SYMBOLICNAME, |
| 46 | BUNDLE_VERSION, FRAGMENT_HOST, PRIVATE_PACKAGE, IGNORE_PACKAGE, |
| 47 | INCLUDE_RESOURCE, REQUIRE_BUNDLE, IMPORT_SERVICE, EXPORT_SERVICE, |
| 48 | CONDITIONAL_PACKAGE, BND_LASTMODIFIED }; |
| 49 | |
| 50 | public static final String BUILDPATH = "-buildpath"; |
| 51 | public static final String CONDUIT = "-conduit"; |
| 52 | public static final String CLASSPATH = "-classpath"; |
| 53 | public static final String DEPENDSON = "-dependson"; |
| 54 | public static final String DONOTCOPY = "-donotcopy"; |
| 55 | public static final String EXPORT_CONTENTS = "-exportcontents"; |
| 56 | public static final String FAIL_OK = "-failok"; |
| 57 | public static final String INCLUDE = "-include"; |
| 58 | public static final String MAKE = "-make"; |
| 59 | public static final String MANIFEST = "-manifest"; |
| 60 | public static final String NOEXTRAHEADERS = "-noextraheaders"; |
| 61 | public static final String NOUSES = "-nouses"; |
| 62 | public static final String NOPE = "-nope"; |
| 63 | public static final String PEDANTIC = "-pedantic"; |
| 64 | public static final String PLUGIN = "-plugin"; |
| 65 | public static final String POM = "-pom"; |
| 66 | public static final String REMOVE_HEADERS = "-removeheaders"; |
| 67 | public static final String RESOURCEONLY = "-resourceonly"; |
| 68 | public static final String SOURCES = "-sources"; |
| 69 | public static final String SOURCEPATH = "-sourcepath"; |
| 70 | public static final String SUB = "-sub"; |
| 71 | public static final String RUNPROPERTIES = "-runproperties"; |
| 72 | public static final String RUNSYSTEMPACKAGES = "-runsystempackages"; |
| 73 | public static final String RUNBUNDLES = "-runbundles"; |
| 74 | public static final String RUNPATH = "-runpath"; |
| 75 | public static final String RUNVM = "-runvm"; |
| 76 | |
| 77 | public static final String REPORTNEWER = "-reportnewer"; |
| 78 | public static final String TESTPACKAGES = "-testpackages"; |
| 79 | public static final String TESTREPORT = "-testreport"; |
| 80 | public static final String UNDERTEST = "-undertest"; |
| 81 | public static final String VERBOSE = "-verbose"; |
| 82 | public static final String VERSIONPOLICY = "-versionpolicy"; |
| 83 | public static final String SIGN = "-sign"; |
| 84 | |
| 85 | public static final String options[] = { |
| 86 | BUILDPATH, CONDUIT, CLASSPATH, DEPENDSON, DONOTCOPY, |
| 87 | EXPORT_CONTENTS, FAIL_OK, INCLUDE, MAKE, MANIFEST, NOEXTRAHEADERS, |
| 88 | NOUSES, NOPE, PEDANTIC, PLUGIN, POM, REMOVE_HEADERS, RESOURCEONLY, |
| 89 | SOURCES, SOURCEPATH, SOURCES, SOURCEPATH, SUB, RUNBUNDLES, RUNPATH, |
| 90 | RUNSYSTEMPACKAGES, RUNPROPERTIES, REPORTNEWER, UNDERTEST, |
| 91 | TESTPACKAGES, TESTREPORT, VERBOSE }; |
| 92 | |
| 93 | public static final char DUPLICATE_MARKER = '~'; |
| 94 | |
| 95 | public static final String SPLIT_PACKAGE_DIRECTIVE = "-split-package:"; |
| 96 | public static final String IMPORT_DIRECTIVE = "-import:"; |
| 97 | public static final String NO_IMPORT_DIRECTIVE = "-noimport:"; |
| 98 | public static final String REMOVE_ATTRIBUTE_DIRECTIVE = "-remove-attribute:"; |
| 99 | public static final String USES_DIRECTIVE = "uses:"; |
| 100 | public static final String PRESENCE_DIRECTIVE = "presence:"; |
| 101 | |
| 102 | public static final String KEYSTORE_LOCATION_DIRECTIVE = "keystore:"; |
| 103 | public static final String KEYSTORE_PROVIDER_DIRECTIVE = "provider:"; |
| 104 | public static final String KEYSTORE_PASSWORD_DIRECTIVE = "password:"; |
| 105 | public static final String SIGN_PASSWORD_DIRECTIVE = "sign-password:"; |
| 106 | |
| 107 | public static final String directives[] = { |
| 108 | SPLIT_PACKAGE_DIRECTIVE, NO_IMPORT_DIRECTIVE, IMPORT_DIRECTIVE, |
| 109 | "resolution:", "include:", "uses:", "exclude:", USES_DIRECTIVE, |
| 110 | KEYSTORE_LOCATION_DIRECTIVE, KEYSTORE_PROVIDER_DIRECTIVE, |
| 111 | KEYSTORE_PASSWORD_DIRECTIVE, SIGN_PASSWORD_DIRECTIVE, |
| 112 | |
| 113 | // TODO |
| 114 | }; |
| 115 | |
| 116 | public static final String USES_USES = "<<USES>>"; |
| 117 | public static final String CURRENT_USES = "@uses"; |
| 118 | public static final String IMPORT_REFERENCE = "reference"; |
| 119 | public static final String IMPORT_PRIVATE = "private"; |
| 120 | public static final String[] importDirectives = { |
| 121 | IMPORT_REFERENCE, IMPORT_PRIVATE }; |
| 122 | |
| 123 | public static final String COMPONENT_FACTORY = "factory:"; |
| 124 | public static final String COMPONENT_SERVICEFACTORY = "servicefactory:"; |
| 125 | public static final String COMPONENT_IMMEDIATE = "immediate:"; |
| 126 | public static final String COMPONENT_ENABLED = "enabled:"; |
| 127 | public static final String COMPONENT_DYNAMIC = "dynamic:"; |
| 128 | public static final String COMPONENT_MULTIPLE = "multiple:"; |
| 129 | public static final String COMPONENT_PROVIDE = "provide:"; |
| 130 | public static final String COMPONENT_OPTIONAL = "optional:"; |
| 131 | public static final String COMPONENT_PROPERTIES = "properties:"; |
| 132 | public static final String COMPONENT_IMPLEMENTATION = "implementation:"; |
| 133 | public static final String[] componentDirectives = new String[] { |
| 134 | COMPONENT_FACTORY, COMPONENT_IMMEDIATE, COMPONENT_ENABLED, |
| 135 | COMPONENT_DYNAMIC, COMPONENT_MULTIPLE, COMPONENT_PROVIDE, |
| 136 | COMPONENT_OPTIONAL, COMPONENT_PROPERTIES, COMPONENT_IMPLEMENTATION, COMPONENT_SERVICEFACTORY }; |
| 137 | |
| 138 | // static Map EES = new HashMap(); |
| 139 | static Set<String> SET_COMPONENT_DIRECTIVES = new HashSet<String>( |
| 140 | Arrays |
| 141 | .asList(componentDirectives)); |
| 142 | |
| 143 | static final Pattern VALID_PROPERTY_TYPES = Pattern |
| 144 | .compile("(String|Long|Double|Float|Integer|Byte|Character|Boolean|Short)"); |
| 145 | |
| 146 | public final static String DEFAULT_BND_EXTENSION = ".bnd"; |
| 147 | public final static String DEFAULT_JAR_EXTENSION = ".jar"; |
| 148 | public final static String DEFAULT_BAR_EXTENSION = ".bar"; |
| 149 | String[] METAPACKAGES = { |
| 150 | "META-INF", "OSGI-INF", "OSGI-OPT" }; |
| 151 | |
| 152 | int STRATEGY_HIGHEST = 1; |
| 153 | int STRATEGY_LOWEST = -1; |
| 154 | |
| 155 | final static String CURRENT_VERSION = "@"; |
| 156 | final static String CURRENT_PACKAGE = "@package"; |
| 157 | } |