diff options
Diffstat (limited to 'plugins/org.eclipse.jst.common.annotations.controller')
23 files changed, 0 insertions, 2837 deletions
diff --git a/plugins/org.eclipse.jst.common.annotations.controller/.classpath b/plugins/org.eclipse.jst.common.annotations.controller/.classpath deleted file mode 100644 index 1f817e0fd..000000000 --- a/plugins/org.eclipse.jst.common.annotations.controller/.classpath +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="controller"/> - <classpathentry kind="src" path="property_files"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/plugins/org.eclipse.jst.common.annotations.controller/.cvsignore b/plugins/org.eclipse.jst.common.annotations.controller/.cvsignore deleted file mode 100644 index 9910b2da3..000000000 --- a/plugins/org.eclipse.jst.common.annotations.controller/.cvsignore +++ /dev/null @@ -1,4 +0,0 @@ -bin -temp.folder -build.xml -controller.jar diff --git a/plugins/org.eclipse.jst.common.annotations.controller/.project b/plugins/org.eclipse.jst.common.annotations.controller/.project deleted file mode 100644 index 8cc7f2234..000000000 --- a/plugins/org.eclipse.jst.common.annotations.controller/.project +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.jst.common.annotations.controller</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.ManifestBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.SchemaBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.jdt.core.javanature</nature> - <nature>org.eclipse.pde.PluginNature</nature> - </natures> -</projectDescription> diff --git a/plugins/org.eclipse.jst.common.annotations.controller/build.properties b/plugins/org.eclipse.jst.common.annotations.controller/build.properties deleted file mode 100644 index 6087005e5..000000000 --- a/plugins/org.eclipse.jst.common.annotations.controller/build.properties +++ /dev/null @@ -1,19 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2004 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -bin.includes = .template,\ - plugin.xml,\ - src/,\ - controller.jar,\ - schema/ -src.includes = schema/ -source.controller.jar = controller/,\ - property_files/ -output.controller.jar = bin/ diff --git a/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/controller/AnnotationsController.java b/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/controller/AnnotationsController.java deleted file mode 100644 index 31a30cd46..000000000 --- a/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/controller/AnnotationsController.java +++ /dev/null @@ -1,86 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Mar 25, 2004 - */ -package org.eclipse.jst.common.internal.annotations.controller; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.ecore.EObject; - -/** - * Annotations Controller interface used for communicating with emitters and determining available - * tag sets - */ -public interface AnnotationsController { - - /** - * Determines if a tag handler is installed for the specified tag - * - * @param tagset - * the name of a tagset (e.g. "ejb") - * @return true only if the given tagset is available and enabled - */ - public boolean isTagHandlerInstalled(String tagset); - - /** - * Disables annotation processing for the specified resource - * - * @param modelObject - * The Annotated EMF Object - * @param tagset - * The name of the annotations tagset to disable on the object - * @return an IStatus representing success or failure - */ - public IStatus disableAnnotations(EObject modelObject, String tagset); - - /** - * Returns the associated annotated file if the specified model object was generated via - * annotations from a parent resource and is enabled - * - * @param modelObject - * The Annotated EMF Object - * @return the annotated source file associated with the given modelObject - */ - public IFile getEnabledAnnotationFile(EObject modelObject); - - /** - * Process the annotations on the given resource during creation - * - * @return all files touched by the annotations processing - * @throws CoreException - * if a problem occurs while processing - */ - public IFile[] process(IResource res) throws CoreException; - - /** - * Process the annotations on the given resource array - * - * @return all files touched by the annotations processing - * @throws CoreException - * if a problem occurs while processing - */ - public IFile[] process(IResource[] res) throws CoreException; - - /** - * Provides the annotation processor an opportunity to initialize - */ - public void initialize(IProject project); - - /** - * Provides the annotation processor an opportunity to dispose and cleanup - */ - public void dispose(); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/controller/AnnotationsControllerHelper.java b/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/controller/AnnotationsControllerHelper.java deleted file mode 100644 index 529576989..000000000 --- a/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/controller/AnnotationsControllerHelper.java +++ /dev/null @@ -1,153 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.common.internal.annotations.controller; - -import org.eclipse.core.resources.IProject; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jem.util.emf.workbench.JavaProjectUtilities; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.common.internal.annotations.core.AnnotationsAdapter; - -/** - * @author mdelder - * - */ -public class AnnotationsControllerHelper { - private static final String ANNOTATION_BUILDER = "com.ibm.ws.rapiddeploy.annotations.core.AnnotationBuilder"; //$NON-NLS-1$ - public static final AnnotationsControllerHelper INSTANCE = new AnnotationsControllerHelper(); - - protected AnnotationsControllerHelper() { - super(); - } - - /** - * - * @param eObject - * the annotated? model object - * @return true only if the object has annotations - */ - public boolean isAnnotated(EObject eObject) { - return AnnotationsAdapter.getAnnotations(eObject, AnnotationsAdapter.GENERATED) != null; - } - - /** - * A convenience method to tag a model object as annotated - * - * @param eObject - * @param value - */ - public void setAnnotated(EObject eObject, String value) { - AnnotationsAdapter.addAnnotations(eObject, AnnotationsAdapter.GENERATED, value); - } - - /** - * A convenience method to tag a model object as annotated Annotations Adapters can hold extra - * information. - * - * @param eObject - * @param name - * A string key - * @param value - * A String value - */ - public void addAnnotations(EObject eObject, String name, Object value) { - AnnotationsAdapter.addAnnotations(eObject, name, value); - } - - /** - * A convenience method to tag a model object as annotated Annotations Adapters can hold extra - * information. - * - * @param eObject - * @param name - * A string key - * @param value - * A String value - */ - public Object getAnnotations(EObject eObject, String name) { - return AnnotationsAdapter.getAnnotations(eObject, name); - } - - /** - * Acquires the generated annotation comment and parses the Fragment URL of the following form - * to return the tagset name: - * - * com.acme.ejbs.MyEJB# <tagset>/ <fragment>. <fragment-pointer> - * - * @param eObject - * The annotated object - * @return the value of <tagset>in the URL example - */ - public String getTagset(EObject eObject) { - - String generatedComment = (String) AnnotationsAdapter.getAnnotations(eObject, AnnotationsAdapter.GENERATED); - if (generatedComment == null || generatedComment.length() == 0) - return null; - int poundit = generatedComment.indexOf('#'); - int slash = generatedComment.indexOf('/'); - if (poundit < 0 || slash < 0 || poundit >= slash) - return null; - return generatedComment.substring(poundit + 1, slash); - - } - - /** - * Returns the CompilationUnit associated with the given model object - * - * @param eObject - * an Annotated model Object - * @return The compilation unit which was responsible for the generation of the model object - */ - public ICompilationUnit getAnnotatedCU(EObject eObject) { - String fragementString = (String) AnnotationsAdapter.getAnnotations(eObject, AnnotationsAdapter.GENERATED); - if (fragementString == null) - return null; - - String typeString = fragementString.substring(0, fragementString.indexOf('#')); - IType itype; - - if (typeString != null && (itype = findType(typeString, eObject)) != null) { - try { - return itype.getCompilationUnit().getWorkingCopy(null); - } catch (JavaModelException e) { - Logger.getLogger().logError(e); - } - } - return null; - } - - protected IType findType(String type, EObject eObject) { - IType result = null; - IProject project = ProjectUtilities.getProject(eObject); - IJavaProject javaProject = JavaProjectUtilities.getJavaProject(project); - if (javaProject != null) - try { - result = javaProject.findType(type); - } catch (JavaModelException e) { - Logger.getLogger().logError(e); - } - return result; - } - - /** - * Return true if <code>project</code> has annotation support enabled on it. - * - * @return - */ - public boolean hasAnnotationSupport(IProject project) { - return ProjectUtilities.hasBuilder(project, ANNOTATION_BUILDER); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/controller/AnnotationsControllerManager.java b/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/controller/AnnotationsControllerManager.java deleted file mode 100644 index 79a66a22f..000000000 --- a/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/controller/AnnotationsControllerManager.java +++ /dev/null @@ -1,206 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Mar 25, 2004 - */ -package org.eclipse.jst.common.internal.annotations.controller; - -import java.util.Iterator; -import java.util.Map; -import java.util.SortedSet; -import java.util.TreeSet; -import java.util.WeakHashMap; - -import org.eclipse.core.internal.runtime.Assert; -import org.eclipse.core.resources.ICommand; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.jem.util.RegistryReader; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.common.internal.annotations.registry.AnnotationsControllerResources; -import org.eclipse.wst.common.frameworks.internal.enablement.EnablementIdentifier; -import org.eclipse.wst.common.frameworks.internal.enablement.EnablementIdentifierEvent; -import org.eclipse.wst.common.frameworks.internal.enablement.EnablementManager; -import org.eclipse.wst.common.frameworks.internal.enablement.IEnablementIdentifier; -import org.eclipse.wst.common.frameworks.internal.enablement.IEnablementIdentifierListener; -import org.eclipse.wst.common.frameworks.internal.enablement.Identifiable; -import org.eclipse.wst.common.frameworks.internal.enablement.IdentifiableComparator; - - -/** - * AnnotationsControllerRegistry for reading annotations controller extensions - */ -public class AnnotationsControllerManager extends RegistryReader implements IEnablementIdentifierListener { - - public static final AnnotationsControllerManager INSTANCE = new AnnotationsControllerManager(); - public static final String ANNOTATION_BUILDER = "com.ibm.ws.rapiddeploy.annotations.core.AnnotationBuilder"; //$NON-NLS-1$ - - static { - INSTANCE.readRegistry(); - } - - private SortedSet descriptors; - - private Map annotationsControllers; - - public static class Descriptor implements Identifiable { - - public static final String ANNOTATIONS_CONTROLLER = "annotationsController"; //$NON-NLS-1$ - - public static final String ATT_ID = "id"; //$NON-NLS-1$ - - public static final String CLASS = "class"; //$NON-NLS-1$ - - private final IConfigurationElement configElement; - private final String ID; - private final int loadOrder; - private static int loadOrderCounter = 0; - - public Descriptor(IConfigurationElement aConfigElement) { - super(); - Assert.isLegal(ANNOTATIONS_CONTROLLER.equals(aConfigElement.getName()), AnnotationsControllerResources.getString("AnnotationsControllerManager_ERROR_0")); //$NON-NLS-1$ - this.configElement = aConfigElement; - this.ID = this.configElement.getAttribute(ATT_ID); - loadOrder = loadOrderCounter++; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.common.frameworks.internal.enablement.Identifiable#getID() - */ - public String getID() { - return ID; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.common.frameworks.internal.enablement.Identifiable#getLoadOrder() - */ - public int getLoadOrder() { - return loadOrder; - } - - public AnnotationsController createInstance() { - AnnotationsController instance = null; - try { - instance = (AnnotationsController) configElement.createExecutableExtension(CLASS); - } catch (CoreException e) { - Logger.getLogger().logError(e); - } - return instance; - } - } - - /** - * Default constructor - */ - public AnnotationsControllerManager() { - super("org.eclipse.wst.common.internal.annotations.controller", "annotationsController"); //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * read extension element - */ - public boolean readElement(IConfigurationElement element) { - if (!element.getName().equals(Descriptor.ANNOTATIONS_CONTROLLER)) - return false; - addAnnotationController(new Descriptor(element)); - return true; - } - - /** - * @param descriptor - */ - protected void addAnnotationController(Descriptor descriptor) { - EnablementManager.INSTANCE.getIdentifier(descriptor.getID(), null).addIdentifierListener(this); - getDescriptors().add(descriptor); - } - - /** - * @return Returns the annotationControllers. - */ - protected SortedSet getDescriptors() { - if (descriptors == null) - descriptors = new TreeSet(IdentifiableComparator.getInstance()); - return descriptors; - } - - public Descriptor getDescriptor(IProject project) { - for (Iterator iter = getDescriptors().iterator(); iter.hasNext();) { - Descriptor descriptor = (Descriptor) iter.next(); - IEnablementIdentifier identifier = EnablementManager.INSTANCE.getIdentifier(descriptor.getID(), project); - if (identifier.isEnabled()) - return descriptor; - } - return null; - } - - /** - * Determine if any annotations are supported - */ - public boolean isAnyAnnotationsSupported() { - return getDescriptors().size() > 0; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.common.frameworks.internal.enablement.IEnablementIdentifierListener#identifierChanged(org.eclipse.wst.common.frameworks.internal.enablement.EnablementIdentifierEvent) - */ - public void identifierChanged(EnablementIdentifierEvent identifierEvent) { - IProject project = ((EnablementIdentifier) identifierEvent.getIdentifier()).getProject(); - getAnnotationsControllers().remove(project); - } - - /** - * Return the annotations controller for the specified project - */ - public AnnotationsController getAnnotationsController(IProject project) { - AnnotationsController controller = (AnnotationsController) getAnnotationsControllers().get(project); - if (controller == null) { - if (!hasBuilder(project, ANNOTATION_BUILDER)) - return null; - Descriptor descriptor = getDescriptor(project); - if (descriptor != null) - getAnnotationsControllers().put(project, (controller = descriptor.createInstance())); - } - - return controller; - } - - /** - * @return Returns the annotationControllers. - */ - public Map getAnnotationsControllers() { - if (annotationsControllers == null) - annotationsControllers = new WeakHashMap(); - return annotationsControllers; - } - - public boolean hasBuilder(IProject project, String builderName) { - try { - ICommand[] builders = project.getDescription().getBuildSpec(); - for (int i = 0; i < builders.length; i++) { - ICommand builder = builders[i]; - if (builder != null) { - if (builder.getBuilderName().equals(builderName)) - return true; - } - } - } catch (Exception e) { - // Do nothing - } - return false; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/AnnotationTagDynamicInitializer.java b/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/AnnotationTagDynamicInitializer.java deleted file mode 100644 index 85e8d8799..000000000 --- a/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/AnnotationTagDynamicInitializer.java +++ /dev/null @@ -1,24 +0,0 @@ -/* *************************************************************************************************** - * Licensed Materials - Property of IBM - * - * 5724-I66 - * - * © Copyright IBM Corporation 2004. All Rights Reserved. - * - * Note to U.S. Government Users Restricted Rights: Use, duplication or disclosure restricted by GSA - * ADP Schedule Contract with IBM Corp. - * - *****************************************************************************************************/ -package org.eclipse.jst.common.internal.annotations.registry; - -/** - * This method will be called by the AnnotationTagRegistry - * when it is time to register the tags for a given - * TagSet. An AnnotationTagDynamicInitializer defined - * using the annotationTagDynamicInitializer. - * - * @see com.ibm.wtp.annotations.registry.AnnotationTagRegistry - */ -public interface AnnotationTagDynamicInitializer { - void registerTags(); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/AnnotationTagRegistry.java b/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/AnnotationTagRegistry.java deleted file mode 100644 index 14e9620a5..000000000 --- a/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/AnnotationTagRegistry.java +++ /dev/null @@ -1,502 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Aug 22, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.common.internal.annotations.registry; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.IExtensionRegistry; -import org.eclipse.core.runtime.Platform; - -import org.eclipse.jem.util.logger.proxy.Logger; -import org.osgi.framework.Bundle; - -/** - * @author kelleyp - * - * Singleton that parses the annotation tag information from the annotation-taghandler extension - * point, and provides an interface for accessing it for other classes. Largely taken from the - * AnnotationProcessor builder. - */ - -public class AnnotationTagRegistry { - - /** - * Set to true once we've read in the annotation tag information from the plugin registry. - */ - private static boolean initialized = false; - private static final String ANNOTATION_TAG_INFO = "org.eclipse.jst.common.annotations.controller.AnnotationTagInfo"; //$NON-NLS-1$ - - /** - * List of tag specs for all of the tags. - */ - private static ArrayList allTagSpecs = new ArrayList() { - final private static long serialVersionUID = 8683452581122892190L; - - private void scopeAll(Collection c, boolean forAdd) { - Iterator iter = c.iterator(); - while (iter.hasNext()) { - TagSpec ts = (TagSpec) iter.next(); - if (forAdd) - addScope(ts); - else - removeScope(ts); - } - } - - private void addScope(TagSpec ts) { - if (ts == null) - return; - switch (ts.getScope()) { - case TagSpec.FIELD : - fieldTags.put(ts.getTagName(), ts); - break; - case TagSpec.METHOD : - methodTags.put(ts.getTagName(), ts); - break; - case TagSpec.TYPE : - typeTags.put(ts.getTagName(), ts); - break; - } - } - - private void removeScope(TagSpec ts) { - if (ts == null) - return; - switch (ts.getScope()) { - case TagSpec.FIELD : - fieldTags.remove(ts.getTagName()); - break; - case TagSpec.METHOD : - methodTags.remove(ts.getTagName()); - break; - case TagSpec.TYPE : - typeTags.remove(ts.getTagName()); - break; - } - } - - public void add(int index, Object element) { - super.add(index, element); - addScope((TagSpec) element); - } - - public boolean add(Object o) { - addScope((TagSpec) o); - return super.add(o); - } - - public boolean addAll(Collection c) { - scopeAll(c, true); - return super.addAll(c); - } - - public boolean addAll(int index, Collection c) { - scopeAll(c, true); - return super.addAll(index, c); - } - - public Object remove(int index) { - Object result = super.remove(index); - removeScope((TagSpec) result); - return result; - } - - public boolean remove(Object o) { - removeScope((TagSpec) o); - return super.remove(o); - } - - public boolean removeAll(Collection c) { - scopeAll(c, false); - return super.removeAll(c); - } - - public boolean retainAll(Collection c) { - Iterator iter = this.iterator(); - while (iter.hasNext()) { - TagSpec ts = (TagSpec) iter.next(); - if (!c.contains(ts)) - removeScope(ts); - } - return super.retainAll(c); - } - }; - - /** - * Map from a tag name to a InitTagInfo. Only live during up to the end of the init() method. - */ - private static Hashtable tagAttribs = new Hashtable(); - - /** - * Division of tag names between allowed scopes. - */ - private static Map methodTags = new HashMap(); - - private static Map typeTags = new HashMap(); - - private static Map fieldTags = new HashMap(); - - private static final String CLASS_PROP = "class"; //$NON-NLS-1$ - private static final String DYNAMIC_INITIALIZER_EX_PT = "annotationTagDynamicInitializer"; //$NON-NLS-1$ - private static final String ANNOTATIONS_CONTROLLER_NAMESPACE = "org.eclipse.jst.common.annotations.controller"; //$NON-NLS-1$ - - /** - * Helper for init, parse the tag attributes for a AnnotationTagInfo tag. - * - * @param elems - * Array of "attrib" configuration elements. - * @param tagName - * Lowercased name of the tag these attributes are associated with. - */ - private static InitTagInfo parseTagAttribs(IConfigurationElement[] elems, String tagName, String scope) { - int i; - ArrayList attribList = new ArrayList(); - - InitTagInfo tagInf = new InitTagInfo(tagName, scope, attribList); - - for (i = 0; i < elems.length; i++) { - IConfigurationElement elem = elems[i]; - - if (elem.getName().equalsIgnoreCase("attrib")) { //$NON-NLS-1$ - TagAttribSpec tas = new TagAttribSpec(elem.getAttribute("name"), elem.getAttribute("description")); //$NON-NLS-1$ //$NON-NLS-2$ - String use = elem.getAttribute("use"); //$NON-NLS-1$ - - tas.setType(elem.getAttribute("type")); //$NON-NLS-1$ - - // add valid values - if ("enum".equals(elem.getAttribute("type"))) { //$NON-NLS-1$ //$NON-NLS-2$ - IConfigurationElement[] validValues = elem.getChildren("enumValues"); //$NON-NLS-1$ - List valuesList = new ArrayList(); - for (int j = 0; j < validValues.length; j++) { - String value = validValues[j].getAttribute("value"); //$NON-NLS-1$ - valuesList.add(value); - } - String[] validValuesArray = new String[valuesList.size()]; - validValuesArray = (String[]) valuesList.toArray(validValuesArray); - - tas.setValidValues(validValuesArray); - } - - if (use == null) { - tas.clearRequired(); - } else if (use.equalsIgnoreCase("required")) { //$NON-NLS-1$ - tas.setRequired(); - } else if (use.equalsIgnoreCase("optional")) { //$NON-NLS-1$ - tas.clearRequired(); - } else { - // Unlikely, unless annotation extension spec changes - // without changes here. - System.err.println(AnnotationsControllerResources.getString("AnnotationTagRegistry.9") + use); //$NON-NLS-1$ - return null; - } - - IConfigurationElement[] elemUniqueArray = elem.getChildren("unique"); //$NON-NLS-1$ - if (elemUniqueArray.length > 0) { - tas.setUnique(); - if (elemUniqueArray[0].getAttribute("scope") != null) //$NON-NLS-1$ - tas.getUnique().setScope(TagAttribSpec.uniqueScopeFromString(elemUniqueArray[0].getAttribute("scope"))); //$NON-NLS-1$ - if (elemUniqueArray.length > 1) { - Logger.getLogger().logError(AnnotationsControllerResources.getString("TagAttribSpec.2") + elemUniqueArray.length); //$NON-NLS-1$ - } - } else { - tas.clearUnique(); - } - - attribList.add(tas); - } - } - return tagInf; - } - - /** - * Return the tag set name from a full tag name. - * - * @param name - * Full tag name (without the '@' at the beginning) - * @return - */ - public static String tagSetFromTagName(String name) { - if (name == null) - return null; - int idx = name.lastIndexOf('.'); - - if (idx != -1) - return name.substring(0, idx); - return ""; //$NON-NLS-1$ - } - - /** - * Return the short name from a full tag name. - * - * @param name - * Full tag name (without the '@' at the beginning) - * @return - */ - public static String tagFromTagName(String name) { - if (name == null) - return null; - int idx = name.indexOf('.'); - - if (idx != -1) { - return name.substring(idx + 1); - } - // Default to the whole name being the tagset. - return name; - } - - /** - * Reads in all of the tag attribute information from all annotation-tag-info extensions defined - * in the system, and initializes the tagAttribs hashtable with them. - * - * @param registry - */ - private static void readAllAttributeInfo(IExtensionPoint xp) { - - if (xp == null) { - return; - } - - IExtension[] exts = xp.getExtensions(); - Bundle bundle = null; - for (int i = 0; i < exts.length; i++) { - IConfigurationElement[] elems = exts[i].getConfigurationElements(); - bundle = Platform.getBundle(exts[i].getNamespace()); - String identifier = exts[i].getUniqueIdentifier(); - - IConfigurationElement elem = null; - String tagName = null; - String scope = null; - String tagSet = null; - String fullTagName = null; - for (int j = 0; j < elems.length; j++) { - elem = elems[j]; - if (!elem.getName().equalsIgnoreCase("AnnotationTagInfo")) { //$NON-NLS-1$ - continue; - } - tagSet = elem.getAttribute("tagSet"); //$NON-NLS-1$ - tagName = elem.getAttribute("tagName"); //$NON-NLS-1$ - scope = elem.getAttribute("scope"); //$NON-NLS-1$ - if (isNullOrEmpty(tagSet) || isNullOrEmpty(tagName) || isNullOrEmpty(scope)) { - Logger.getLogger().log(AnnotationsControllerResources.getString("AnnotationTagRegistry.10", new Object[]{identifier})); //$NON-NLS-1$ //$NON-NLS-2$ - continue; - } - fullTagName = tagSet + "." + tagName; //$NON-NLS-1$ - - InitTagInfo tagInf = parseTagAttribs(elem.getChildren(), fullTagName.toLowerCase(), scope); //$NON-NLS-1$ - String key = (fullTagName + "#" + scope).toLowerCase(); //$NON-NLS-1$ - /* - * There should only ever be one AnnotationTagInfo tag for any one annotation tag. - */ - if (tagAttribs.containsKey(key)) { - Logger.getLogger().log(AnnotationsControllerResources.getString("AnnotationTagRegistry.0") + tagName + "'."); //$NON-NLS-1$ //$NON-NLS-2$ - } else { - tagInf.bundle = bundle; - tagAttribs.put(key, tagInf); - } - } - } - } - - private static boolean isNullOrEmpty(String aString) { - return aString == null || aString.length() == 0; - } - - /** - * Reads tagSpec information in from the plugin registry. Taken from AnnotationProcessor. - * - * @return True if initialization completed successfully. - * @throws CoreException - * If there were problems reading the registry. - */ - private static/* synchronized */boolean init() throws CoreException { - - /* Prevent multiple initialization */ - if (initialized) { - return true; - } - initializeStaticTagDefinitions(); - initiaizeDynamicTagDefinitions(); - initialized = true; - - /* Don't need this anymore */ - tagAttribs = null; - - return true; - } - - private static void initializeStaticTagDefinitions() throws CoreException { - IExtensionRegistry registry = Platform.getExtensionRegistry(); - - // TODO: Not even checking the tagset extension point yet. - IExtensionPoint xp = registry.getExtensionPoint(ANNOTATION_TAG_INFO); - - if (xp == null) - return; - - IExtension[] x = xp.getExtensions(); - - /* Get all tag attribute information */ - readAllAttributeInfo(xp); - for (int j = 0; j < x.length; j++) { - IConfigurationElement[] tagSpecs = x[j].getConfigurationElements(); - for (int i = 0; i < tagSpecs.length; i++) { - IConfigurationElement tagSpec = tagSpecs[i]; - String tagName = tagSpec.getAttribute("tagSet") + "." + tagSpec.getAttribute("tagName"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - String scope = tagSpec.getAttribute("scope"); //$NON-NLS-1$ - String multiplicity = tagSpec.getAttribute("multiplicity"); //$NON-NLS-1$ - TagSpec ts = null; - if (multiplicity != null) - ts = new TagSpec(tagName, TagSpec.scopeFromString(scope), TagSpec.multiplicityFromString(multiplicity)); - else - ts = new TagSpec(tagName, TagSpec.scopeFromString(scope), TagSpec.Multiplicity.ONE); - String key = (tagName + "#" + scope).toLowerCase(); //$NON-NLS-1$ - InitTagInfo tagInf = (InitTagInfo) tagAttribs.get(key); - - allTagSpecs.add(ts); - - if (tagInf != null) { - ts.setAttributes(tagInf.attributes); - ts.setBundle(tagInf.bundle); - } - } - } - } - - private static void initiaizeDynamicTagDefinitions() { - IExtensionPoint xp = Platform.getExtensionRegistry().getExtensionPoint(ANNOTATIONS_CONTROLLER_NAMESPACE, DYNAMIC_INITIALIZER_EX_PT); - if (xp == null) - return; - IExtension[] extensions = xp.getExtensions(); - for (int i = 0; i < extensions.length; i++) { - IExtension extension = extensions[i]; - IConfigurationElement[] elements = extension.getConfigurationElements(); - for (int j = 0; j < elements.length; j++) { - try { - AnnotationTagDynamicInitializer initializer = (AnnotationTagDynamicInitializer) elements[j].createExecutableExtension(CLASS_PROP); - initializer.registerTags(); - } catch (CoreException e) { - Logger.getLogger().logError(e); - } - } - } - } - - /** - * - * @return List of AnnotationTagRegistry.TagSpecs for all tags. - * @throws CoreException - * If there were problems reading the initialization data from the plugin registry. - */ - public static synchronized List getAllTagSpecs() { - return allTagSpecs; - } - - public static synchronized boolean isMethodTag(String tagName) { - return methodTags.containsKey(tagName); - } - - public static synchronized boolean isFieldTag(String tagName) { - return fieldTags.containsKey(tagName); - } - - public static synchronized boolean isTypeTag(String tagName) { - return typeTags.containsKey(tagName); - } - - /** - * Answers the tagspec for the specified method tag name. - * - * @param tagName - * Full name for a tag. - * @return a TagSpec for the tag name, or null if no tag with that name is registered. - */ - public static synchronized TagSpec getMethodTag(String tagName) { - return (TagSpec) methodTags.get(tagName); - } - - /** - * Answers the tagspec for the specified field tag name. - * - * @param tagName - * Full name for a tag. - * @return a TagSpec for the tag name, or null if no tag with that name is registered. - */ - public static synchronized TagSpec getFieldTag(String tagName) { - return (TagSpec) fieldTags.get(tagName); - } - - /** - * Answers the tagspec for the specified type tag name. - * - * @param tagName - * Full name for a tag. - * @return a TagSpec for the tag name, or null if no tag with that name is registered. - */ - public static synchronized TagSpec getTypeTag(String tagName) { - return (TagSpec) typeTags.get(tagName); - } - - private static class InitTagInfo { - private String name; - - private List attributes; - - private Bundle bundle; - - private String scope; - - public InitTagInfo(String name, String scope, List att) { - attributes = att; - this.name = name; - this.scope = scope; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object obj) { - if (this == obj) - return true; - else if (!(obj instanceof InitTagInfo)) - return false; - - return name.equals(((InitTagInfo) obj).name) || (scope.equals(((InitTagInfo) obj).name)); - - } - } - - static { - try { - AnnotationTagRegistry.init(); - } catch (CoreException e) { - Logger.getLogger().logError(AnnotationsControllerResources.getString("AnnotationTagRegistry_ERROR_1")); //$NON-NLS-1$ - Logger.getLogger().logError(e); - } - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/AnnotationTagsetRegistry.java b/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/AnnotationTagsetRegistry.java deleted file mode 100644 index d86e11748..000000000 --- a/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/AnnotationTagsetRegistry.java +++ /dev/null @@ -1,105 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Apr 7, 2004 - * - * To change the template for this generated file go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -package org.eclipse.jst.common.internal.annotations.registry; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.jem.util.RegistryReader; - -/** - * @author mdelder - * - * To change the template for this generated type comment go to Window - Preferences - Java - Code - * Generation - Code and Comments - */ -public class AnnotationTagsetRegistry extends RegistryReader { - - public static final AnnotationTagsetRegistry INSTANCE = new AnnotationTagsetRegistry(); - - private Map index; - - protected AnnotationTagsetRegistry() { - super("org.eclipse.wst.common.internal.annotations.controller", TagsetDescriptor.TAGSET); //$NON-NLS-1$ - readRegistry(); - } - - private List descriptors; - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.common.frameworks.internal.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement) - */ - public boolean readElement(IConfigurationElement element) { - if (TagsetDescriptor.TAGSET.equals(element.getName())) { - getDescriptors().add(new TagsetDescriptor(element)); - return true; - } - return false; - } - - public TagsetDescriptor getDescriptor(String name) { - if (name != null && name.length() > 0) { - - /* Index descriptors to avoid unnecessary searching */ - TagsetDescriptor descriptor = (TagsetDescriptor) getIndex().get(name); - if (descriptor != null) - return descriptor; - - for (Iterator itr = AnnotationTagsetRegistry.INSTANCE.getDescriptors().iterator(); itr.hasNext();) { - descriptor = (TagsetDescriptor) itr.next(); - if (name.equals(descriptor.getName())) { - getIndex().put(descriptor.getName(), descriptor); - return descriptor; - - } - } - } - return null; - } - - /** - * @return Returns the descriptors. - */ - protected List getDescriptors() { - if (descriptors == null) - descriptors = new ArrayList(); - return descriptors; - } - - /** - * @return Returns the index. - */ - protected Map getIndex() { - if (index == null) - index = new HashMap(); - return index; - } - - /** - * @param descriptor - */ - public void registerTagset(TagsetDescriptor descriptor) { - if (descriptor != null && getDescriptor(descriptor.getName()) == null) - getDescriptors().add(descriptor); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/AnnotationsControllerResources.java b/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/AnnotationsControllerResources.java deleted file mode 100644 index f357d90a1..000000000 --- a/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/AnnotationsControllerResources.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Mar 8, 2004 - * - * To change the template for this generated file go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ - -package org.eclipse.jst.common.internal.annotations.registry; - -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -/** - * @author kkatyal - * - * To change the template for this generated type comment go to Window - Preferences - Java - Code - * Generation - Code and Comments - */ -public class AnnotationsControllerResources { - - private static final String BUNDLE_NAME = "annotationcontroller";//$NON-NLS-1$ - private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME); - - /** - * - */ - private AnnotationsControllerResources() { - // Default constructor - } - - /** - * @param key - * @return - */ - public static String getString(String key) { - try { - return RESOURCE_BUNDLE.getString(key); - } catch (MissingResourceException e) { - return '!' + key + '!'; - } - } - - public static String getString(String key, Object[] args) { - try { - RESOURCE_BUNDLE.getString(key); - } catch (MissingResourceException e) { - return '!' + key + '!'; - } - - return MessageFormat.format(key, args); - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/AttributeValueProposalHelper.java b/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/AttributeValueProposalHelper.java deleted file mode 100644 index be5670b60..000000000 --- a/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/AttributeValueProposalHelper.java +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.common.internal.annotations.registry; - -/** - * @author DABERG - * - */ -public class AttributeValueProposalHelper { - private String replacementString; - private int valueOffset = 0; - private int replacementLength = 0; - private String valueDisplayString; - private boolean ensureBeginQuote = true; - private boolean ensureEndQuote = true; - - public AttributeValueProposalHelper(String replacementString, int valueOffset, int replacementLength, String valueDisplayString) { - this.replacementString = replacementString; - this.valueOffset = valueOffset; - this.replacementLength = replacementLength; - this.valueDisplayString = valueDisplayString; - } - - public int getReplacementLength() { - return replacementLength; - } - - public void setReplacementLength(int replacementLength) { - this.replacementLength = replacementLength; - } - - public String getReplacementString() { - return replacementString; - } - - public void setReplacementString(String replacementString) { - this.replacementString = replacementString; - } - - public String getValueDisplayString() { - return valueDisplayString; - } - - public void setValueDisplayString(String valueDisplayString) { - this.valueDisplayString = valueDisplayString; - } - - public int getValueOffset() { - return valueOffset; - } - - public void setValueOffset(int valueOffset) { - this.valueOffset = valueOffset; - } - - public boolean ensureBeginQuote() { - return ensureBeginQuote; - } - - public void setEnsureBeginQuote(boolean ensureBeginQuote) { - this.ensureBeginQuote = ensureBeginQuote; - } - - public boolean ensureEndQuote() { - return ensureEndQuote; - } - - public void setEnsureEndQuote(boolean ensureEndQuote) { - this.ensureEndQuote = ensureEndQuote; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/AttributeValuesHelper.java b/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/AttributeValuesHelper.java deleted file mode 100644 index 76c0a8f65..000000000 --- a/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/AttributeValuesHelper.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Jul 1, 2004 - */ -package org.eclipse.jst.common.internal.annotations.registry; - -import org.eclipse.jdt.core.IJavaElement; - -/** - * @author jlanuti - */ -public interface AttributeValuesHelper { - static final String[] EMPTY_VALUES = new String[0]; - static final AttributeValueProposalHelper[] EMPTY_PROPOSAL_HELPERS = new AttributeValueProposalHelper[0]; - - /** - * Return a simple String array containing the valid values for the given - * {@link TagAttributeSpec}and {@link IJavaElement}. - * - * @param tas - * @param javaElement - * @return - */ - public String[] getValidValues(TagAttribSpec tas, IJavaElement javaElement); - - /** - * This is a more advanced api for returning valid values for a given {@link TagAttribSpec}. - * This api provides you with more flexibility to control the replacement string that is used - * for the completion. - * - * @param tas - * @param partialValue - * @param valueOffset - * @param javaElement - * @return - */ - public AttributeValueProposalHelper[] getAttributeValueProposalHelpers(TagAttribSpec tas, String partialValue, int valueOffset, IJavaElement javaElement); - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/TagAttribSpec.java b/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/TagAttribSpec.java deleted file mode 100644 index 7b635906d..000000000 --- a/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/TagAttribSpec.java +++ /dev/null @@ -1,350 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Aug 25, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.common.internal.annotations.registry; - -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.common.internal.annotations.core.AnnotationsCoreResources; - -/** - * @author kelleyp Information on a single parameter for a tag. Parameters have names, and can be - * marked as being required. (ie, not optional) - */ -public class TagAttribSpec { - private String attribName; - private int flags; - private String helpKey; - private int type = Type.TEXT; - private static final int FLG_REQUIRED = 1; - private String[] validValues; - private TagSpec tagSpec; - - /* Enum for type */ - public interface Type { - public static final int TEXT = 0; - public static final int BOOLEAN = 1; - public static final int JAVATYPE = 2; - public static final int ENUM = 3; - } - - public class Unique { - public static final int MODULE = 0; - public static final int FILE = 1; - public static final int TYPE = 2; - public static final int METHOD = 3; - public static final int FIELD = 4; - - private int scope = MODULE; - - public int getScope() { - return scope; - } - - public void setScope(int in) { - scope = in; - } - } - - private Unique unique; - - public Unique getUnique() { - return unique; - } - - public boolean isUnique() { - return unique != null; - } - - public void setUnique() { - unique = new Unique(); - } - - public void clearUnique() { - unique = null; - } - - /** - * Converts a string representation of a tag attribute type to the integer representation. - * - * @param name - * @return Integer type, defaults to TEXT if the type name is not recognized. - */ - public static int typeNameToType(String name) { - //TODO add enum - if (name != null) { - if (name.equalsIgnoreCase("text") || name.equalsIgnoreCase("string")) { //$NON-NLS-1$ //$NON-NLS-2$ - return Type.TEXT; - } else if (name.equalsIgnoreCase("boolean") || name.equalsIgnoreCase("bool")) { //$NON-NLS-1$ //$NON-NLS-2$ - return Type.BOOLEAN; - } else if (name.equalsIgnoreCase("javaType")) { //$NON-NLS-1$ - return Type.JAVATYPE; - } - } - return Type.TEXT; - } - - /** - * Converts a type enum to a type string. - * - * @param ty - * @return - */ - public static String typeToTypeName(int ty) { - switch (ty) { - case Type.TEXT : - return "string"; //$NON-NLS-1$ - case Type.BOOLEAN : - return "bool"; //$NON-NLS-1$ - case Type.JAVATYPE : - return "javaType"; //$NON-NLS-1$ - default : - return "string"; //$NON-NLS-1$ - } - } - - /** - * Constructs a TagAttribSpec with <code>name</code> as the attribute name. - * - * @param name - * Name for the attribute. Must not be null. - * @throws IllegalArgumentException - * if name is null. - */ - public TagAttribSpec(String name) throws IllegalArgumentException { - this(name, null); - } - - public TagAttribSpec(String name, String hlpKey) { - setAttribName(name); - setHelpKey(hlpKey); - } - - /** - * Sets the type of this attribute. - * - * @param t - * TEXT | BOOLEAN - */ - public void setType(int t) { - type = t; - } - - /** - * Sets the type of this attribute. - * - * @param typename - * String representation, should be text or boolean. - */ - public void setType(String typename) { - type = typeNameToType(typename); - } - - public int getType() { - return type; - } - - public boolean valueIsJavaType() { - return type == Type.JAVATYPE; - } - - public boolean valueIsText() { - return type == Type.TEXT; - } - - public boolean valueIsBool() { - return type == Type.BOOLEAN; - } - - /** - * @return Name of the attribute. - */ - public String getAttribName() { - return attribName; - } - - /** - * Sets the attribute name. This can not be null. - * - * @param name - * New name for the attribute. - * @throws IllegalArgumentException - * if the name is null. - */ - public void setAttribName(String name) throws IllegalArgumentException { - if (name == null) { - throw new IllegalArgumentException(AnnotationsCoreResources.getString("TagAttribSpec.6")); //$NON-NLS-1$ - } - attribName = name; - } - - /** - * - * @return true if this is a required attribute. - */ - public boolean isRequired() { - return (flags & FLG_REQUIRED) != 0; - } - - /** - * Sets the required flag for this attribute. - */ - public void setRequired() { - flags |= FLG_REQUIRED; - } - - /** - * Clears the required flag for this attribute. - * - */ - public void clearRequired() { - flags &= (~FLG_REQUIRED); - } - - /** - * - * @return The help key for this tag attribute. Should never return null. - */ - public String getTextKey(int aType) { - if (aType != TagSpec.HELP_TEXT) { - return null; - } - - if (helpKey == null) { - helpKey = defaultHelpKey(); - } - return helpKey; - } - - /** - * Formats the help text so it includes type and use information. - */ - public String transformLocalizedText(String txt) { - if (txt == null) - return txt; - StringBuffer buf = new StringBuffer(txt.length() + 50); - - buf.append("<b>Type: "); //$NON-NLS-1$ - buf.append(typeToTypeName(type)); - buf.append(", Use: "); //$NON-NLS-1$ - if (this.isRequired()) { - buf.append("required"); //$NON-NLS-1$ - } else { - buf.append("optional"); //$NON-NLS-1$ - } - if (this.isUnique()) { - buf.append(", unique:scope: "); //$NON-NLS-1$ - buf.append(TagAttribSpec.uniqueScopeToString(this.getUnique().getScope())); //$NON-NLS-1$ - } - buf.append("</b><p>"); //$NON-NLS-1$ - buf.append(txt); - buf.append("</p>"); //$NON-NLS-1$ - return buf.toString(); - - } - - /** - * - * @return The help key for this tag attribute. Should never return null. - */ - public String getHelpKey() { - return getTextKey(TagSpec.HELP_TEXT); - } - - /** - * Sets the help key. Setting this to null resets the help key to the default help key. - * - * @param key - */ - public void setHelpKey(String key) { - helpKey = key; - } - - /** - * @return the default help key name for this tag. - * - */ - private String defaultHelpKey() { - return "ath." + attribName; //$NON-NLS-1$ - } - - public static int uniqueScopeFromString(String scopeStr) { - if (scopeStr != null) { - if (scopeStr.equalsIgnoreCase("module"))return TagAttribSpec.Unique.MODULE; //$NON-NLS-1$ - if (scopeStr.equalsIgnoreCase("file"))return TagAttribSpec.Unique.FILE; //$NON-NLS-1$ - if (scopeStr.equalsIgnoreCase("type"))return TagAttribSpec.Unique.TYPE; //$NON-NLS-1$ - if (scopeStr.equalsIgnoreCase("method"))return TagAttribSpec.Unique.METHOD; //$NON-NLS-1$ - if (scopeStr.equalsIgnoreCase("field"))return TagAttribSpec.Unique.FIELD; //$NON-NLS-1$ - } - Logger.getLogger().logError(AnnotationsControllerResources.getString("TagAttribSpec.1") + scopeStr); //$NON-NLS-1$ - return TagAttribSpec.Unique.MODULE; - } - - public static String uniqueScopeToString(int scope) { - switch (scope) { - case TagAttribSpec.Unique.MODULE : - return "module"; //$NON-NLS-1$ - case TagAttribSpec.Unique.FILE : - return "file"; //$NON-NLS-1$ - case TagAttribSpec.Unique.TYPE : - return "type"; //$NON-NLS-1$ - case TagAttribSpec.Unique.METHOD : - return "method"; //$NON-NLS-1$ - case TagAttribSpec.Unique.FIELD : - return "field"; //$NON-NLS-1$ - default : - Logger.getLogger().logError(AnnotationsControllerResources.getString("TagAttribSpec.1") + scope); //$NON-NLS-1$ - return "unknown value"; //$NON-NLS-1$ - - } - } - - /** - * @return Returns the validValues. - */ - public String[] getValidValues() { - return validValues; - } - - /** - * @param validValues - * The validValues to set. - */ - public void setValidValues(String[] validValues) { - this.validValues = validValues; - } - - public TagSpec getTagSpec() { - return tagSpec; - } - - void setTagSpec(TagSpec tagSpec) { - this.tagSpec = tagSpec; - } - - public String lookupTagHelp() throws MissingResourceException { - ResourceBundle b = getTagSpec().getResourceBundle(); - if (b == null) - return null; - String key = getHelpKey(); - String val = b.getString(getHelpKey()); - if (val == key) - val = null; - return transformLocalizedText(val); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/TagSpec.java b/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/TagSpec.java deleted file mode 100644 index 70ee7270e..000000000 --- a/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/TagSpec.java +++ /dev/null @@ -1,331 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Aug 22, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.common.internal.annotations.registry; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Status; -import org.osgi.framework.Bundle; - -/** - * All of the information in a single tagSpec tag, including the enclosing handler. - */ -public class TagSpec { - - /** - * Handle to the descriptor of the plugin that declared the completion information for this tag, - * if any. - */ - Bundle bundle; - - protected ResourceBundle resourceBundle; - - private boolean attemptedToFindResourceBundle = false; - - private AttributeValuesHelper validValuesHelper; - private TagsetDescriptor tagsetDescriptor; - - /** - * Name of the tag. - */ - private String tagName; - - /** - * Scope of the tag: METHOD | FIELD | TYPE - */ - private int scope; - - /** - * Multiplicity of the tag: ONE | MANY - */ - private int multiplicity; - - /** - * Attributes that can be set for this tag. (Instances of TagAttribSpec) - */ - private List attributes = new ArrayList(); - - private String helpKey; - - /** - * Text type for use with localized text container. - */ - public static final int HELP_TEXT = 0; - - public static final int METHOD = 0; - - public static final int TYPE = 1; - - public static final int FIELD = 2; - - public interface Multiplicity { - public static final int ONE = 1; - - public static final int MANY = 2; - } - - public TagSpec(String aName, int aScope, int aMultiplicity) { - tagName = aName; - scope = aScope; - multiplicity = aMultiplicity; - } - - public static int scopeFromString(String s) throws CoreException { - if (s != null) { - if (s.equalsIgnoreCase("type")) { //$NON-NLS-1$ - return TagSpec.TYPE; - } else if (s.equalsIgnoreCase("field")) { //$NON-NLS-1$ - return TagSpec.FIELD; - } else if (s.equalsIgnoreCase("method")) { //$NON-NLS-1$ - return TagSpec.METHOD; - } else { - // Should be impossible unless the annotation-taghandler.exsd or - // calling code changes. - //TODO: Logging - throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.wst.common.internal.annotations.controller", IStatus.OK, AnnotationsControllerResources.getString("TagSpec.3") + s, null)); //$NON-NLS-1$ //$NON-NLS-2$ - } - } - throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.wst.common.internal.annotations.controller", IStatus.OK, AnnotationsControllerResources.getString("TagSpec.4"), null)); //$NON-NLS-1$ //$NON-NLS-2$ - - } - - public static int multiplicityFromString(String s) throws CoreException { - if (s != null) { - if (s.equalsIgnoreCase("1")) { //$NON-NLS-1$ - return TagSpec.Multiplicity.ONE; - } else if (s.equalsIgnoreCase("*")) { //$NON-NLS-1$ - return TagSpec.Multiplicity.MANY; - } - throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.wst.common.internal.annotations.controller", IStatus.OK, AnnotationsControllerResources.getString("TagSpec.4"), null)); //$NON-NLS-1$ //$NON-NLS-2$ - } - //Return default - return TagSpec.Multiplicity.ONE; - } - - /** - * @return Scope for tag, METHOD | TYPE | FIELD - */ - public int getScope() { - return scope; - } - - /** - * @return multiplicity for tag, ONE | MANY - */ - public int getMultiplicity() { - return multiplicity; - } - - /** - * @return Name of the tag - */ - public String getTagName() { - return tagName; - } - - public TagsetDescriptor getTagSetDescriptor() { - if (tagsetDescriptor == null) { - String tagSetName = getTagName(); - int index = tagSetName.lastIndexOf('.'); - if (index == -1) - tagSetName = ""; //$NON-NLS-1$ - else - tagSetName = tagSetName.substring(index + 1); - tagsetDescriptor = AnnotationTagsetRegistry.INSTANCE.getDescriptor(tagSetName); - } - return tagsetDescriptor; - } - - /** - * Sets the scope of this tag. - * - * @param i - * METHOD | TYPE | FIELD - */ - public void setScope(int i) { - scope = i; - } - - /** - * Sets the multiplicity of this tag. - * - * @param i - * ONE | MANY - */ - public void setMultiplicity(int i) { - multiplicity = i; - } - - /** - * Sets the name of the tag - * - * @param string - * Name for the tag. - */ - public void setTagName(String string) { - tagName = string; - } - - /** - * - * @return List of attributes for this tag. - */ - public List getAttributes() { - return attributes; - } - - /** - * Adds an attribute to the list of attributes for this tag. - * - * @param att - * A TagAttribSpec - */ - public void addAttribute(TagAttribSpec att) { - if (att == null) - return; - attributes.add(att); - att.setTagSpec(this); - } - - /** - * Sets the list of attributes for this tag. - * - * @param lst - * An array list of TagAttribSpecs - */ - public void setAttributes(List lst) { - if (lst == null) - attributes.clear(); - else { - attributes = lst; - for (int i = 0; i < lst.size(); i++) { - TagAttribSpec tas = (TagAttribSpec) lst.get(i); - tas.setTagSpec(this); - } - } - } - - /** - * Looks for attribute named <code>attName</code>. Case insensitive. - * - * @param attName - * Name to look for - * @return A TagAttribSpec, or null if none was found. - */ - public TagAttribSpec attributeNamed(String attName) { - Iterator i = getAttributes().iterator(); - - while (i.hasNext()) { - TagAttribSpec tas = (TagAttribSpec) i.next(); - - if (attName.equalsIgnoreCase(tas.getAttribName())) { - return tas; - } - } - return null; - - } - - /** - * @return Returns the declaringPlugin. - */ - public Bundle getBundle() { - return bundle; - } - - /** - * @param declaringPlugin - * The declaringPlugin to set. - */ - protected void setBundle(Bundle bundle) { - this.bundle = bundle; - } - - /** - * @return Returns the resourceBundle. - */ - public ResourceBundle getResourceBundle() { - if (resourceBundle == null && !attemptedToFindResourceBundle) { - attemptedToFindResourceBundle = true; - Bundle aBundle = getBundle(); - if (aBundle != null) - resourceBundle = Platform.getResourceBundle(bundle); - } - return resourceBundle; - } - - /** - * @param resourceBundle - * The resourceBundle to set. - */ - public void setResourceBundle(ResourceBundle resourceBundle) { - attemptedToFindResourceBundle = false; - this.resourceBundle = resourceBundle; - } - - /** - * @return Returns the validValuesHelper. - */ - public AttributeValuesHelper getValidValuesHelper() { - if (validValuesHelper == null && getTagSetDescriptor() != null) - setValidValuesHelper(getTagSetDescriptor().getValidValuesHelper()); - return validValuesHelper; - } - - /** - * @param validValuesHelper - * The validValuesHelper to set. - */ - public void setValidValuesHelper(AttributeValuesHelper validValuesHelper) { - this.validValuesHelper = validValuesHelper; - } - - public String getHelpKey() { - if (helpKey == null) - helpKey = computeHelpKey(); - return helpKey; - } - - /** - * @return - */ - protected String computeHelpKey() { - return "tagh." + getTagName(); //$NON-NLS-1$ - } - - public void setHelpKey(String helpKey) { - this.helpKey = helpKey; - } - - public String lookupTagHelp() throws MissingResourceException { - ResourceBundle b = getResourceBundle(); - if (b == null) - return null; - String key = getHelpKey(); - String val = b.getString(getHelpKey()); - if (val == key) - val = null; - return val; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/TagsetDescriptor.java b/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/TagsetDescriptor.java deleted file mode 100644 index 8e4c4da60..000000000 --- a/plugins/org.eclipse.jst.common.annotations.controller/controller/org/eclipse/jst/common/internal/annotations/registry/TagsetDescriptor.java +++ /dev/null @@ -1,146 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Apr 7, 2004 - * - * To change the template for this generated file go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -package org.eclipse.jst.common.internal.annotations.registry; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.runtime.IConfigurationElement; - - -/** - * @author mdelder - * - * To change the template for this generated type comment go to Window - Preferences - Java - Code - * Generation - Code and Comments - */ -public class TagsetDescriptor { - - public static final String TAGSET = "AnnotationTagSet"; //$NON-NLS-1$ - public static final String ATT_NAME = "name"; //$NON-NLS-1$ - public static final String ATT_DISPLAY_NAME = "displayName"; //$NON-NLS-1$ - public static final String ATT_DESCRIPTION = "description"; //$NON-NLS-1$ - public static final String ATT_PARENT_TAGSET = "parentTagset"; //$NON-NLS-1$ - public static final String ATT_VALID_VALUES_HELPER = "validValuesHelper"; //$NON-NLS-1$ - - private final IConfigurationElement element; - - protected String name; - protected String displayName; - protected String description; - protected String parentTagset; - protected AttributeValuesHelper validValuesHelper; - - protected TagsetDescriptor() { - element = null; - } - - public TagsetDescriptor(IConfigurationElement element) { - this.element = element; - init(); - } - - /** - * - */ - private void init() { - this.name = this.element.getAttribute(ATT_NAME); - this.displayName = this.element.getAttribute(ATT_DISPLAY_NAME); - this.description = this.element.getAttribute(ATT_DESCRIPTION); - this.parentTagset = this.element.getAttribute(ATT_PARENT_TAGSET); - // set the valid values helper if there is one - try { - String validValuesHelperName = this.element.getAttribute(ATT_VALID_VALUES_HELPER); - if (validValuesHelperName != null) { - Class loaded = Class.forName(validValuesHelperName); - this.validValuesHelper = (AttributeValuesHelper) loaded.newInstance(); - } - } catch (Exception e) { - // Do nothing - } - } - - /** - * @return Returns the description. - */ - public String getDescription() { - return description; - } - - /** - * @return Returns the displayName. - */ - public String getDisplayName() { - return displayName; - } - - /** - * @return Returns the element. - */ - public IConfigurationElement getElement() { - return element; - } - - /** - * @return Returns the name. - */ - public String getName() { - return name; - } - - /** - * @return Returns the parentTagset. - */ - public String getParentTagset() { - return parentTagset; - } - - public TagsetDescriptor[] getDirectDependents() { - - if (getName() == null || getName().equals("")) //$NON-NLS-1$ - return new TagsetDescriptor[0]; - - List dependents = new ArrayList(); - - TagsetDescriptor descriptor = null; - for (Iterator itr = AnnotationTagsetRegistry.INSTANCE.getDescriptors().iterator(); itr.hasNext();) { - descriptor = (TagsetDescriptor) itr.next(); - if (getName().equals(descriptor.getParentTagset())) - dependents.add(descriptor); - } - - TagsetDescriptor[] descriptors = new TagsetDescriptor[dependents.size()]; - dependents.toArray(descriptors); - return descriptors; - } - - /** - * @return Returns the validValuesHelper. - */ - public AttributeValuesHelper getValidValuesHelper() { - return validValuesHelper; - } - - /** - * @param validValuesHelper - * The validValuesHelper to set. - */ - public void setValidValuesHelper(AttributeValuesHelper validValuesHelper) { - this.validValuesHelper = validValuesHelper; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.common.annotations.controller/plugin.xml b/plugins/org.eclipse.jst.common.annotations.controller/plugin.xml deleted file mode 100644 index ce9f8782e..000000000 --- a/plugins/org.eclipse.jst.common.annotations.controller/plugin.xml +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.0"?> -<plugin - id="org.eclipse.jst.common.annotations.controller" - name="Annotation Controller Plug-in" - description="This plugin provides the framework for the annotations controller which manages any added annotation builders." - version="1.0.0" - provider-name="Eclipse.org"> - - <runtime> - <library name="controller.jar"> - <export name="*"/> - </library> - </runtime> - - <requires> - <import plugin="org.eclipse.core.runtime"/> - <import plugin="org.eclipse.core.resources"/> - <import plugin="org.eclipse.emf.ecore"/> - <import plugin="org.eclipse.wst.common.frameworks"/> - <import plugin="org.eclipse.jdt.core"/> - <import plugin="org.eclipse.wst.common.emf"/> - <import plugin="org.eclipse.jst.common.annotations.core"/> - <import plugin="org.eclipse.jem.util"/> - </requires> - - - <extension-point id="annotationsController" name="Annotations Controller" schema="schema/annotationsController.exsd"/> - <extension-point id="AnnotationTagInfo" name="annotation tag info" schema="schema/annotation-tag-info.exsd"/> - <extension-point id="AnnotationTagSet" name="annotation tagset" schema="schema/annotation.tagset.exsd"/> - <extension-point id="annotationTagDynamicInitializer" name="annotationTagDynamicInitializer" schema="schema/annotationTagDynamicInitializer.exsd"/> -</plugin> diff --git a/plugins/org.eclipse.jst.common.annotations.controller/prepareforpii.xml b/plugins/org.eclipse.jst.common.annotations.controller/prepareforpii.xml deleted file mode 100644 index 833fffa60..000000000 --- a/plugins/org.eclipse.jst.common.annotations.controller/prepareforpii.xml +++ /dev/null @@ -1,36 +0,0 @@ -<project name="PrepareForPII" default="main" basedir="."> - - <!-- Setup temp variables --> - <target name="init"> - <property name="nlsDir" value="d:/NLS/Corona/0526"/> - <property name="plugin" value="com.ibm.wtp.annotations.controller"/> - <property name="plugindir" value="d:/workspaceCorona/${plugin}"/> - <property name="outputDir" value="${nlsDir}/${plugin}"/> - - - </target> - - <!-- Create the destination dir --> - <target name="nlsDir" depends="init"> - <mkdir dir="${nlsDir}"/> - </target> - - <!-- Create the destination dir --> - <target name="plugindir" depends="nlsDir"> - <delete dir="${outputDir}"/> - <mkdir dir="${outputDir}"/> - </target> - - <!-- Move the files to the correct locations in the workspace. --> - <target name="main" depends="plugindir"> - - <messageIdGen folderPath = "${plugindir}" componentId = "E" /> - - <copy todir = "${outputDir}/property_files" > - <fileset dir="${plugindir}/property_files"> - <include name="**/*.properties"/> - </fileset> - </copy> - - </target> -</project> diff --git a/plugins/org.eclipse.jst.common.annotations.controller/property_files/annotationcontroller.properties b/plugins/org.eclipse.jst.common.annotations.controller/property_files/annotationcontroller.properties deleted file mode 100644 index 390e7736b..000000000 --- a/plugins/org.eclipse.jst.common.annotations.controller/property_files/annotationcontroller.properties +++ /dev/null @@ -1,23 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2004 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -TagSpec.3=Unknown tag scope: -TagSpec.4=Null tag scope. -TagSpec.5=Unknown tag multiplicity: -TagSpec.6=Null tag multiplicity. -TagAttribSpec.1=Unknown 'unique' scope value: -TagAttribSpec.1=More than one 'unique' tag defined: -AnnotationTagParser.0=Null event handler. -AnnotationTagParser.1= -AnnotationTagRegistry.0=More than one 'AnnotationTagInfo' tag for the tag ' -AnnotationTagRegistry.9=parseTagAttribs: unknown 'use' value: -AnnotationTagRegistry.10=Incomplete element AnnotationTagInfo in plugin {0} -AnnotationTagRegistry.11=parseTagAttribs: unknown 'isJavaTypeIdentifier' value: -AnnotationsControllerManager_ERROR_0=IWAE0001E Invalid IConfigurationElement used to create AnnotationsControllerRegistry.Descriptor. diff --git a/plugins/org.eclipse.jst.common.annotations.controller/schema/annotation-tag-info.exsd b/plugins/org.eclipse.jst.common.annotations.controller/schema/annotation-tag-info.exsd deleted file mode 100644 index 3bdae47d5..000000000 --- a/plugins/org.eclipse.jst.common.annotations.controller/schema/annotation-tag-info.exsd +++ /dev/null @@ -1,251 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.common.annotations.controller">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jst.common.annotations.controller" id="XAnnotationTagInfo" name="Annotation Tag Info"/>
- </appInfo>
- <documentation>
- Describes the tags contained by a tag set and the tag's attributes.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="AnnotationTagInfo" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="AnnotationTagInfo">
- <complexType>
- <sequence>
- <element ref="attrib" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="tagSet" type="string" use="required">
- <annotation>
- <documentation>
- Name of the tag set this tag comes underneath. ( for instance, if we're defining the <code>@ejb.bean</code> -tag, then the tag set would be <code>ejb</code>. ) The tag set must have been defined using the annotation.tagset extension point.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="tagName" type="string" use="required">
- <annotation>
- <documentation>
- Name of the tag. ( if we're defining the <code>@ejb.bean</code> tag, then the tagName would be <code>bean</code> ).
- </documentation>
- </annotation>
- </attribute>
- <attribute name="scope" use="required">
- <annotation>
- <documentation>
- Scope of the bean. Must be <code>type</code>,<code>method</code>, or <code>field</code>.
- </documentation>
- </annotation>
- <simpleType>
- <restriction base="string">
- <enumeration value="type">
- </enumeration>
- <enumeration value="method">
- </enumeration>
- <enumeration value="field">
- </enumeration>
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="multiplicity" use="default" value="1">
- <annotation>
- <documentation>
- Multiplicity of the tagset. Must be <code>1</code> or<code>*</code>. The default value is 1, if not specified.
- </documentation>
- </annotation>
- <simpleType>
- <restriction base="string">
- <enumeration value="1">
- </enumeration>
- <enumeration value="*">
- </enumeration>
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="description" type="string">
- <annotation>
- <documentation>
- Optional description. May be a description string, or a -key to localized text for the description in the declaring plugin's resource bundle. No default if this is -not specified.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="attrib">
- <complexType>
- <sequence>
- <element ref="unique" minOccurs="0" maxOccurs="1"/>
- <element ref="enumValues" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- Name of the attribute.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="description" type="string">
- <annotation>
- <documentation>
- Description text for the attribute, or key pointing to the localized description text inside of the declaring plugin's resource bundle. If not specified, defaults to <code>ath.ATTRIBUTE_NAME</code>.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="use" use="default" value="optional">
- <annotation>
- <documentation>
- Sets whether this tag is <code>optional</code> or <code>required</code>. The default is <code>optional</code>.
- </documentation>
- </annotation>
- <simpleType>
- <restriction base="string">
- <enumeration value="optional">
- </enumeration>
- <enumeration value="required">
- </enumeration>
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="type" use="default" value="string">
- <annotation>
- <documentation>
- Type of the attribute, <code>string|boolean|javaType</code>. Defaults to <code>string</code> if not specified.
- </documentation>
- </annotation>
- <simpleType>
- <restriction base="string">
- <enumeration value="string">
- </enumeration>
- <enumeration value="bool">
- </enumeration>
- <enumeration value="javaType">
- </enumeration>
- <enumeration value="enum">
- </enumeration>
- </restriction>
- </simpleType>
- </attribute>
- </complexType>
- </element>
-
- <element name="unique">
- <annotation>
- <documentation>
- Specifies that the attribute value is unique within the specified scope.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="scope" use="default" value="module">
- <annotation>
- <documentation>
- The scope of the uniqueness for the attribute value. It is one of the <code>module</code>, <code>file</code>, <code>type</code>, <code>method</code>,or <code>field</code>. The default value is 'module'.
- </documentation>
- </annotation>
- <simpleType>
- <restriction base="string">
- <enumeration value="module">
- </enumeration>
- <enumeration value="file">
- </enumeration>
- <enumeration value="type">
- </enumeration>
- <enumeration value="method">
- </enumeration>
- <enumeration value="field">
- </enumeration>
- </restriction>
- </simpleType>
- </attribute>
- </complexType>
- </element>
-
- <element name="enumValues">
- <complexType>
- <attribute name="value" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.jst.common.annotations.controller/schema/annotation.tagset.exsd b/plugins/org.eclipse.jst.common.annotations.controller/schema/annotation.tagset.exsd deleted file mode 100644 index 4f459bec0..000000000 --- a/plugins/org.eclipse.jst.common.annotations.controller/schema/annotation.tagset.exsd +++ /dev/null @@ -1,134 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.common.annotations.controller">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jst.common.annotations.controller" id="pXAnnotationTagset" name="Annotations Tag Set"/>
- </appInfo>
- <documentation>
- Allows clients to define a tag set for an annotation -tag. A tag set named X would contain all of the tags that -look like <code>@X.tag</code>. So the <code>ejb</code> -tag set would contain the <code>@ejb.bean</code> tag, -the <code>@ejb.persistence</code> tag, the <code>@ejb.pk</code> tag, etc...
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="AnnotationTagSet" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="AnnotationTagSet">
- <complexType>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- Name of the tagset. The name for the tagset that contains the <code>@ejb.bean</code> tag would be <code>ejb</code>.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="displayName" type="string">
- <annotation>
- <documentation>
- The text of the display name for the tag, or a resource -key pointing to the localized display name inside of the -declaring plugin's resource bundle.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="description" type="string">
- <annotation>
- <documentation>
- A description of the tag set. Can be the text of the -description, or a key for the declaring plugin's resource bundle that points to the localized text for the tag set description.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="parentTagset" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="validValuesHelper" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.jst.common.annotations.controller/schema/annotationTagDynamicInitializer.exsd b/plugins/org.eclipse.jst.common.annotations.controller/schema/annotationTagDynamicInitializer.exsd deleted file mode 100644 index 1f999e18e..000000000 --- a/plugins/org.eclipse.jst.common.annotations.controller/schema/annotationTagDynamicInitializer.exsd +++ /dev/null @@ -1,102 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Schema file written by PDE --> -<schema targetNamespace="com.ibm.wtp.annotations.controller"> -<annotation> - <appInfo> - <meta.schema plugin="com.ibm.wtp.annotations.controller" id="annotationTagDynamicInitializer" name="annotationTagDynamicInitializer"/> - </appInfo> - <documentation> - This extension point is used to allow for clients to define their annotation tags dynamically. This means that it is not necessary to statically define annotation tags using the tag-info extension point. The extensions for this point will be called just after initializing the static annotation tags from the tag-info extension point. - </documentation> - </annotation> - - <element name="extension"> - <complexType> - <sequence> - <element ref="initializer"/> - </sequence> - <attribute name="id" type="string"> - <annotation> - <documentation> - - </documentation> - </annotation> - </attribute> - <attribute name="point" type="string" use="required"> - <annotation> - <documentation> - - </documentation> - </annotation> - </attribute> - <attribute name="name" type="string"> - <annotation> - <documentation> - - </documentation> - <appInfo> - <meta.attribute translatable="true"/> - </appInfo> - </annotation> - </attribute> - </complexType> - </element> - - <element name="initializer"> - <complexType> - <attribute name="class" type="string" use="required"> - <annotation> - <documentation> - Set the qualified name of a class that implements the com.ibm.wtp.annotations.registry.AnnotationTagDynamicInitializer interface. This class must have a default constructor. - </documentation> - </annotation> - </attribute> - </complexType> - </element> - - <annotation> - <appInfo> - <meta.section type="since"/> - </appInfo> - <documentation> - [Enter the first release in which this extension point appears.] - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="examples"/> - </appInfo> - <documentation> - [Enter extension point usage example here.] - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="apiInfo"/> - </appInfo> - <documentation> - [Enter API information here.] - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="implementation"/> - </appInfo> - <documentation> - [Enter information about supplied implementation of this extension point.] - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="copyright"/> - </appInfo> - <documentation> - - </documentation> - </annotation> - -</schema> diff --git a/plugins/org.eclipse.jst.common.annotations.controller/schema/annotationsController.exsd b/plugins/org.eclipse.jst.common.annotations.controller/schema/annotationsController.exsd deleted file mode 100644 index dc3e5e135..000000000 --- a/plugins/org.eclipse.jst.common.annotations.controller/schema/annotationsController.exsd +++ /dev/null @@ -1,106 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.common.annotations.controller">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jst.common.annotations.controller" id="annotationsController" name="Annotations Controller"/>
- </appInfo>
- <documentation>
- The annotationsController is used in generating annotated beans.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="annotationsController" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="annotationsController">
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- The id is used to coordinate precedence using function groups so this must be consistent with the function group bindings.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- This is the name of the extension class defined by the extension
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
-</schema>
|