Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common')
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/JSFCommonPlugin.java332
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/dom/TagIdentifier.java131
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/ITestTracker.java40
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/JSPUtil.java87
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/resource/IResourceLifecycleListener.java76
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/resource/LifecycleListener.java365
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/resource/ResourceLifecycleEvent.java95
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/BooleanLiteralType.java76
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/CompositeType.java172
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/CompositeTypeCoercer.java124
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/FloatLiteralType.java65
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/IAssignable.java49
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/IntegerLiteralType.java73
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/LiteralType.java80
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/Messages.java42
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/MethodType.java56
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/NullLiteralType.java110
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/NumericTypeLiteral.java89
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/SignatureBasedType.java34
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/StringLiteralType.java131
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeCoercer.java127
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeCoercionException.java58
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeComparator.java234
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeConstants.java114
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeInfo.java100
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeInfoCache.java543
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeTransformer.java213
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeUtil.java52
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/ValueType.java238
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/messages.properties16
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/Entity.java163
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/EntityGroup.java29
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/IncludeEntityGroup.java89
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/MetadataFactory.java90
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/MetadataPackage.java892
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/Model.java128
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/Trait.java129
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/AbstractMetaDataLocator.java68
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/AbstractTagLibDomainContentModelMetaDataTranslator.java289
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/DomainLoadingStrategy.java177
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/DomainLoadingStrategyRegistry.java175
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/DomainSourceModelTypeDescriptor.java245
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/DomainSourceTypesRegistry.java144
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IClassLoaderProvider.java22
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IDomainLoadingStrategy.java42
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IDomainSourceModelType.java35
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IImageDescriptorProvider.java25
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataChangeNotificationEvent.java45
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataLocator.java54
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataModelMergeAssistant.java67
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataObservable.java35
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataObserver.java24
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataSourceModelProvider.java34
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataTranslator.java23
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IPathSensitiveMetaDataLocator.java24
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IResourceBundleProvider.java23
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IStandardMetaDataSourceInfo.java32
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/JSPTagLibDomainLoadingStrategy.java41
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/Messages.java40
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataChangeNotificationEvent.java58
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataLocatorFactory.java88
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataModel.java117
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataModelContextImpl.java41
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataModelManager.java254
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataModelMergeAssistantImpl.java373
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/ModelKeyDescriptor.java70
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/ModelNotSetException.java20
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/PluginRelativeStandardMetaDataSourceFileLocator.java83
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/ResourceBundleHelper.java72
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardMetaDataFileInfo.java75
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardMetaDataFileRegistry.java259
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardMetaDataFileRegistryReader.java95
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardMetaDataFilesTranslator.java73
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardMetaDataLocator.java46
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardMetaDataSourceFileLocator.java64
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardModelFactory.java127
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/TaglibDomainMetaDataModelContextImpl.java57
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/TraitValueHelper.java201
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/EntityGroupImpl.java49
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/EntityImpl.java415
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/IncludeEntityGroupImpl.java219
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/MetadataFactoryImpl.java239
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/MetadataPackageImpl.java604
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/ModelImpl.java270
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/TraitImpl.java328
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/messages.properties13
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/util/MetadataAdapterFactory.java200
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/util/MetadataResourceFactoryImpl.java59
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/util/MetadataResourceImpl.java128
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/util/MetadataSwitch.java233
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/util/MetadataXMLProcessor.java57
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/package-info.java17
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/AbstractEntityQueryVisitor.java31
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/AbstractEntityVisitor.java30
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/AbstractMetaDataVisitor.java28
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/AbstractResultSet.java69
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/AbstractTraitQueryVisitor.java31
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/AbstractTraitVisitor.java29
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/EmptyResultSet.java39
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/IEntityQueryVisitor.java30
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/IEntityVisitor.java34
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/IMetaDataModelContext.java25
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/IMetaDataVisitor.java24
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/IResultSet.java44
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/ITaglibDomainMetaDataModelContext.java30
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/ITraitQueryVisitor.java30
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/ITraitVisitor.java34
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/MetaDataException.java49
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/TaglibDomainMetaDataQueryHelper.java211
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/internal/HierarchicalSearchControl.java65
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/internal/SearchControl.java58
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/internal/SimpleEntityQueryVisitorImpl.java178
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/internal/SimpleResultSet.java45
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/internal/SimpleTraitQueryVisitorImpl.java111
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/ListOfValues.java55
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/SetGenerator.java83
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/TraitTypesFactory.java64
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/TraitTypesPackage.java264
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/impl/ListOfValuesImpl.java157
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/impl/SetGeneratorImpl.java222
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/impl/TraitTypesFactoryImpl.java117
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/impl/TraitTypesPackageImpl.java277
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/util/TraitTypesAdapterFactory.java144
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/util/TraitTypesResourceFactoryImpl.java62
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/util/TraitTypesResourceImpl.java39
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/util/TraitTypesSwitch.java161
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/util/TraitTypesXMLProcessor.java58
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/AxiomaticSet.java88
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/AxiomaticSetUtil.java109
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/ConcreteAxiomaticSet.java58
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/NodeSet.java131
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/constraint/AbstractMemberConstraint.java29
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/constraint/AbstractSetConstraint.java79
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/mapping/AbstractObjectInjectiveSetMapping.java75
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/mapping/AxiomaticSetMapping.java35
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/mapping/ObjectInjectiveSetMapping.java70
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/util/JDTBeanIntrospector.java212
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/util/JDTBeanProperty.java250
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/util/JDTBeanPropertyWorkingCopy.java163
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/util/TypeUtil.java591
140 files changed, 0 insertions, 16928 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/JSFCommonPlugin.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/JSFCommonPlugin.java
deleted file mode 100644
index 83e040791..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/JSFCommonPlugin.java
+++ /dev/null
@@ -1,332 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.ILog;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.common.EMFPlugin;
-import org.eclipse.emf.common.util.ResourceLocator;
-import org.eclipse.jst.jsf.context.symbol.source.AbstractContextSymbolFactory;
-import org.eclipse.jst.jsf.context.symbol.source.ISymbolSourceProvider;
-import org.eclipse.jst.jsf.context.symbol.source.ISymbolSourceProviderFactory;
-import org.osgi.framework.Bundle;
-
-/**
- * This is the central singleton for the My edit plugin.
- * <!-- begin-user-doc -->
- * This class is not API.
- * <!-- end-user-doc -->
- * @generated
- */
-public final class JSFCommonPlugin extends EMFPlugin {
-
- /**
- * Plugin id
- */
- public static final String PLUGIN_ID = "org.eclipse.jst.jsf.common"; //$NON-NLS-1$
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright 2006 Oracle"; //$NON-NLS-1$
-
- private static List<ISymbolSourceProviderFactory> registeredSymbolSourceProviders;
- private static Map<String,AbstractContextSymbolFactory> registeredSymbolFactories;
-
- private final static String FACTORY_ATTRIBUTE_NAME = "factory"; //$NON-NLS-1$
- private final static String FACTORY_ATTRIBUTE_ID_NAME = "factoryId"; //$NON-NLS-1$
- private final static String SYMBOL_SOURCE_ID = "symbolSourceId"; //$NON-NLS-1$
- private final static String CONTEXT_SYMBOL_FACTORY = "contextSymbolFactory"; //$NON-NLS-1$
- /**
- * Keep track of the singleton.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final JSFCommonPlugin INSTANCE = new JSFCommonPlugin();
-
- /**
- * Keep track of the singleton.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static Implementation plugin;
-
- /**
- * Create the instance.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public JSFCommonPlugin() {
- super
- (new ResourceLocator [] {
- });
- }
-
- /**
- * Returns the singleton instance of the Eclipse plugin.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the singleton instance.
- * @generated
- */
- public ResourceLocator getPluginResourceLocator() {
- return plugin;
- }
-
- /**
- * Returns the singleton instance of the Eclipse plugin.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the singleton instance.
- * @generated
- */
- public static Implementation getPlugin() {
- return plugin;
- }
-
- /**
- * @param e
- * @param msg
- */
- public static void log(final Exception e, final String msg) {
- final ILog log = getPlugin().getLog();
-
- log.log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, e));
- }
-
- /**
- * Logs using the default ILog implementation provided by getLog().
- *
- * @param severity Severity (IStatus constant) of log entry
- * @param message Human-readable message describing log entry
- * @param ex Throwable instance (can be null)
- */
- public static void log(int severity, String message, Throwable ex) {
- getPlugin().getLog().log(new Status(severity, PLUGIN_ID, IStatus.OK, message, ex));
- }
-
- /**
- * Logs using the default ILog implementation provided by getLog().
- *
- * @param severity Severity (IStatus constant) of log entry
- * @param message Human-readable message describing log entry
- */
- public static void log(int severity, String message) {
- log(severity, message, null);
- }
- /**
- * @return all registered symbol source providers
- */
- public static ISymbolSourceProvider[] getSymbolSourceProvider()
- {
- return registeredSymbolSourceProviders.toArray(new ISymbolSourceProvider[0]);
- }
-
- /**
- * @return all registered symbol source providers
- */
- public synchronized static List<ISymbolSourceProviderFactory> getSymbolSourceProviders()
- {
- if (registeredSymbolSourceProviders == null)
- {
- registerProviders();
- if (registeredSymbolSourceProviders == null)
- {
- throw new AssertionError("registerProviders failed"); //$NON-NLS-1$
- }
- }
- return Collections.unmodifiableList(registeredSymbolSourceProviders);
- }
-
- private static void registerProviders()
- {
- final IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(plugin.getBundle().getSymbolicName(), Implementation.SYMBOL_SOURCE_EXT_ID);
- final IExtension[] extensions = point.getExtensions();
- registeredSymbolSourceProviders = new ArrayList<ISymbolSourceProviderFactory>(extensions.length);
-
- for (int i = 0; i < extensions.length; i++)
- {
- final IExtension extension = extensions[i];
- final IConfigurationElement[] elements =
- extension.getConfigurationElements();
- final String bundleId = extension.getContributor().getName();
-
- for (int j = 0; j < elements.length; j++)
- {
- final IConfigurationElement element = elements[j];
- if (SYMBOL_SOURCE_ID.equals(element.getName())
- && element.getAttribute(FACTORY_ATTRIBUTE_NAME) != null)
- {
- String factoryClassName = element.getAttribute(FACTORY_ATTRIBUTE_NAME);
- final Bundle bundle = Platform.getBundle(bundleId);
-
- if (bundle != null)
- {
- try
- {
- Class factoryClass = bundle.loadClass(factoryClassName);
-
- ISymbolSourceProviderFactory factory =
- (ISymbolSourceProviderFactory) factoryClass.newInstance();
-
- registeredSymbolSourceProviders.add(factory);
- }
- catch (Exception e)
- {
- plugin.log(new Status(IStatus.ERROR, plugin.getBundle().getSymbolicName(), 0, "Error loading symbol provider extension point",e)); //$NON-NLS-1$
- }
- }
- }
- }
- }
- }
-
- /**
- * @return the list of registed symbol factories
- */
- public synchronized static Map<String, AbstractContextSymbolFactory> getSymbolFactories()
- {
- if (registeredSymbolFactories == null)
- {
- registerSymbolFactories();
- if (registeredSymbolFactories == null)
- {
- throw new AssertionError("registerProviders failed"); //$NON-NLS-1$
- }
- }
- return Collections.unmodifiableMap(registeredSymbolFactories);
- }
-
- private static void registerSymbolFactories()
- {
- final IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(plugin.getBundle().getSymbolicName(), Implementation.SYMBOL_FACTORY_EXT_ID);
- final IExtension[] extensions = point.getExtensions();
- registeredSymbolFactories = new HashMap<String, AbstractContextSymbolFactory>(extensions.length);
-
- for (int i = 0; i < extensions.length; i++)
- {
- final IExtension extension = extensions[i];
- final IConfigurationElement[] elements =
- extension.getConfigurationElements();
- final String bundleId = extension.getContributor().getName();
-
- for (int j = 0; j < elements.length; j++)
- {
- final IConfigurationElement element = elements[j];
- if (CONTEXT_SYMBOL_FACTORY.equals(element.getName())
- && element.getAttribute(FACTORY_ATTRIBUTE_NAME) != null)
- {
- final String factoryClassName = element.getAttribute(FACTORY_ATTRIBUTE_NAME);
- final String factoryId = element.getAttribute(FACTORY_ATTRIBUTE_ID_NAME);
- final Bundle bundle = Platform.getBundle(bundleId);
-
- if (bundle != null)
- {
- try {
- Class factoryClass = bundle.loadClass(factoryClassName);
-
- AbstractContextSymbolFactory factory =
- (AbstractContextSymbolFactory) factoryClass.newInstance();
- registeredSymbolFactories.put(factoryId, factory);
- } catch (InstantiationException e) {
- plugin.log(new Status(IStatus.ERROR, plugin.getBundle().getSymbolicName(), 0, "Error loading symbol factory extension point",e)); //$NON-NLS-1$
- } catch (IllegalAccessException e) {
- plugin.log(new Status(IStatus.ERROR, plugin.getBundle().getSymbolicName(), 0, "Error loading symbol factory extension point",e)); //$NON-NLS-1$
- } catch (ClassNotFoundException e) {
- plugin.log(new Status(IStatus.ERROR, plugin.getBundle().getSymbolicName(), 0, "Error loading symbol factory extension point",e)); //$NON-NLS-1$
- }
- }
- }
- }
- }
- }
-
- /**
- * Logs an exception in this plugin to the error log
- *
- * @param t
- */
- public static void log(Throwable t)
- {
- ILog log = getPlugin().getLog();
- IStatus status = new Status(IStatus.ERROR, getPlugin().getSymbolicName(), 0, "Caught exception", t); //$NON-NLS-1$
- log.log(status);
- }
-
- /**
- * The actual implementation of the Eclipse <b>Plugin</b>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static class Implementation extends EclipsePlugin
- {
- /**
- * Name of the symbolSourceProvider ext point
- */
- public static final String SYMBOL_SOURCE_EXT_ID = "symbolSourceProvider"; //$NON-NLS-1$
- /**
- * Local identifier for the symbol factory extension point
- */
- public static final String SYMBOL_FACTORY_EXT_ID = "contextSymbolFactory"; //$NON-NLS-1$
- /**
- * Creates an instance.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Implementation() {
- super();
-
- // Remember the static instance.
- //
- plugin = this;
- }
- }
-
-
- /**
- * Utility method returning class from class name using classloader from specified bundle
- * @param className
- * @param bundleId
- * @return Class
- */
- public static Class<?> loadClass(String className, String bundleId) {
- Class<?> aClass = null;
- try {
- if (bundleId != null){
- Bundle bundle = Platform.getBundle(bundleId);
- if (bundle != null){
- aClass = bundle.loadClass(className);
- }
- }
- } catch (ClassNotFoundException e) {
- log(e);
- }
- return aClass;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/dom/TagIdentifier.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/dom/TagIdentifier.java
deleted file mode 100644
index 3d675a69d..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/dom/TagIdentifier.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.dom;
-
-import javax.xml.namespace.QName;
-
-
-/**
- * Creates an abstraction for a tag. A tag is defined as a DOM Element whose
- * namespace uri may be defined outside of the DOM, such as in a JSP tag library
- * declaration. This allows tags to be abstracted from actual DOM elements, which
- * is useful in situations like palette creation drops where the construction information
- * is known, but we are not ready to create and add a node to the document yet.
- *
- * All tag TagIdentifier<i>s</i> should be considered immutable and idempotent.
- * TagIdentifier instances may be cached by the factory.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author cbateman
- *
- */
-public abstract class TagIdentifier
-{
- /**
- * @return the uri that uniquely identifies the tag.
- *
- * i.e.
- *
- * If the tag is defined by an XML namespace, then that uri string will be returned.
- * If the tag is defined by a JSP tag library, then the tag library uri should
- * be returned.
- */
- public abstract String getUri();
-
- /**
- * @return the local name of the tag (without namespace prefix)
- */
- public abstract String getTagName();
-
- /**
- * @return true if this tag is a JSP tag
- */
- public abstract boolean isJSPTag();
-
- public final boolean equals(Object compareTo)
- {
- if (compareTo instanceof TagIdentifier)
- {
- return isSameTagType((TagIdentifier) compareTo);
- }
- return false;
- }
-
- public final int hashCode()
- {
- // use toLowerCase to ensure equals matches
- int hashCode = getTagName().toLowerCase().hashCode();
-
- String uri = getUri();
- if (uri != null)
- {
- hashCode ^= uri.hashCode();
- }
- return hashCode;
- }
-
- /**
- * @param tagWrapper
- * @return true if tagWrapper represents the same tag as this.
- */
- public final boolean isSameTagType(TagIdentifier tagWrapper)
- {
- if (tagWrapper == this)
- {
- return true;
- }
-
- final String uri = tagWrapper.getUri();
-
- if (uri == null)
- {
- if (getUri() != null)
- {
- return false;
- }
- }
- else if (uri.equals(getUri()))
- {
- final String tagName = tagWrapper.getTagName();
-
- if (tagName == null)
- {
- if(getTagName() != null)
- {
- return false;
- }
- }
- else
- {
- // uri and tag name must both the same for it to be the same type
- // TODO: the ignore case thing is dependent on the type of container document
- // Use toLower instead of equalsIgnoreCase to ensure that hashCode generates
- // a hashCode that guarantees x.equals(y) => x.hashCode == y.hashCode
- if (tagName.toLowerCase().equals((getTagName().toLowerCase())))
- {
- return true;
- }
- }
- }
-
- // fall-through, not same
- return false;
- }
-
- /**
- * @return the QName equivalent. Returns a new object on every invocation.
- */
- public final QName asQName()
- {
- return new QName(getUri(), getTagName());
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/ITestTracker.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/ITestTracker.java
deleted file mode 100644
index a3369aa0e..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/ITestTracker.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.eclipse.jst.jsf.common.internal;
-
-/**
- * An injection interface that allows classes to selectively report test progress.
- *
- * @author cbateman
- *
- */
-public interface ITestTracker
-{
- /**
- * Event types
- *
- */
- public enum Event
- {
- /**
- * Signals that tracking should begin on the eventLabel
- * The seqId must be repeated on the STOP_TRACKING event
- * for the same event.
- */
- START_TRACKING,
- /**
- * Signals that tracking should stop on the named event
- * for the seqId that was passed first in the START_TRACKING.
- *
- */
- STOP_TRACKING
- }
-
- /**
- * Fires the event of type event, a unique instance tracking seqId
- * and a label called eventLabel.
- *
- * @param event
- * @param seqId
- * @param eventLabel
- */
- void fireEvent(Event event, long seqId, String eventLabel);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/JSPUtil.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/JSPUtil.java
deleted file mode 100644
index ef830ff36..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/JSPUtil.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package org.eclipse.jst.jsf.common.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-
-/**
- * Utility JSP methods
- * @author cbateman
- *
- */
-public final class JSPUtil
-{
- private final static String CTYPE_JSPSOURCE =
- "org.eclipse.jst.jsp.core.jspsource"; //$NON-NLS-1$
- private final static String CTYPE_JSPFRAGMENTSOURCE =
- "org.eclipse.jst.jsp.core.jspfragmentsource"; //$NON-NLS-1$
- /**
- * @param contentType
- * @return true if contentType is one of the content types registered
- * for JSP files
- */
- public static boolean isJSPContentType(final String contentType)
- {
- return CTYPE_JSPSOURCE.equals(contentType)
- || CTYPE_JSPFRAGMENTSOURCE.equals(contentType);
- }
-
- /**
- * @param file
- * @return true if file is associated with a JSP or JSP fragment content type
- */
- public static boolean isJSPContentType(final IFile file)
- {
- final boolean isJSPSource = isJSPSource(file);
- if (isJSPSource)
- {
- return true;
- }
-
- final boolean isJSPFragment = isJSPFragment(file);
-
- if (isJSPFragment)
- {
- return true;
- }
-
- return false;
- }
-
- private JSPUtil()
- {
- // no instantiation
- }
-
- /**
- * @param file
- * @return true if file is associated with the JSP source content type
- * (returns if JSP fragment)
- */
- public static boolean isJSPSource(IFile file) {
- return isAssociatedWithContentType(file, CTYPE_JSPSOURCE);
- }
-
- /**
- * @param file
- * @return true if the file is associated with the JSP fragment content type
- */
- public static boolean isJSPFragment(IFile file) {
- return isAssociatedWithContentType(file, CTYPE_JSPFRAGMENTSOURCE);
- }
-
- private static boolean isAssociatedWithContentType(final IFile file, final String contentType)
- {
- final IContentTypeManager typeManager = Platform.getContentTypeManager();
- IContentType jspContentType =
- typeManager.getContentType(contentType);
- if (jspContentType != null
- && jspContentType.isAssociatedWith(file.getName()))
- {
- return true;
- }
-
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/resource/IResourceLifecycleListener.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/resource/IResourceLifecycleListener.java
deleted file mode 100644
index a3ab30fb7..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/resource/IResourceLifecycleListener.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package org.eclipse.jst.jsf.common.internal.resource;
-
-/**
- * Listener can register for events ona particular LifecycleListener
- *
- * @author cbateman
- *
- */
-public interface IResourceLifecycleListener
-{
- /**
- * Listener accepts the resource lifecycle event
- *
- * @param event
- * @return the result of accepting the event
- */
- EventResult acceptEvent(ResourceLifecycleEvent event);
-
- /**
- * @author cbateman
- *
- */
- public static class EventResult
- {
- private static EventResult DEFAULT;
-
- /**
- * @return an event result with defaults initialized
- */
- public static EventResult getDefaultEventResult()
- {
- if (DEFAULT == null)
- {
- DEFAULT = new EventResult();
- }
- return DEFAULT;
- }
-
- private static EventResult DISPOSE_AFTER_EVENT;
-
- /**
- * @return an event result with default except dispose after
- * is set
- */
- public static EventResult getDisposeAfterEventResult()
- {
- if (DISPOSE_AFTER_EVENT == null)
- {
- DISPOSE_AFTER_EVENT = new EventResult();
- DISPOSE_AFTER_EVENT.setDisposeAfterEvent(true);
- }
- return DISPOSE_AFTER_EVENT;
- }
-
- /**
- * set to true if after the current event is finished firing, the source
- * should be disposed. If self-disposal is not applicable, the flag is ignored
- */
- protected boolean _disposeAfterEvent;
-
- /**
- * @return the remove listener flag
- */
- public boolean getDisposeAfterEvent()
- {
- return _disposeAfterEvent;
- }
-
- /**
- * @param disposeAfterEvent
- */
- protected void setDisposeAfterEvent(boolean disposeAfterEvent) {
- _disposeAfterEvent = disposeAfterEvent;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/resource/LifecycleListener.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/resource/LifecycleListener.java
deleted file mode 100644
index 6e99b5204..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/resource/LifecycleListener.java
+++ /dev/null
@@ -1,365 +0,0 @@
-package org.eclipse.jst.jsf.common.internal.resource;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jst.jsf.common.internal.ITestTracker;
-import org.eclipse.jst.jsf.common.internal.ITestTracker.Event;
-import org.eclipse.jst.jsf.common.internal.resource.IResourceLifecycleListener.EventResult;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent.EventType;
-import org.eclipse.jst.jsf.common.internal.resource.ResourceLifecycleEvent.ReasonType;
-
-/**
- * Listens to resource changes and fires lifecycle events
- *
- * @author cbateman
- *
- */
-public class LifecycleListener implements IResourceChangeListener
-{
- private final static boolean ENABLE_TEST_TRACKING = false;
- private static long _seqId;
-
- private final List<IResource> _resources;
- private final List<IResourceLifecycleListener> _listeners;
- private boolean _isDisposed = false;
- private ITestTracker _testTracker; // == null; initialized by setter injection
-
- /**
- * Initialize an inactive lifecycle listener. A workspace listener will not
- * be installed by this constructor. The object created using this constructor
- * will not fire any events until addResource is called at least once to add
- * a target resource
- */
- public LifecycleListener()
- {
- _resources = new ArrayList<IResource>();
- _listeners = new ArrayList<IResourceLifecycleListener>(1);
- }
-
- /**
- * Create a new lifecycle listener for the res
- * @param res
- */
- public LifecycleListener(IResource res)
- {
- this();
- _resources.add(res);
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
- }
-
- /**
- * @param resources
- */
- public LifecycleListener(List<IResource> resources)
- {
- this();
- _resources.addAll(resources);
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
- }
-
-
- /**
- * @param testTracker
- */
- public final void setTestTracker(ITestTracker testTracker)
- {
- _testTracker = testTracker;
- }
-
- /**
- * @param res
- */
- public void addResource(final IResource res)
- {
- synchronized(_resources)
- {
- int preSize = _resources.size();
- if (!_resources.contains(res))
- {
- _resources.add(res);
- }
-
- // if the size of the array was 0
- // and is now greater, make sure the listener is added
- if (preSize == 0
- && _resources.size() > 0)
- {
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
- }
- }
- }
-
- /**
- * @param res
- */
- public void removeResource(final IResource res)
- {
- synchronized(_resources)
- {
- _resources.remove(res);
-
- // if there are no longer target resources,
- // remove the workspace listener
- if (_resources.size() == 0)
- {
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
- }
- }
- }
-
- /**
- * Release the resource change listener
- */
- public void dispose()
- {
- if (!_isDisposed)
- {
- // remove first to minimize the chance that the listener will
- // be triggered during the remainder of dispose
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
-
- // don't clear the listener list currently because of
- // concurrent change problems.
-
- _isDisposed = true;
- }
- }
-
- /**
- * @return true if the listener has been disposed
- */
- public boolean isDisposed() {
- return _isDisposed;
- }
-
- /**
- * Adds listener to the list of objects registered to receive
- * lifecycle events for this resource. Only adds the listener
- * if it is not already in the list.
- *
- * Method is thread-safe and may block the caller
- *
- * Throws {@link IllegalStateException} if isDisposed() == true
- *
- * @param listener
- */
- public void addListener(IResourceLifecycleListener listener)
- {
- if (isDisposed())
- {
- throw new IllegalStateException();
- }
-
- synchronized(_listeners)
- {
- if (!_listeners.contains(listener))
- {
- _listeners.add(listener);
- }
- }
- }
-
- /**
- * Removes listener from the list of registered listeners
- *
- * Method is thread-safe and may block the caller
- *
- * Throws {@link IllegalStateException} if isDisposed() == true
- *
- * @param listener
- */
- public void removeListener(IResourceLifecycleListener listener)
- {
- if (isDisposed())
- {
- throw new IllegalStateException();
- }
-
- synchronized(_listeners)
- {
- _listeners.remove(listener);
- }
- }
-
- public void resourceChanged(IResourceChangeEvent event)
- {
- long seqId = _seqId++;
-
- if (ENABLE_TEST_TRACKING && _testTracker != null)
- {
- _testTracker.fireEvent(Event.START_TRACKING, seqId, "trackMethod_resourceChanged");
- }
-
- assert(!isDisposed());
-
- switch(event.getType())
- {
- case IResourceChangeEvent.PRE_CLOSE:
- {
- final IProject proj = (IProject) event.getResource();
-
- synchronized(_resources)
- {
- final List<IResource> resources = copyResourceList();
- for (final IResource res : resources)
- {
- if (proj == res || proj == res.getProject())
- {
- fireLifecycleEvent(
- new ResourceLifecycleEvent(res, EventType.RESOURCE_INACCESSIBLE, ReasonType.RESOURCE_PROJECT_CLOSED));
- }
- }
- }
- }
- break;
-
- case IResourceChangeEvent.PRE_DELETE:
- {
- IProject proj = (IProject) event.getResource();
-
- synchronized(_resources)
- {
- final List<IResource> resources = copyResourceList();
- for (final IResource res : resources)
- {
- // if the resource being tracked is the resource being deleted,
- // then fire a resource delete event
- if (proj == res)
- {
- fireLifecycleEvent(new ResourceLifecycleEvent(res, EventType.RESOURCE_INACCESSIBLE, ReasonType.RESOURCE_DELETED));
- }
- // if the resource being tracked is a resource in the project being
- // deleted, then fire a project deleted event
- else if (proj == res.getProject())
- {
- fireLifecycleEvent(
- new ResourceLifecycleEvent(res, EventType.RESOURCE_INACCESSIBLE, ReasonType.RESOURCE_PROJECT_DELETED));
- }
- }
- }
- }
- break;
-
- case IResourceChangeEvent.POST_CHANGE:
- {
- synchronized(_resources)
- {
- final List<IResource> resources = copyResourceList();
- for (final IResource res : resources)
- {
- // only bother continuing if the resource we are tracking
- // is not a project since post-change events on projects
- // that we care about won't occur
- if (res.getType() != IResource.PROJECT)
- {
- IResourceDelta delta = event.getDelta();
-
-// long seqId2 = _seqId++;
-// if (ENABLE_TEST_TRACKING && _testTracker != null)
-// {
-// _testTracker.fireEvent(Event.START_TRACKING, seqId2, "testFindMember");
-// }
- // only care about post change events to resources
- // that we are tracking
- delta = delta.findMember(res.getFullPath());
-
- if (delta != null)
- {
- visit(delta);
- }
-
-// if (ENABLE_TEST_TRACKING && _testTracker != null)
-// {
-// _testTracker.fireEvent(Event.STOP_TRACKING, seqId2, "testFindMember");
-// }
- }
- }
- }
- }
- break;
-
- default:
- // do nothing
- // we only handle these three
- }
-
- if (ENABLE_TEST_TRACKING && _testTracker != null)
- {
- _testTracker.fireEvent(Event.STOP_TRACKING, seqId, "trackMethod_resourceChanged");
- }
- }
-
- private List<IResource> copyResourceList()
- {
- synchronized(_resources)
- {
- List<IResource> resList = new ArrayList<IResource>(_resources.size());
- resList.addAll(_resources);
- return resList;
- }
- }
-
- private void fireLifecycleEvent(ResourceLifecycleEvent event)
- {
- List<IResourceLifecycleListener> copyListeners
- = new ArrayList(_listeners.size());
-
- // copy the listeners to avoid concurrent modification problems
- // if a listeners removes itself due to an event
- synchronized(_listeners)
- {
- copyListeners.addAll(_listeners);
- }
-
- boolean disposeAfter = false;
-
- for (final IResourceLifecycleListener listener : copyListeners)
- {
- EventResult result = listener.acceptEvent(event);
- disposeAfter |= result.getDisposeAfterEvent();
- }
-
- if (disposeAfter)
- {
- dispose();
- }
- }
-
- private void visit(IResourceDelta delta)
- {
- assert(!isDisposed());
-
- final IResource res = delta.getResource();
-
- switch (delta.getKind())
- {
- case IResourceDelta.CHANGED:
- {
- // the contents of the file have changed
- if ((delta.getFlags() & IResourceDelta.CONTENT) != 0)
- {
- fireLifecycleEvent(
- new ResourceLifecycleEvent
- (res, EventType.RESOURCE_CHANGED
- , ReasonType.RESOURCE_CHANGED_CONTENTS));
- }
- }
- break;
- case IResourceDelta.REMOVED:
- {
- fireLifecycleEvent(
- new ResourceLifecycleEvent
- (res, EventType.RESOURCE_INACCESSIBLE
- , ReasonType.RESOURCE_DELETED));
- }
- break;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/resource/ResourceLifecycleEvent.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/resource/ResourceLifecycleEvent.java
deleted file mode 100644
index 81f6ff684..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/resource/ResourceLifecycleEvent.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package org.eclipse.jst.jsf.common.internal.resource;
-
-import org.eclipse.core.resources.IResource;
-
-/**
- * @author cbateman
- *
- */
-public class ResourceLifecycleEvent
-{
- /**
- * the type of lifecycle event
- * this enum is not closed and may add new fields in the future
- */
- public enum EventType
- {
- /**
- * Indicates that the resource is no longer accessible (as testable with
- * IResource.isAccessible). The reasonType will indicate why.
- */
- RESOURCE_INACCESSIBLE,
-
- /**
- * Indicates that the resource being tracked has changed in some
- * way, use ReasonType to determine specifics
- */
- RESOURCE_CHANGED;
- }
-
- /**
- * encodes the cause of the event if the event type provides one
- * this enum is not closed and may add new fields in the future
- */
- public enum ReasonType
- {
- /**
- * The resource was deleted from the workspace,
- * this event is pre change if the event is project
- * and post change otherwise
- */
- RESOURCE_DELETED,
- /**
- * The resource's project was deleted. This event is
- * pre-change. Note that if the tracked resource is
- * a project, RESOURCE_DELETED will be fired, not this
- * event.
- */
- RESOURCE_PROJECT_DELETED,
- /**
- * The resource's project was closed. This event is pre-change
- */
- RESOURCE_PROJECT_CLOSED,
- /**
- * Occurs when the contents of a non-project resource has changed
- */
- RESOURCE_CHANGED_CONTENTS
- }
-
- private final IResource _affectedResource;
- private final EventType _eventType;
- private final ReasonType _reasonType;
-
- /**
- * @param affectedResource
- * @param eventType
- * @param reasonType
- */
- public ResourceLifecycleEvent(IResource affectedResource, EventType eventType, ReasonType reasonType)
- {
- _affectedResource = affectedResource;
- _eventType = eventType;
- _reasonType = reasonType;
- }
-
- /**
- * @return the affected resource
- */
- public IResource getAffectedResource() {
- return _affectedResource;
- }
-
- /**
- * @return the event that has occurred
- */
- public EventType getEventType() {
- return _eventType;
- }
-
- /**
- * @return the cause of the event
- */
- public ReasonType getReasonType() {
- return _reasonType;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/BooleanLiteralType.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/BooleanLiteralType.java
deleted file mode 100644
index 6055e5f50..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/BooleanLiteralType.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.internal.types;
-
-import org.eclipse.jdt.core.Signature;
-
-/**
- * Represents a BooleanLiteral as defined by JSP.2.9
- *
- * @author cbateman
- *
- */
-public class BooleanLiteralType extends LiteralType
-{
- /**
- * The literal FALSE singleton
- */
- public final static BooleanLiteralType FALSE = new BooleanLiteralType(false);
- /**
- * The literal TRUE singleton
- */
- public final static BooleanLiteralType TRUE = new BooleanLiteralType(true);
-
- private final boolean _literalValue;
-
-
- /**
- * @param value
- * @return a constant boolean literal type corresponding to value
- */
- public static BooleanLiteralType valueOf(boolean value)
- {
- return value ? TRUE : FALSE;
- }
-
- /**
- * @param literalValue
- */
- /*package*/BooleanLiteralType(boolean literalValue)
- {
- super(Signature.SIG_BOOLEAN);
- _literalValue = literalValue;
- }
-
- public Number coerceToNumber(Class T) throws TypeCoercionException
- {
- // illegal to coerce boolean to number per JSP.2.8.3 step 3
- throw new TypeCoercionException("Cannot coerce boolean to number"); //$NON-NLS-1$
- }
-
- public String getLiteralValue()
- {
- return Boolean.toString(_literalValue);
- }
-
- public Object getLiteralValueRaw()
- {
- return Boolean.valueOf(_literalValue);
- }
-
- public Boolean coerceToBoolean() throws TypeCoercionException
- {
- return Boolean.valueOf(_literalValue);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/CompositeType.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/CompositeType.java
deleted file mode 100644
index 9069f056d..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/CompositeType.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.internal.types;
-
-import org.eclipse.jdt.core.Signature;
-
-
-/**
- * Encapsulates the runtime type or types of a JSF entity in a
- * way that can be compared to other entities
- *
- * @author cbateman
- *
- */
-public class CompositeType
-{
- private final String[] _signatures;
- private final int _assignmentType;
-
- private boolean[] _isTypeSignature; // = null lazily derived from signatures
- // on first access
- /**
- * @param signatureStrings
- * @param assignmentType
- */
- public CompositeType(String[] signatureStrings, int assignmentType)
- {
- if (signatureStrings == null
- || signatureStrings.length < 1)
- {
- throw new AssertionError("Must specify at least one signature string"); //$NON-NLS-1$
- }
-
- _signatures = new String[signatureStrings.length];
- System.arraycopy(signatureStrings, 0, _signatures, 0, _signatures.length);
- _assignmentType = assignmentType;
- }
-
- /**
- * Convenience constructor for most common case where composite only
- * consistes of a single type signature
- *
- * @param signatureString
- * @param assignmentType
- */
- public CompositeType(String signatureString, int assignmentType)
- {
- this(new String[]{signatureString}, assignmentType);
- }
- /**
- * @return the assignment type mask
- */
- public int getAssignmentTypeMask()
- {
- return _assignmentType;
- }
-
- /**
- * @return true if the composite type supports being on the LHS of an
- * assignment
- */
- public boolean isLHS()
- {
- return TypeUtil.matchesLHS(_assignmentType);
- }
-
- /**
- * @return true if the composite type supports being on the RHS of an
- * assignment
- */
- public boolean isRHS()
- {
- return TypeUtil.matchesRHS(_assignmentType);
- }
-
- /**
- * @return an array of booleans. The value in each index of the array
- * is true if the corresponding position _signatures corresponds to a type
- * signature and false if it's a method signature
- */
- public boolean[] getIsTypeSignature()
- {
- return getTypeSignatureFlags();
- }
-
- /**
- * @return the type signatures. Changes to the returned form do not
- * affect the internal values
- */
- public String[] getSignatures()
- {
- final String[] copy = new String[_signatures.length];
- System.arraycopy(_signatures, 0, copy, 0, _signatures.length);
- return copy;
- }
-
- public String toString()
- {
- final StringBuffer stringBuffer = new StringBuffer();
-
- for (int i = 0; i < _signatures.length; i++)
- {
- stringBuffer.append(_signatures[i]);
- stringBuffer.append(" | "); //$NON-NLS-1$
- }
-
- return stringBuffer.toString();
- }
-
- /**
- * @return a version of to string with of the type signatures replaced
- * with their more Javaeseque names
- */
- public String toUserReadableString()
- {
- final StringBuffer stringBuffer = new StringBuffer();
-
- for (int i = 0; i < _signatures.length; i++)
- {
- final String signature = _signatures[i];
-
- if (getTypeSignatureFlags()[i])
- {
- stringBuffer.append(Signature.getSignatureSimpleName(signature));
- }
-
- if (i < _signatures.length -1)
- {
- stringBuffer.append(", "); //$NON-NLS-1$
- }
- }
- return stringBuffer.toString();
- }
-
- private boolean[] getTypeSignatureFlags()
- {
- if (_isTypeSignature == null)
- {
- _isTypeSignature = new boolean[_signatures.length];
-
- for (int i = 0; i < _signatures.length; i++)
- {
- try
- {
- Signature.getTypeSignatureKind(_signatures[i]);
-
- // if an exception wasn't thrown above, then it
- // is some sort of type signature
- _isTypeSignature[i] = true;
- }
- catch (IllegalArgumentException ae)
- {
- // getTypeSignatureKind threw an exception, so
- // this signature is a method
- _isTypeSignature[i] = false;
- }
- }
- }
-
- return _isTypeSignature;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/CompositeTypeCoercer.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/CompositeTypeCoercer.java
deleted file mode 100644
index 5f2aff492..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/CompositeTypeCoercer.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.internal.types;
-
-
-/**
- * Follows type coercion rules codified in section JSP.2.8 of the
- * JSP 2.0 Specification.
- *
- * This class operates on CompositeType's and returns raw
- * Java signatures for the single resulting type coercion.
- *
- * The rules are stretched a little bit since JSP.2.8 defines how to
- * coerce an *instance* A to a type T. But since we have no runtime instances,
- * only their types, we approximate by taking what we know about the type of A
- * and coercing it T as best we can.
- *
- * Also, whereas the spec says to throw errors when coercion is not possible,
- * we have two cases:
- *
- * 1) We can determine definitively that there is no coercion
- * 2) We cannot determine whether there is or isn't a coercion
- *
- * In case 1, we always throw an exception. In case 2, we return null to indicate
- * "indeterminate" result, rather than error.
- *
- * @author cbateman
- *
- */
-public class CompositeTypeCoercer
-{
- /**
- * This method follows JSP.2.8.3 except that rather than returning a specific
- * type that has been coerced to, it determines the most exact possible type
- * that typeOfA can be coerced to, to be number compatible. The caller must
- * decide what do with the return value compared to the type (N in the spec)
- * that they want to coerce to.
- *
- * @param typeOfA
- * @return a new signature for the type of A after being coerced to a Number
- * @throws TypeCoercionException if A can definitively not be coerced to
- * a number
- */
- public static String coerceToNumber(final CompositeType typeOfA)
- throws TypeCoercionException
- {
- String coercedType = null;
- boolean errorDetected = true; // assume error: only false if we
- // find a member of typeOfA that
- // coerces to number
-
- // JSP.2.8.1 -- auto-box primitives
- final CompositeType boxedTypeOfA =
- TypeTransformer.transformBoxPrimitives(typeOfA);
- final boolean[] typesigs = boxedTypeOfA.getIsTypeSignature();
-
- // iterate through all of the signatures that represent types
- // and find at least one that can be coerced to a number
- for (int i = 0; i < typesigs.length; i++)
- {
- if (typesigs[i])
- {
- try
- {
- final String testType =
- TypeCoercer.coerceToNumber(boxedTypeOfA.getSignatures()[i]);
-
- if (testType != null)
- {
- // if we have already found a coercible type, then
- // we need to return null, since we have a conflict that
- // we don't know how to resolve to a type??????
- if (coercedType != null)
- {
- return null;
- }
-
- coercedType = testType;
- }
- errorDetected = false; // we have found a number coercion or indeterminate
- }
- catch (TypeCoercionException tce)
- {
- // do nothing: so far error still detected
- }
- }
- }
-
- // we have three choices:
- // 1: if errorDetected was never cleared, we definitely never found
- // a coerceable type, so throw exception
- if (errorDetected)
- {
- throw new TypeCoercionException();
- }
-
- // otherwise the flag was cleared return what we found
- if (coercedType != null)
- {
- // need to unbox per JSP.2.8.1
- coercedType =
- TypeTransformer.transformUnboxPrimitives(coercedType);
- }
-
- return coercedType;
- }
-
-
-// public static String coerceToBoolean(CompositeType compositeType)
-// {
-//
-// }
-
-} \ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/FloatLiteralType.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/FloatLiteralType.java
deleted file mode 100644
index 5631b8700..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/FloatLiteralType.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.internal.types;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import org.eclipse.jdt.core.Signature;
-
-/**
- * Represents an FloatLiteral as defined by JSP.2.9
- * @author cbateman
- *
- */
-public class FloatLiteralType extends NumericTypeLiteral
-{
- private final double _literalValue;
-
- /**
- * @param literalValue
- */
- public FloatLiteralType(double literalValue)
- {
- // according to the notes to JSP.2.9, bullet 5, float literals are doubles
- super(Signature.SIG_DOUBLE);
- _literalValue = literalValue;
- }
-
- protected Number getBoxedValue()
- {
- return new Double(_literalValue);
- }
-
- public Number coerceToNumber(Class T) throws TypeCoercionException
- {
- if (T == BigInteger.class)
- {
- return new BigDecimal(_literalValue).toBigInteger();
- }
- else if (T == BigDecimal.class)
- {
- return new BigDecimal(_literalValue);
- }
-
- Number commonCoercion = super.coerceToNumber(T);
-
- if (commonCoercion == null)
- {
- throw new IllegalArgumentException("Not a target numeric type: "+T); //$NON-NLS-1$
- }
-
- return commonCoercion;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/IAssignable.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/IAssignable.java
deleted file mode 100644
index 8b74dfd85..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/IAssignable.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.internal.types;
-
-/**
- * Defines the lhs/rhs rules for a type
- * @author cbateman
- *
- */
-public interface IAssignable
-{
- /**
- * Type is none: it cannot be assigned to. method binding.
- */
- public static int ASSIGNMENT_TYPE_NONE = 0x0;
- /**
- * Type is lhs: it can be assigned to
- */
- public static int ASSIGNMENT_TYPE_LHS = 0x1;
-
- /**
- * Type is rhs: it can be assigned from
- */
- public static int ASSIGNMENT_TYPE_RHS = 0x2;
-
- /**
- * @return the assigment mask
- */
- public int getAssignability();
-
- /**
- * @return true if ASSIGNMENT_TYPE_LHS is set in getAssignability
- */
- public boolean isLHS();
- /**
- * @return true if ASSIGNMENT_TYPE_RHS is set in getAssignability
- */
- public boolean isRHS();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/IntegerLiteralType.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/IntegerLiteralType.java
deleted file mode 100644
index d7a3be803..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/IntegerLiteralType.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.internal.types;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import org.eclipse.jdt.core.Signature;
-
-/**
- * Represents a IntegerLiteral as defined by JSP.2.9
- * @author cbateman
- *
- */
-public class IntegerLiteralType extends NumericTypeLiteral
-{
- /**
- * A singleton for zero literals
- */
- public final static IntegerLiteralType ZERO = new IntegerLiteralType(0);
-
- private final long _literalValue;
-
- /**
- * @param literalValue
- */
- public IntegerLiteralType(long literalValue)
- {
- // according to the notes to JSP.2.9, bullet 4, integer literals are longs
- super(Signature.SIG_LONG);
- _literalValue = literalValue;
- }
-
- protected Number getBoxedValue()
- {
- return Long.valueOf(_literalValue);
- }
-
- /**
- * Per JSP.2.8.3, step 5
- * @see org.eclipse.jst.jsf.common.internal.types.LiteralType#coerceToNumber(java.lang.Class)
- */
- public Number coerceToNumber(Class T) throws TypeCoercionException
- {
- if (T == BigInteger.class)
- {
- return BigInteger.valueOf(_literalValue);
- }
- else if (T == BigDecimal.class)
- {
- return BigDecimal.valueOf(_literalValue);
- }
-
- Number commonCoercion = super.coerceToNumber(T);
-
- if (commonCoercion == null)
- {
- throw new IllegalArgumentException("Not a target numeric type: "+T); //$NON-NLS-1$
- }
-
- return commonCoercion;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/LiteralType.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/LiteralType.java
deleted file mode 100644
index 3ea6de53c..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/LiteralType.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.internal.types;
-
-
-/**
- * Encodes a type signature and a string that has some literal value based on
- * the type signature. The class represents only a value object -- no attempt
- * is made to assert that the literalValue is really of the type specified.
- *
- * @author cbateman
- *
- */
-public abstract class LiteralType extends ValueType
-{
-
- /**
- * Consider a new literal type
- *
- * @param signature
- */
- protected LiteralType(final String signature)
- {
- super(signature, IAssignable.ASSIGNMENT_TYPE_RHS);
- }
-
- /**
- * @return the literal value string (unparsed)
- */
- public abstract String getLiteralValue();
-
- /**
- * @return the actual untranslated literal value as an object
- */
- public abstract Object getLiteralValueRaw();
-
- /**
- * @return the type signature
- */
- public final String getSignature() {
- return super.getSignature();
- }
-
- /**
- * @return a type signature for the kind of number this literal will coerce
- * into when asked to become a number or null if this cannot be determined
- * @throws TypeCoercionException if this literal has no legal coercion into
- * a number
- */
- public String getNumberCoercion() throws TypeCoercionException
- {
- // always box before coercion
- return
- TypeCoercer.coerceToNumber(
- TypeTransformer.transformBoxPrimitives(getSignature()));
- }
-
- /**
- * @param T
- * @return a Number coercion of the literal's value, null if indeterminate
- * @throws TypeCoercionException if the coercion is illegal
- */
- public abstract Number coerceToNumber(Class T) throws TypeCoercionException;
-
- /**
- * @return a Boolean coercion of the literal's value, null if indeterminate
- * @throws TypeCoercionException if the coercion is illegal
- */
- public abstract Boolean coerceToBoolean() throws TypeCoercionException;
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/Messages.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/Messages.java
deleted file mode 100644
index b3db7a5e6..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/Messages.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.internal.types;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Message bundle
- *
- */
-public class Messages {
- private static final String BUNDLE_NAME = "org.eclipse.jst.jsf.common.internal.types.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
-
- private Messages() {
- // no external construction
- }
-
- /**
- * @param key
- * @return the string for key or !key! if not found
- */
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/MethodType.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/MethodType.java
deleted file mode 100644
index 38e47b0c6..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/MethodType.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.internal.types;
-
-/**
- * Signature type for method bindings in an EL expression
- *
- * @author cbateman
- *
- */
-public class MethodType implements SignatureBasedType
-{
- private final String _methodName;
- private final String _signature;
-
- /**
- * @param methodName
- * @param signature
- */
- public MethodType(final String methodName, final String signature)
- {
- _methodName = methodName;
- _signature = signature;
- }
-
- /**
- * @see org.eclipse.jst.jsf.common.internal.types.SignatureBasedType#getSignature()
- */
- public String getSignature()
- {
- return _signature;
- }
-
- /**
- * @return the method name signature
- */
- public String getMethodName()
- {
- return _methodName;
- }
-
- public CompositeType toCompositeType()
- {
- return new CompositeType(_signature, IAssignable.ASSIGNMENT_TYPE_NONE);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/NullLiteralType.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/NullLiteralType.java
deleted file mode 100644
index eeb43e69d..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/NullLiteralType.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.internal.types;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-/**
- * Represents a NullLiteralType per JSP.2.9
- *
- * @author cbateman
- *
- */
-public class NullLiteralType extends LiteralType
-{
- /**
- * The singleton null literal
- */
- public final static NullLiteralType SINGLETON = new NullLiteralType();
-
- /**
- * Construct a new null
- */
- private NullLiteralType()
- {
- super(TypeConstants.TYPE_NULL); // use void to indicate null in this situation
- }
-
- /**
- * Per JSP.2.8.5 null is always false
- *
- * @see org.eclipse.jst.jsf.common.internal.types.LiteralType#coerceToBoolean()
- */
- public Boolean coerceToBoolean() throws TypeCoercionException
- {
- return Boolean.FALSE;
- }
-
- /**
- * Per JSP.2.8.3, null is always 0
- *
- * @see org.eclipse.jst.jsf.common.internal.types.LiteralType#coerceToNumber(java.lang.Class)
- */
- public Number coerceToNumber(Class T) throws TypeCoercionException {
- if (T == BigInteger.class)
- {
- return BigInteger.ZERO;
- }
- else if (T == BigDecimal.class)
- {
- return new BigDecimal(0.0);
- }
- else if (T == Double.class || T == Double.TYPE)
- {
- return new Double(0.0);
- }
- else if (T == Float.class || T == Float.TYPE)
- {
- return new Float(0.0);
- }
- else if (T == Long.class || T == Long.TYPE)
- {
- return Long.valueOf(0L);
- }
- else if (T == Integer.class || T == Integer.TYPE)
- {
- return Integer.valueOf(0);
- }
- else if (T == Short.class || T == Short.TYPE)
- {
- return Short.valueOf((short)0);
- }
- else if (T == Byte.class || T == Byte.TYPE)
- {
- return Byte.valueOf((byte)0);
- }
- else
- {
- throw new IllegalArgumentException("Not a target numeric type: "+T); //$NON-NLS-1$
- }
- }
-
- /**
- * Per JSP.2.8.2 null is always an empty string
- * @see org.eclipse.jst.jsf.common.internal.types.LiteralType#getLiteralValue()
- */
- public String getLiteralValue()
- {
- return ""; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.internal.types.LiteralType#getLiteralValueRaw()
- */
- public Object getLiteralValueRaw()
- {
- return null;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/NumericTypeLiteral.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/NumericTypeLiteral.java
deleted file mode 100644
index 8b6acbe05..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/NumericTypeLiteral.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.internal.types;
-
-
-/**
- * Common super-type for Float and Integer literals
- * @author cbateman
- *
- */
-public abstract class NumericTypeLiteral extends LiteralType
-{
- /**
- * @param signature
- */
- protected NumericTypeLiteral(String signature)
- {
- super(signature);
- }
-
- /**
- * @return the boxed form of the numeric literal value
- */
- protected abstract Number getBoxedValue();
-
- public Number coerceToNumber(Class T) throws TypeCoercionException
- {
- Number boxedLiteralValue = getBoxedValue();
-
- if (T == Double.class || T == Double.TYPE)
- {
- return new Double(boxedLiteralValue.doubleValue());
- }
- else if (T == Float.class || T == Float.TYPE)
- {
- return new Float(boxedLiteralValue.floatValue());
- }
- else if (T == Long.class || T == Long.TYPE)
- {
- return boxedLiteralValue;
- }
- else if (T == Integer.class || T == Integer.TYPE)
- {
- return Integer.valueOf(boxedLiteralValue.intValue());
- }
- else if (T == Short.class || T == Short.TYPE)
- {
- return Short.valueOf(boxedLiteralValue.shortValue());
- }
- else if (T == Byte.class || T == Byte.TYPE)
- {
- return Byte.valueOf(boxedLiteralValue.byteValue());
- }
- else
- {
- return null;
- }
- }
-
- public String getLiteralValue()
- {
- return getBoxedValue().toString();
- }
-
- public Object getLiteralValueRaw()
- {
- return getBoxedValue();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.internal.types.LiteralType#coerceToBoolean()
- */
- public Boolean coerceToBoolean() throws TypeCoercionException {
- // JSP.2.8.5 does not provide for number -> boolean coercion
- throw new TypeCoercionException("Cannot coerce number to boolean"); //$NON-NLS-1$
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/SignatureBasedType.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/SignatureBasedType.java
deleted file mode 100644
index 41e2bb482..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/SignatureBasedType.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.internal.types;
-
-/**
- * Defines a signature-based type. Signatures must conform to the JVM
- * type signature format as defined in the JVM specs and in the JDT Signature
- * class
- *
- * @author cbateman
- *
- */
-public interface SignatureBasedType
-{
- /**
- * @return the signature string
- */
- public String getSignature();
-
- /**
- * @return a version of the this type in CompositeType form
- */
- public CompositeType toCompositeType();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/StringLiteralType.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/StringLiteralType.java
deleted file mode 100644
index 2e887fde9..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/StringLiteralType.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.internal.types;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-/**
- * Represents a StringLiteral as defined by JSP.2.9
- *
- * @author cbateman
- */
-public class StringLiteralType extends LiteralType
-{
- private final String _literalValue;
-
- /**
- * @param value
- */
- public StringLiteralType(String value)
- {
- super(TypeConstants.TYPE_STRING);
- _literalValue = value;
- }
-
- public Number coerceToNumber(Class T) throws TypeCoercionException
- {
- try
- {
- if (T == BigInteger.class)
- {
- if ("".equals(_literalValue)) //$NON-NLS-1$
- {
- return BigInteger.ZERO;
- }
- return new BigInteger(_literalValue);
- }
- else if (T == BigDecimal.class)
- {
- if ("".equals(_literalValue)) //$NON-NLS-1$
- {
- return new BigDecimal(0.0);
- }
- return new BigDecimal(_literalValue);
- }
- else if (T == Double.class || T == Double.TYPE)
- {
- if ("".equals(_literalValue)) //$NON-NLS-1$
- {
- return new Double(0.0);
- }
-
- return Double.valueOf(_literalValue);
- }
- else if (T == Float.class || T == Float.TYPE)
- {
- if ("".equals(_literalValue)) //$NON-NLS-1$
- {
- return new Float(0.0);
- }
- return Float.valueOf(_literalValue);
- }
- else if (T == Long.class || T == Long.TYPE)
- {
- if ("".equals(_literalValue)) //$NON-NLS-1$
- {
- return Long.valueOf(0L);
- }
- return Long.valueOf(_literalValue);
- }
- else if (T == Integer.class || T == Integer.TYPE)
- {
- if ("".equals(_literalValue)) //$NON-NLS-1$
- {
- return Integer.valueOf(0);
- }
- return Integer.valueOf(_literalValue);
- }
- else if (T == Short.class || T == Short.TYPE)
- {
- if ("".equals(_literalValue)) //$NON-NLS-1$
- {
- return Short.valueOf((short)0);
- }
- return Short.valueOf(_literalValue);
- }
- else if (T == Byte.class || T == Byte.TYPE)
- {
- if ("".equals(_literalValue)) //$NON-NLS-1$
- {
- return Byte.valueOf((byte)0);
- }
- return Byte.valueOf(_literalValue);
- }
- else
- {
- throw new IllegalArgumentException("Not a target numeric type: "+T); //$NON-NLS-1$
- }
- }
- catch (NumberFormatException nfe)
- {
- throw new TypeCoercionException(nfe);
- }
- }
-
- public String getLiteralValue()
- {
- return _literalValue;
- }
-
- public Object getLiteralValueRaw()
- {
- return _literalValue;
- }
-
- public Boolean coerceToBoolean() throws TypeCoercionException
- {
- // JSP.2.8.5
- return Boolean.valueOf(_literalValue);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeCoercer.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeCoercer.java
deleted file mode 100644
index fa75a12f9..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeCoercer.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.internal.types;
-
-import org.eclipse.jdt.core.Signature;
-
-/**
- * Coercer for simple type signatures
- *
- * @author cbateman
- *
- */
-public class TypeCoercer
-{
-
- /**
- * Based on JSP.2.8.3 in JSP 2.0 specification
- *
- * @param boxedTypeSignature -- an auto-boxed type signature
- * @return the coerced type or null if cannot be resolved. No unboxing
- * is performed on the return.
- * @throws TypeCoercionException if boxedTypeSignature is
- */
- public static String coerceToNumber(final String boxedTypeSignature)
- throws TypeCoercionException
- {
- String boxedTypeSignature_ = boxedTypeSignature;
-
- // can't coerce arrays to numbers
- if (Signature.getTypeSignatureKind(boxedTypeSignature_)
- == Signature.ARRAY_TYPE_SIGNATURE)
- {
- throw new TypeCoercionException("Cannot coerce arrays to numbers"); //$NON-NLS-1$
- }
- // if it's character, pre-coerce to short per step 2
- if (TypeConstants.SIGNATURE_BOXED_CHARACTER.equals(boxedTypeSignature))
- {
- boxedTypeSignature_ = TypeConstants.TYPE_BOXED_SHORT;
- }
-
- if (TypeCoercer.typeIsNumeric(boxedTypeSignature_)
- || TypeCoercer.typeIsNull(boxedTypeSignature_))
- {
- return boxedTypeSignature_;
- }
- else if (typeIsString(boxedTypeSignature_))
- {
- // undetermined a string may or not resolve to a number
- // depending on its runtime value
- return null;
- }
- else
- {
- throw new TypeCoercionException();
- }
- }
-
- /**
- * @param boxedTypeSignature
- * @return true if type can be coerced to boolean; null if indeterminate
- */
- public static boolean canCoerceToBoolean(String boxedTypeSignature)
- {
- // JSP.2.8.5 -- boolean is always boolean; string is converted by Boolean.valueOf(String)
- if (typeIsBoolean(boxedTypeSignature)
- || typeIsString(boxedTypeSignature)
- || typeIsNull(boxedTypeSignature))
- {
- return true;
- }
- // nothing else really convertible besides null
- return false;
- }
-
- /**
- * @param typeSignature -- boxed type signature
- * @return true if the typeSignature is numeric
- */
- public static boolean typeIsNumeric(final String typeSignature)
- {
- return (TypeConstants.TYPE_BOXED_BYTE.equals(typeSignature) ||
- TypeConstants.TYPE_BOXED_SHORT.equals(typeSignature) ||
- TypeConstants.TYPE_BOXED_INTEGER.equals(typeSignature) ||
- TypeConstants.TYPE_BOXED_LONG.equals(typeSignature) ||
- TypeConstants.TYPE_BOXED_FLOAT.equals(typeSignature) ||
- TypeConstants.TYPE_BOXED_DOUBLE.equals(typeSignature) ||
- TypeConstants.TYPE_BIG_INTEGER.equals(typeSignature) ||
- TypeConstants.TYPE_BIG_DOUBLE.equals(typeSignature));
- }
-
- /**
- * @param typeSignature
- * @return true if the typeSignature represents a String
- */
- public static boolean typeIsString(final String typeSignature)
- {
- return (TypeConstants.TYPE_STRING.equals(typeSignature));
- }
-
- /**
- * @param typeSignature -- boxed type signature
- * @return true if the typeSignature represents a boxed boolean
- */
- public static boolean typeIsBoolean(final String typeSignature)
- {
- return (TypeConstants.TYPE_BOXED_BOOLEAN.equals(typeSignature));
- }
-
- /**
- * @param typeSignature
- * @return true if type is the EL null type
- */
- public static boolean typeIsNull(final String typeSignature)
- {
- return (TypeConstants.TYPE_NULL.equals(typeSignature));
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeCoercionException.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeCoercionException.java
deleted file mode 100644
index aa18bbd12..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeCoercionException.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.internal.types;
-
-/**
- * @author cbateman
- *
- */
-public class TypeCoercionException extends Exception
-{
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- /**
- * @see java.lang.Exception
- */
- public TypeCoercionException() {
- super();
- }
-
- /**
- * @param message
- * @param cause
- * @see java.lang.Exception
- */
- public TypeCoercionException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * @param message
- * @see java.lang.Exception
- */
- public TypeCoercionException(String message) {
- super(message);
- }
-
- /**
- * @param cause
- * @see java.lang.Exception
- */
- public TypeCoercionException(Throwable cause) {
- super(cause);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeComparator.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeComparator.java
deleted file mode 100644
index 79332b95c..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeComparator.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.internal.types;
-
-import org.eclipse.emf.common.util.BasicDiagnostic;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jdt.core.Signature;
-
-/**
- * Static utility class used to compare two CompositeTypes for compatability
- *
- * @author cbateman
- *
- */
-public final class TypeComparator
-{
- /**
- * @param firstType
- * @param secondType
- * @return true if firstType is assignable to secondType or vice-versa,
- * depending on their assignment and runtime types
- */
- public static Diagnostic calculateTypeCompatibility(final CompositeType firstType,
- final CompositeType secondType)
- {
- // first, box all primitives
- final CompositeType boxedFirstType =
- TypeTransformer.transformBoxPrimitives(firstType);
- final CompositeType boxedSecondType =
- TypeTransformer.transformBoxPrimitives(secondType);
-
- final String[] mustBeSatisfied = boxedFirstType.getSignatures();
- final String[] testSignatures = boxedSecondType.getSignatures();
- // TODO: need better user messages here
- Diagnostic result = new BasicDiagnostic(Diagnostic.WARNING, "", 0, //$NON-NLS-1$
- Messages.getString("TypeComparator.Expression.Doesnt.Match.Expected.Types"), null); //$NON-NLS-1$
- // now loop through each type in the first type and see
- // if there is a type satisfying it in the second
- MAIN_LOOP:
- for (int i = 0; i < mustBeSatisfied.length; i++)
- {
- final String curSatisfyType = mustBeSatisfied[i];
-
- CHECK_CANDIDATES:
- for (int j = 0; j < testSignatures.length; j++)
- {
- final String testType = testSignatures[j];
-
- // simplest success is an exact match
- if (curSatisfyType.equals(testType))
- {
- // check assignability mask
- // returns Diagnostic.OK if okay
- result = checkAssignability(firstType, secondType);
- break MAIN_LOOP;
- }
-
- // or if both are methods, check to see if the
- // method signatures match
- if (TypeUtil.isMethodSignature(curSatisfyType))
- {
- // if the satisfy type is a method,
- // the test type is not, then don't go any
- // further, since we know the won't match
- if (!TypeUtil.isMethodSignature(testType))
- {
- continue CHECK_CANDIDATES;
- }
-
- final Diagnostic test =
- methodSignaturesMatch(curSatisfyType, testType);
-
- if (test.getSeverity() == Diagnostic.OK)
- {
- result = Diagnostic.OK_INSTANCE;
- // found a match so break
- break MAIN_LOOP;
- }
- }
-
- // or, can we coerce testType to curSatisfyType
- if (canCoerce(testType, curSatisfyType, firstType.isLHS()))
- {
- result = checkAssignability(firstType, secondType);
- break MAIN_LOOP;
- }
- }
- }
-
- return result;
- }
-
- private static boolean canCoerce(String testType, String checkType,
- boolean checkTypeIsWritable)
- {
- boolean canCoerce = canCoerce(testType, checkType);
-
- // if the check type is writable, we need to be sure that the
- // coercion can work in both directions
- if (canCoerce && checkTypeIsWritable)
- {
- // reverse roles: can checkType assign back to test type?
- canCoerce &= canCoerce(checkType, testType);
- }
-
- return canCoerce;
- }
-
- private static boolean canCoerce(String testType, String checkType)
- {
- // can always to coerce to string
- if (TypeCoercer.typeIsString(checkType))
- {
- // if check type expects writability, need to ensure that
- // coercability is reversible
- return true;
- }
- else if (TypeCoercer.typeIsNumeric(checkType))
- {
- return canCoerceNumeric(testType);
- }
- else if (TypeCoercer.typeIsBoolean(checkType))
- {
- return TypeCoercer.canCoerceToBoolean(testType);
- }
-
- // otherwise, no type coercion available
- return false;
- }
-
- private static boolean canCoerceNumeric(String testType)
- {
- try
- {
- TypeCoercer.coerceToNumber(testType);
- // TODO: there is a case when coerceToNumber returns
- // null meaning "not sure", that we may want to handle
- // differently, with a warning
- return true;
- }
- catch (TypeCoercionException tce)
- {
- // outright failure -- can't coerce
- return false;
- }
- }
-
- private static Diagnostic methodSignaturesMatch(String firstMethodSig, String secondMethodSig)
- {
- // TODO: need to account for primitive type coercions
- final String[] firstMethodParams =
- Signature.getParameterTypes(firstMethodSig);
- final String[] secondMethodParams =
- Signature.getParameterTypes(secondMethodSig);
-
- // fail fast if param count doesn't match
- if (firstMethodParams.length != secondMethodParams.length)
- {
- return new BasicDiagnostic(Diagnostic.ERROR, "", 0, //$NON-NLS-1$
- Messages.getString("TypeComparator.Parameter.count.mismatch"), null); //$NON-NLS-1$
- }
-
- // now check each parameter
- for (int i = 0; i < firstMethodParams.length; i++)
- {
- // need to box primitives before comparing
- final String firstMethodParam =
- TypeTransformer.transformBoxPrimitives(firstMethodParams[i]);
- final String secondMethodParam =
- TypeTransformer.transformBoxPrimitives(secondMethodParams[i]);
-
- if (!firstMethodParam.equals(secondMethodParam))
- {
- return new BasicDiagnostic(Diagnostic.ERROR, "", 0, //$NON-NLS-1$
- Messages.getString("TypeComparator.Type.mismatch.on.parameter")+i, null); //$NON-NLS-1$
- }
- }
-
- // if we get to here then we need only check the return type
- final String firstReturn =
- TypeTransformer.transformBoxPrimitives(Signature.getReturnType(firstMethodSig));
- final String secondReturn =
- TypeTransformer.transformBoxPrimitives(Signature.getReturnType(secondMethodSig));
-
- if (!firstReturn.equals(secondReturn))
- {
- return new BasicDiagnostic(Diagnostic.ERROR, "", 0, //$NON-NLS-1$
- Messages.getString("TypeComparator.Return.Types.Dont.Match"), null); //$NON-NLS-1$
- }
-
- // if we get to here, then everything checks out
- return Diagnostic.OK_INSTANCE;
- }
-
- /**
- * Precond: both firstType and secondType must represent value bindings.
- *
- * @param firstType
- * @param secondType
- * @return a diagnostic validating that the two composite have compatible
- * assignability
- */
- private static Diagnostic checkAssignability(CompositeType firstType, CompositeType secondType)
- {
- if (firstType.isRHS() && !secondType.isRHS())
- {
- return new BasicDiagnostic(Diagnostic.WARNING, "", 0, //$NON-NLS-1$
- Messages.getString("TypeComparator.Expression.Not.Gettable"), null); //$NON-NLS-1$
- }
-
- if (firstType.isLHS() && !secondType.isLHS())
- {
- return new BasicDiagnostic(Diagnostic.WARNING, "", 0, //$NON-NLS-1$
- Messages.getString("TypeComparator.Expression.Expected.Settable"), null); //$NON-NLS-1$
- }
-
- return Diagnostic.OK_INSTANCE;
- }
-
- private TypeComparator()
- {
- // static utility class; not instantiable
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeConstants.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeConstants.java
deleted file mode 100644
index e23782531..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeConstants.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.internal.types;
-
-/**
- * @author cbateman
- *
- */
-public class TypeConstants
-{
- /**
- * we overload "void" to represent null
- */
- public final static String TYPE_NULL = "V"; //$NON-NLS-1$
- /**
- * unboxed boolean
- */
- public final static String TYPE_BOOLEAN = "Z"; //$NON-NLS-1$
- /**
- * string type
- */
- public final static String TYPE_STRING = "Ljava.lang.String;"; //$NON-NLS-1$
- /**
- * big integer
- */
- public final static String TYPE_BIG_INTEGER = "Ljava.math.BigInteger;"; //$NON-NLS-1$
-
- /**
- * big double
- */
- public final static String TYPE_BIG_DOUBLE = "Ljava.math.BigDecimal;"; //$NON-NLS-1$
-
- /* boxed types */
- /**
- * Boxed byte
- */
- public final static String TYPE_BOXED_BYTE = "Ljava.lang.Byte;"; //$NON-NLS-1$
- /**
- * Boxed short
- */
- public final static String TYPE_BOXED_SHORT = "Ljava.lang.Short;"; //$NON-NLS-1$
- /**
- * Boxed int
- */
- public final static String TYPE_BOXED_INTEGER = "Ljava.lang.Integer;"; //$NON-NLS-1$
- /**
- * Boxed long
- */
- public final static String TYPE_BOXED_LONG = "Ljava.lang.Long;"; //$NON-NLS-1$
- /**
- * Boxed float
- */
- public final static String TYPE_BOXED_FLOAT = "Ljava.lang.Float;"; //$NON-NLS-1$
- /**
- * Boxed double
- */
- public final static String TYPE_BOXED_DOUBLE = "Ljava.lang.Double;"; //$NON-NLS-1$
- /**
- * Boxed boolean
- */
- public final static String TYPE_BOXED_BOOLEAN = "Ljava.lang.Boolean;"; //$NON-NLS-1$
- /**
- * Boxed char
- */
- public final static String SIGNATURE_BOXED_CHARACTER = "Ljava.lang.Character"; //$NON-NLS-1$
- /**
- * Map type
- */
- public final static String TYPE_MAP = "Ljava.util.Map;"; //$NON-NLS-1$
- /**
- * Collection type
- */
- public final static String TYPE_COLLECTION = "Ljava.util.Collection;"; //$NON-NLS-1$
- /**
- * Comparable type
- */
- public final static String TYPE_COMPARABLE = "Ljava.lang.Comparable;"; //$NON-NLS-1$
-
- /**
- * List type
- */
- public final static String TYPE_LIST = "Ljava.util.List;"; //$NON-NLS-1$
-
- /**
- * java.lang.Object type signature
- */
- public static final String TYPE_JAVAOBJECT = "Ljava.lang.Object;"; //$NON-NLS-1$
- /**
- * Type signature for the JSF Data Model type
- */
- public static final String TYPE_DATA_MODEL = "Ljavax.faces.model.DataModel;"; //$NON-NLS-1$
- /**
- * Type signature for the Result Set type
- */
- public static final String TYPE_RESULT_SET = "Ljava.sql.ResultSet;"; //$NON-NLS-1$
- /**
- * Type signature for the JSTL ResultSet type
- */
- public static final String TYPE_JAVAX_SERVLET_JSP_JSTL_SQL_RESULT = "Ljavax.servlet.jsp.jstl.sql.Result;"; //$NON-NLS-1$
- /**
- * Type signature of the base type of all enum types
- */
- public static final String TYPE_ENUM_BASE = "Ljava.lang.Enum;"; // $NON-NLS-1$
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeInfo.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeInfo.java
deleted file mode 100644
index 0015b6f49..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeInfo.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package org.eclipse.jst.jsf.common.internal.types;
-
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jst.jsf.context.symbol.IBeanMethodSymbol;
-import org.eclipse.jst.jsf.context.symbol.IBeanPropertySymbol;
-
-/**This class contains all info that is cached for a given IType.
- * @see org.eclipse.jst.jsf.common.internal.types.TypeInfoCache
- *
- * @author Matthias
- */
-class TypeInfo {
-
- /**Empty String array. Used for the (usual) case when a type has no missing supertypes.
- */
- public static String[] NO_NAMES = new String[0];
-
- private IBeanMethodSymbol[] methods = null;
- private IBeanPropertySymbol[] properties = null;
- private IType[] supertypes = null;
- private IType[] interfaceTypes = null;
- private String[] missingSupertypeNames = null;
-
- /**Creates an empty TypeInfo object
- */
- public TypeInfo() {
- super();
- }
-
- /**Returns the method symbols. Returns <code>null</code> if none have been cached.
- * @return the method symbols. May be null.
- */
- public IBeanMethodSymbol[] getMethodSymbols() {
- return methods;
- }
-
- /**Returns the property symbols. Returns <code>null</code> if none have been cached.
- * @return the property symbols. May be null.
- */
- public IBeanPropertySymbol[] getPropertySymbols() {
- return properties;
- }
-
- /**Sets the methods symbols to be cached.
- * @param methods - the method symbols
- */
- public void setMethodSymbols(IBeanMethodSymbol[] methods) {
- this.methods = methods;
- }
-
- /**Sets the property symbols to be cached.
- * @param properties - the property symbols
- */
- public void setPropertySymbols(IBeanPropertySymbol[] properties) {
- this.properties = properties;
- }
-
- /**Returns the supertypes. Returns <code>null</code> if none have been cached.
- * @return the supertypes. May be null.
- */
- public IType[] getSupertypes() {
- return supertypes;
- }
-
- /**Sets the supertypes to be cached.
- * @param superTypes - the property symbols
- */
- public void setSupertypes(IType[] superTypes) {
- this.supertypes = superTypes;
- }
-
- /**Returns the interface types. Returns <code>null</code> if none have been cached.
- * @return the interface types. May be null.
- */
- public IType[] getInterfaceTypes() {
- return interfaceTypes;
- }
-
- /**Sets the interface types to be cached.
- * @param interfaceTypes - the property symbols
- */
- public void setInterfaceTypes(IType[] interfaceTypes) {
- this.interfaceTypes = interfaceTypes;
- }
-
- /**Returns the names of the missing supertypes. Returns <code>null</code> if none have been cached.
- * @return the names of the missing supertypes. May be null.
- */
- public String[] getMissingSupertypeNames() {
- return missingSupertypeNames;
- }
-
- /**Sets the supertypes to be cached.
- * @param missingSupertypeNames - the names of the missing supertypes
- */
- public void setMissingSupertypeNames(String[] missingSupertypeNames) {
- this.missingSupertypeNames = missingSupertypeNames;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeInfoCache.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeInfoCache.java
deleted file mode 100644
index e3c26b9a0..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeInfoCache.java
+++ /dev/null
@@ -1,543 +0,0 @@
-package org.eclipse.jst.jsf.common.internal.types;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.IClassFile;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IElementChangedListener;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaElementDelta;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.ITypeHierarchy;
-import org.eclipse.jdt.core.ITypeRoot;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.jsf.common.JSFCommonPlugin;
-import org.eclipse.jst.jsf.context.symbol.IBeanMethodSymbol;
-import org.eclipse.jst.jsf.context.symbol.IBeanPropertySymbol;
-
-/**Provides a cache for java IType properties. It can cache bean property symbols, method symbols,
- * supertypes and implemented interfaces per IType. The cache listens to changes in the java model
- * and invalidates affected properties, but does not update them.
- *
- * @author Matthias
- */
-public class TypeInfoCache implements IElementChangedListener {
-
- private static TypeInfoCache instance = null;
-
- /**Returns the TypeInfoCache instance.
- *
- * @return the TypeInfoCache instance
- */
- public static synchronized TypeInfoCache getInstance() {
- if (instance == null) {
- instance = new TypeInfoCache();
- JavaCore.addElementChangedListener(instance, ElementChangedEvent.POST_CHANGE);
- }
- return instance;
- }
-
- private final Map /*<IType, TypeInfo>*/ cachedInfo;
- private final Map /*<ITypeRoot, Set<IType>>*/ cachedTypesByAffectingTypeRoot;
- private final Map /*<String, Set<IType>>*/ cachedTypesByMissingSupertypename;
-
- private TypeInfoCache() {
- cachedInfo = new HashMap();
- cachedTypesByAffectingTypeRoot = new HashMap();
- cachedTypesByMissingSupertypename = new HashMap(10);
- }
-
- public void elementChanged(ElementChangedEvent event) {
- updateChangedJavaElement(event.getDelta());
- }
-
- /**Returns the cached info({@link TypeInfo}) for a given type. Will
- * return <code>null</code> if no info has been cached or the the type/something it depends on
- * has changed since then.
- *
- * @param type - the type in question
- * @return a TypeInfo instance that contains all cached info for the given type. May be null.
- */
- protected TypeInfo getTypeInfo(IType type) {
- TypeInfo info = null;
- if (type != null)
- {
- info = (TypeInfo) cachedInfo.get(type);
- }
- return info;
- }
-
- /**Returns the cached bean property symbols for a given type. Will return null if no
- * bean property symbols have been cached or the type/something it depends on has changed since
- * then.
- * @param beanType - the bean type in question
- * @return the bean property symbols for the given type. May be null.
- * @see TypeInfoCache#cachePropertySymbols(IType, IBeanPropertySymbol[])
- */
- public synchronized IBeanPropertySymbol[] getCachedPropertySymbols(IType beanType) {
- IBeanPropertySymbol[] props = null;
-
- if (beanType != null)
- {
- TypeInfo typeInfo = getTypeInfo(beanType);
- if (typeInfo != null)
- {
- props = typeInfo.getPropertySymbols();
- }
- }
- return props;
- }
-
- /**Returns the cached method symbols for a given type. Will return null if no
- * method symbols have been cached or the type/something it depends on has changed since
- * then.
- * @param beanType - the bean type in question
- * @return the method symbols for the given type. May be null.
- * @see TypeInfoCache#cacheMethodSymbols(IType, IBeanMethodSymbol[])
- */
- public synchronized IBeanMethodSymbol[] getCachedMethodSymbols(IType beanType) {
- IBeanMethodSymbol[] methods = null;
-
- if (beanType != null)
- {
- TypeInfo typeInfo = getTypeInfo(beanType);
- if (typeInfo != null)
- {
- methods = typeInfo.getMethodSymbols();
- }
- }
-
- return methods;
- }
-
- /**Returns the cached supertypes for a given type. Will return null if no supertypes
- * have been cached for this type or if the type/something it depends on has changed since
- * then.
- * @param type - the bean type in question
- * @return the supertypes for the given type. May be null.
- * @see TypeInfoCache#cacheSupertypesFor(IType)
- */
- public synchronized IType[] getCachedSupertypes(IType type) {
- IType[] types = null;
-
- if (type != null)
- {
- TypeInfo typeInfo = getTypeInfo(type);
- if (typeInfo != null)
- {
- types = typeInfo.getSupertypes();
- }
- }
-
- return types;
- }
-
- /**Returns the cached implemented interfaces for a given type. Will return null if no interfaces
- * have been cached for this type or if the type/something it depends on has changed since
- * then.
- * @param type - the bean type in question
- * @return the interface types implemented by the given type. May be null.
- * @see TypeInfoCache#cacheInterfaceTypesFor(IType)
- */
- public synchronized IType[] getCachedInterfaceTypes(IType type)
- {
- IType[] types = null;
-
- if (type != null)
- {
- TypeInfo typeInfo = getTypeInfo(type);
- if (typeInfo != null)
- {
- types = typeInfo.getInterfaceTypes();
- }
- }
-
- return types;
- }
-
- /**Caches the given method symbols for the given type.
- * @param beanType - the type
- * @param methods - the method symbols to cache
- */
- public synchronized void cacheMethodSymbols(IType beanType, IBeanMethodSymbol[] methods) {
- if (beanType != null)
- {
- TypeInfo typeInfo = getOrCreateTypeInfo(beanType);
- if (typeInfo != null) {
- typeInfo.setMethodSymbols(methods);
- }
- }
- }
-
- /**Caches the given property symbols for the given type.
- * @param beanType - the type
- * @param properties - the property symbols to cache
- */
- public synchronized void cachePropertySymbols(IType beanType, IBeanPropertySymbol[] properties) {
- if (beanType != null)
- {
- TypeInfo typeInfo = getOrCreateTypeInfo(beanType);
- if (typeInfo != null) {
- typeInfo.setPropertySymbols(properties);
- }
- }
- }
-
- /**Caches the supertypes for the given type. The supertypes will be calculated (and also returned)
- * by this method.
- * @param type - the type to cache supertypes for
- * @return the supertypes of the given type.
- */
- public synchronized IType[] cacheSupertypesFor(IType type)
- {
- IType[] types = null;
-
- if (type != null)
- {
- TypeInfo typeInfo = getOrCreateTypeInfo(type);
-
- if (typeInfo != null)
- {
- types = typeInfo.getSupertypes();
- }
- }
- return types;
- }
-
- /**Caches the interface types for the given type. The interface types will be calculated (and also
- * returned) by this method.
- * @param type - the type to cache interface types for
- * @return the interface types implemented by the given type.
- */
- public synchronized IType[] cacheInterfaceTypesFor(IType type)
- {
- IType[] types = null;
-
- if (type != null)
- {
- TypeInfo typeInfo = getOrCreateTypeInfo(type);
- if (typeInfo != null)
- {
- types = typeInfo.getInterfaceTypes();
- }
- }
- return types;
- }
-
- /**Returns the TypeInfo for the given type. If no TypeInfo exists for this type, an empty TypeInfo
- * will be created and cached.
- * @param type - the type in question
- * @return the (modifyable) TypeInfo for the given type
- */
- protected TypeInfo getOrCreateTypeInfo(IType type) {
- TypeInfo typeInfo = getTypeInfo(type);
- if (typeInfo == null) {
- try {
- final ITypeHierarchy hierarchy =
- type.newSupertypeHierarchy(new NullProgressMonitor());
- final IType[] supertypes = hierarchy.getAllSuperclasses(type);
- final IType[] interfaceTypes = hierarchy.getAllInterfaces();
- final IType[] rootClasses = hierarchy.getRootClasses();
- List missingSupertypesList = null;
- for (int i = 0; i < rootClasses.length; i++) {
- String superclassName = rootClasses[i].getSuperclassName();
- if (superclassName != null) {
- if (missingSupertypesList == null) {
- missingSupertypesList = new ArrayList(1);
- }
- superclassName = shortTypename(superclassName);
- missingSupertypesList.add(superclassName);
- }
- }
- String[] missingSupertypes = null;
- if (missingSupertypesList != null) {
- missingSupertypes = (String[]) missingSupertypesList.toArray(new String[missingSupertypesList.size()]);
- } else {
- missingSupertypes = TypeInfo.NO_NAMES;
- }
- typeInfo = new TypeInfo();
- typeInfo.setSupertypes(supertypes);
- typeInfo.setInterfaceTypes(interfaceTypes);
- typeInfo.setMissingSupertypeNames(missingSupertypes);
- cachedInfo.put(type, typeInfo);
- registerCachedType(type, typeInfo);
- } catch (JavaModelException e) {
- JSFCommonPlugin.log(e);
- }
- }
- return typeInfo;
- }
-
- /**Returns the typename fragment after the last "." (which in most cases is identical to the
- * unqualified typename).
- * Used only to make sure that if n1 and n2 are names of the same type
- * shortname(n1) equals shortname(2) even if one name is qualified and one not.
- * @param typename
- * @return the typename fragment after the last "."
- */
- private String shortTypename(String typename) {
- int pos = typename.lastIndexOf('.');
- if (pos >= 0) {
- typename = typename.substring(pos + 1);
- }
- return typename;
- }
-
- /**
- * Registers the given type for all ITypeRoot's it depends on, so that it can be uncached if
- * one of this ITypeRoot's has changed. The type must be unregistered when it should not be watched
- * anymore.
- * @param type - the type
- * @param typeInfo - TypeInfo of the given type
- * @see TypeInfoCache#unregisterCachedType(IType, TypeInfo)
- */
- protected void registerCachedType(IType type, TypeInfo typeInfo) {
- registerTypeForTypeRoot(type, type.getTypeRoot());
- IType[] supertypes = typeInfo.getSupertypes();
- for (int i = 0; i < supertypes.length; i++) {
- registerTypeForTypeRoot(type, supertypes[i].getTypeRoot());
- }
- String[] missingSupertypeNames = typeInfo.getMissingSupertypeNames();
- if (missingSupertypeNames != null) {
- for (int i = 0; i < missingSupertypeNames.length; i++) {
- registerTypeForMissingSupertype(type, missingSupertypeNames[i]);
- }
- }
- }
-
- private void registerTypeForTypeRoot(IType type, ITypeRoot typeRoot) {
- Set dependentTypes = (Set) cachedTypesByAffectingTypeRoot.get(typeRoot);
- if (dependentTypes == null) {
- dependentTypes = new HashSet(5);
- cachedTypesByAffectingTypeRoot.put(typeRoot, dependentTypes);
- }
- dependentTypes.add(type);
- }
-
- private void registerTypeForMissingSupertype(IType type, String supertype) {
- Set dependentTypes = (Set) cachedTypesByMissingSupertypename.get(supertype);
- if (dependentTypes == null) {
- dependentTypes = new HashSet(5);
- cachedTypesByMissingSupertypename.put(supertype, dependentTypes);
- }
- dependentTypes.add(type);
- }
-
- /**Unregisters the given type for all ITypeRoot's it depended on.
- * @param type - the type
- * @param typeInfo - TypeInfo of the given type
- */
- protected void unregisterCachedType(IType type, TypeInfo typeInfo) {
- unregisterTypeForTypeRoot(type, type.getTypeRoot());
- IType[] supertypes = typeInfo.getSupertypes();
- for (int i = 0; i < supertypes.length; i++) {
- unregisterTypeForTypeRoot(type, supertypes[i].getTypeRoot());
- }
- String[] missingSupertypeNames = typeInfo.getMissingSupertypeNames();
- if (missingSupertypeNames != null) {
- for (int i = 0; i < missingSupertypeNames.length; i++) {
- unregisterTypeForMissingSupertype(type, missingSupertypeNames[i]);
- }
- }
- }
-
- private void unregisterTypeForTypeRoot(IType type, ITypeRoot typeRoot) {
- Set dependentTypes = (Set) cachedTypesByAffectingTypeRoot.get(typeRoot);
- if (dependentTypes != null) {
- dependentTypes.remove(type);
- if (dependentTypes.isEmpty()) {
- cachedTypesByAffectingTypeRoot.remove(typeRoot);
- }
- }
- }
-
- private void unregisterTypeForMissingSupertype(IType type, String supertype) {
- Set dependentTypes = (Set) cachedTypesByMissingSupertypename.get(supertype);
- if (dependentTypes != null) {
- dependentTypes.remove(type);
- if (dependentTypes.isEmpty()) {
- cachedTypesByMissingSupertypename.remove(supertype);
- }
- }
- }
-
- /**This will remove all cached info for all types.
- */
- protected synchronized void uncacheAllTypes() {
- cachedInfo.clear();
- cachedTypesByAffectingTypeRoot.clear();
- cachedTypesByMissingSupertypename.clear();
- }
-
- /**Removes all cached info for all types that are subtypes of a type of the given ITypeRoot.
- * @param typeRoot
- */
- protected synchronized void uncacheAffectedTypes(ITypeRoot typeRoot) {
- Collection affectedTypes = (Collection) cachedTypesByAffectingTypeRoot.get(typeRoot);
- if (affectedTypes != null && !affectedTypes.isEmpty()) {
- List affectedTypesCopy = new ArrayList(affectedTypes);
- for (Iterator it = affectedTypesCopy.iterator(); it.hasNext(); ) {
- IType cachedType = (IType) it.next();
- TypeInfo typeInfo = (TypeInfo) cachedInfo.remove(cachedType);
- unregisterCachedType(cachedType, typeInfo);
- }
- }
- }
-
- /**Removes all cached info for all types (or subtypes of types) that specify a supertype
- * that has a name similar to the given name.
- * @param supertypename - the missing supertype name. May be qualified or not
- */
- protected synchronized void uncacheTypesWithMissingSupertype(String supertypename) {
- Collection affectedTypes = (Collection) cachedTypesByMissingSupertypename.get(shortTypename(supertypename));
- if (affectedTypes != null && !affectedTypes.isEmpty()) {
- List affectedTypesCopy = new ArrayList(affectedTypes);
- for (Iterator it = affectedTypesCopy.iterator(); it.hasNext(); ) {
- IType cachedType = (IType) it.next();
- TypeInfo typeInfo = (TypeInfo) cachedInfo.remove(cachedType);
- unregisterCachedType(cachedType, typeInfo);
- }
- }
- }
-
- /**Removes all cached info that may be affected by the given change.
- * @param delta - the change in the java model
- */
- protected void updateChangedJavaElement(IJavaElementDelta delta) {
- IJavaElement element= delta.getElement();
- switch (element.getElementType()) {
- case IJavaElement.JAVA_MODEL:
- updateChangedJavaModel(delta, element);
- break;
- case IJavaElement.JAVA_PROJECT:
- updateChangedJavaProject(delta, element);
- break;
- case IJavaElement.PACKAGE_FRAGMENT_ROOT:
- updateChangedPackageFragmentRoot(delta, element);
- break;
- case IJavaElement.PACKAGE_FRAGMENT:
- updateChangedPackageFragment(delta, (IPackageFragment) element);
- break;
- case IJavaElement.CLASS_FILE:
- case IJavaElement.COMPILATION_UNIT:
- updateChangedOpenable(delta, element);
- break;
- }
- }
-
- private void updateChangedChildren(IJavaElementDelta delta) {
- if ((delta.getFlags() & IJavaElementDelta.F_CHILDREN) > 0) {
- IJavaElementDelta[] children= delta.getAffectedChildren();
- for (int i= 0; i < children.length; i++) {
- updateChangedJavaElement(children[i]);
- }
- }
- }
-
- private void updateChangedJavaModel(IJavaElementDelta delta, IJavaElement element) {
- switch (delta.getKind()) {
- case IJavaElementDelta.ADDED :
- case IJavaElementDelta.REMOVED :
- uncacheAllTypes();
- break;
- case IJavaElementDelta.CHANGED :
- updateChangedChildren(delta);
- break;
- }
- }
-
- private void updateChangedJavaProject(IJavaElementDelta delta, IJavaElement element) {
- int kind = delta.getKind();
- int flags = delta.getFlags();
- if ((flags & IJavaElementDelta.F_OPENED) != 0) {
- kind = IJavaElementDelta.ADDED; // affected in the same way
- }
- if ((flags & IJavaElementDelta.F_CLOSED) != 0) {
- kind = IJavaElementDelta.REMOVED; // affected in the same way
- }
- switch (kind) {
- case IJavaElementDelta.ADDED :
- case IJavaElementDelta.REMOVED :
- uncacheAllTypes();
- break;
- case IJavaElementDelta.CHANGED :
- updateChangedChildren(delta);
- break;
- }
- }
-
- private void updateChangedPackageFragment(IJavaElementDelta delta, IPackageFragment element) {
- switch (delta.getKind()) {
- case IJavaElementDelta.ADDED :
- // if the package fragment is in the projects being considered, this could
- // introduce new types, changing the hierarchy
- case IJavaElementDelta.REMOVED :
- // is a change if the package fragment contains supertypes?
- uncacheAllTypes();
- break;
- case IJavaElementDelta.CHANGED :
- // look at the files in the package fragment
- updateChangedChildren(delta);
- }
- }
-
- private void updateChangedPackageFragmentRoot(IJavaElementDelta delta, IJavaElement element) {
- switch (delta.getKind()) {
- case IJavaElementDelta.ADDED :
- case IJavaElementDelta.REMOVED :
- uncacheAllTypes();
- break;
- case IJavaElementDelta.CHANGED :
- int flags = delta.getFlags();
- if (((flags & IJavaElementDelta.F_ADDED_TO_CLASSPATH) > 0)||(flags & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) > 0) {
- uncacheAllTypes();
- } else {
- updateChangedChildren(delta);
- }
- break;
- }
- }
-
- /**Removes all cached info that may be affected by the change in this IOpenable
- * @param delta - the change in the java model
- * @param element - the (changed) IOpenable considered
- */
- protected void updateChangedOpenable(IJavaElementDelta delta, IJavaElement element) {
- if (element instanceof ITypeRoot) {
- ITypeRoot typeRoot = (ITypeRoot) element;
- uncacheAffectedTypes(typeRoot);
- // Creates missing superclass for any cached type?
- if (delta.getKind() == IJavaElementDelta.ADDED) {
- if (typeRoot instanceof ICompilationUnit) {
- ICompilationUnit cu = (ICompilationUnit) typeRoot;
- try {
- IType[] types = cu.getAllTypes();
- for (int i = 0; i < types.length; i++) {
- uncacheTypesWithMissingSupertype(types[i].getElementName());
- }
- } catch (JavaModelException e) {
- JSFCommonPlugin.log(IStatus.INFO, "Unable to get types for compilation unit " + cu, e); //$NON-NLS-1$
- uncacheAllTypes();
- }
- } else if (typeRoot instanceof IClassFile) {
- IClassFile cf = (IClassFile) typeRoot;
- IType type = cf.getType();
- uncacheTypesWithMissingSupertype(type.getElementName());
- }
- }
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeTransformer.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeTransformer.java
deleted file mode 100644
index 4c5718f89..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeTransformer.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.internal.types;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jdt.core.Signature;
-
-/**
- * Transforms one CompositeType to another according to particular
- * transform rules.
- *
- * In general, every transformation should be of the form:
- *
- * CompositeType transform(CompositeType original, other inputs...);
- *
- * @author cbateman
- *
- */
-public class TypeTransformer
-{
- private final static Map boxConversions = new HashMap();
- private final static Map unBoxConversions = new HashMap();
-
- static
- {
- // see jdt.core.Signature or JVM link spec for more details
- boxConversions.put("B", "Ljava.lang.Byte;"); //$NON-NLS-1$//$NON-NLS-2$
- boxConversions.put("C", "Ljava.lang.Character;"); //$NON-NLS-1$ //$NON-NLS-2$
- boxConversions.put("D", "Ljava.lang.Double;"); //$NON-NLS-1$ //$NON-NLS-2$
- boxConversions.put("F", "Ljava.lang.Float;"); //$NON-NLS-1$ //$NON-NLS-2$
- boxConversions.put("I", "Ljava.lang.Integer;"); //$NON-NLS-1$ //$NON-NLS-2$
- boxConversions.put("J", "Ljava.lang.Long;"); //$NON-NLS-1$ //$NON-NLS-2$
- boxConversions.put("S", "Ljava.lang.Short;"); //$NON-NLS-1$ //$NON-NLS-2$
- boxConversions.put("Z", "Ljava.lang.Boolean;"); //$NON-NLS-1$ //$NON-NLS-2$
- // don't box V
- boxConversions.put("V", "V"); //$NON-NLS-1$ //$NON-NLS-2$
-
- // invert hte box conversions
- for (final Iterator it = boxConversions.keySet().iterator(); it.hasNext();)
- {
- final String newValue = (String) it.next();
- final String newKey = (String) boxConversions.get(newValue);
- if (unBoxConversions.put(newKey, newValue) != null)
- {
- // if put returns non-null then we have replaced a key
- // added on a previous iteration. This implies
- // that box mappings are no longer one-to-one
- throw new AssertionError("Duplicated boxing value"); //$NON-NLS-1$
- }
- }
- }
-
- /**
- * @param compositeType
- * @return an equivilent form of compositeType with all primitive type
- * signatures converted to their fully qualified boxed equivilent but
- * otherwise unchanged.
- *
- * Example: J -> Ljava.lang.Long;
- */
- public static CompositeType transformBoxPrimitives(CompositeType compositeType)
- {
- String[] signatures = compositeType.getSignatures();
- String[] newsignatures = new String[signatures.length];
-
- for (int i = 0; i < signatures.length; i++)
- {
- newsignatures[i] = transformBoxPrimitives(signatures[i]);
- }
-
- return new CompositeType(newsignatures, compositeType.getAssignmentTypeMask());
- }
-
- /**
- * Performs boxing for a single typeSignature string
- * @param curSignature
- * @return the boxed signature
- */
- public static String transformBoxPrimitives(final String curSignature)
- {
- String newSignature = curSignature;
-
- // first determine if we have a type or method signature
- try
- {
- int kind = Signature.getTypeSignatureKind(curSignature);
-
- // interested in base types, since these need boxing
- if (kind == Signature.BASE_TYPE_SIGNATURE)
- {
- // grab the box for the primitive
- newSignature = (String) boxConversions.get(curSignature);
- }
- else if (kind == Signature.ARRAY_TYPE_SIGNATURE)
- {
- // check if it's array of primitives
- final String baseType = Signature.getElementType(curSignature);
-
- if (Signature.getTypeSignatureKind(baseType) == Signature.BASE_TYPE_SIGNATURE)
- {
- // it is, so box it
- final String newBaseType = (String) boxConversions.get(baseType);
- final int numBraces = Signature.getArrayCount(curSignature);
- newSignature = ""; //$NON-NLS-1$
- for (int j = 0; j < numBraces; j++)
- {
- newSignature += "["; //$NON-NLS-1$
- }
-
- newSignature += newBaseType;
- }
- }
- }
- catch (IllegalArgumentException e)
- {
- // signature was not a type signature, so must be a method sig
- // do nothing: don't box method types
- }
-
- return newSignature;
- }
-
- /**
- * Performs the exact inverse of transformBoxPrimitives -- takes all
- * boxing type signatures and replaces them with their primitive equivilent
- * @param compositeType
- * @return a new composite with all boxed primitives unboxed
- */
- public static CompositeType transformUnboxPrimitives(CompositeType compositeType)
- {
- String[] signatures = compositeType.getSignatures();
- String[] newsignatures = new String[signatures.length];
-
- for (int i = 0; i < signatures.length; i++)
- {
- newsignatures[i] = transformUnboxPrimitives(signatures[i]);
- }
-
- return new CompositeType(newsignatures, compositeType.getAssignmentTypeMask());
- }
-
- /**
- * Performs unboxing for a single typeSignature string
- *
- * @param typeSignature
- * @return the transformed signature
- */
- public static String transformUnboxPrimitives(final String typeSignature)
- {
- String newSignature = typeSignature;
-
- // first determine if we have a type or method signature
- try
- {
- int kind = Signature.getTypeSignatureKind(typeSignature);
-
- // interested in class types, since these need boxing
- if (kind == Signature.CLASS_TYPE_SIGNATURE)
- {
- // grab the box for the primitive
- String checkForUnbox = (String) unBoxConversions.get(typeSignature);
-
- if (checkForUnbox != null)
- {
- newSignature = checkForUnbox;
- }
- }
- else if (kind == Signature.ARRAY_TYPE_SIGNATURE)
- {
- // check if it's array of objects
- final String baseType = Signature.getElementType(typeSignature);
-
- if (Signature.getTypeSignatureKind(baseType) == Signature.CLASS_TYPE_SIGNATURE)
- {
- // it is, so unbox it
- final String newBaseTypeCandidate = (String) unBoxConversions.get(baseType);
-
- if (newBaseTypeCandidate != null)
- {
- final int numBraces = Signature.getArrayCount(typeSignature);
- newSignature = ""; //$NON-NLS-1$
- for (int j = 0; j < numBraces; j++)
- {
- newSignature += "["; //$NON-NLS-1$
- }
-
- newSignature += newBaseTypeCandidate;
- }
- }
- }
- }
- catch (IllegalArgumentException e)
- {
- // signature was not a type signature, so must be a method sig
- // do nothing: don't box method types
- }
-
- return newSignature;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeUtil.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeUtil.java
deleted file mode 100644
index a302fc4d6..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/TypeUtil.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.internal.types;
-
-import org.eclipse.jdt.core.Signature;
-
-/**
- * Package utility class
- * @author cbateman
- *
- */
-/*package*/final class TypeUtil
-{
- /**
- * @param assignmentType
- * @return true if assignmentType has lhs flag set
- */
- public static boolean matchesLHS(int assignmentType)
- {
- return (assignmentType & IAssignable.ASSIGNMENT_TYPE_LHS) != 0;
- }
-
- /**
- * @param assignmentType
- * @return true if assignmentType has rhs flag set
- */
- public static boolean matchesRHS(int assignmentType)
- {
- return (assignmentType & IAssignable.ASSIGNMENT_TYPE_RHS) != 0;
- }
-
- /**
- * @param signature
- * @return true if the signature is a method signature
- */
- public static boolean isMethodSignature(final String signature)
- {
- // method signature must start with a "("
- return signature.charAt(0) == Signature.C_PARAM_START;
- }
- private TypeUtil() {/*not instantiable*/}
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/ValueType.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/ValueType.java
deleted file mode 100644
index 2d1282586..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/ValueType.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.internal.types;
-
-import org.eclipse.jdt.core.Signature;
-
-/**
- * Value object representing a value binding type by it's type and assignability
- * information
- *
- * @author cbateman
- *
- */
-public class ValueType implements SignatureBasedType, IAssignable
-{
- /**
- * A default empty string array
- */
- protected final static String[] EMPTY_STRING_ARRAY = new String[0];
-
- private final String _signature;
- private final String[] _typeArgs;
- private final int _assignmentMask;
- private final String[] _superTypes;
- private final String[] _interfaceTypes;
-
- private final boolean _isEnumType;
-
- private String[] _allTypes; // lazy creation on getAllTypes
-
- /**
- * Construct a new ValueType object with the given
- * signature
- *
- * @param signature
- * @param typeArgs generic type arguments for signature or empty if none
- * @param superTypes
- * @param interfaceTypes
- * @param isEnumType
- * @param assignmentMask
- */
- public ValueType(final String signature,
- final String[] typeArgs,
- final String[] superTypes,
- final String[] interfaceTypes,
- final boolean isEnumType,
- final int assignmentMask)
- {
- if (signature == null)
- {
- throw new AssertionError("signature can never be null"); //$NON-NLS-1$
- }
-
- _signature = signature;
- _typeArgs = typeArgs;
- _assignmentMask = assignmentMask;
- _superTypes = superTypes != null ? superTypes : EMPTY_STRING_ARRAY;
- _interfaceTypes = interfaceTypes != null ? interfaceTypes : EMPTY_STRING_ARRAY;
- _isEnumType = isEnumType;
- }
-
- /**
- * Copy constructor equivilent to
- * ValueType(template.getSignature(), template.getSuperTypes(), template.getInterfaceTypes(),assingmentMask, template._isEnumType)
- *
- * @param template
- * @param assignmentMask
- */
- public ValueType(final ValueType template, final int assignmentMask)
- {
- this(template._signature, template._typeArgs, template._superTypes,
- template._interfaceTypes, template._isEnumType, assignmentMask);
- }
-
- /**
- * Convienence constructor for creating ValueType's with no supertype, type argument
- * or interface info. Equivilent to:
- * ValueType(signature, new String[0], new String[0], new String[0], false, assignmentMask)
- *
- * @param signature
- * @param assignmentMask
- */
- public ValueType(final String signature, final int assignmentMask)
- {
- this(signature, EMPTY_STRING_ARRAY, EMPTY_STRING_ARRAY, EMPTY_STRING_ARRAY, false, assignmentMask);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.core.internal.types.SignatureBasedType#getSignature()
- */
- public String getSignature()
- {
- return _signature;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.internal.types.IAssignable#getAssignability()
- */
- public int getAssignability() {
- return _assignmentMask;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.internal.types.IAssignable#isLHS()
- */
- public boolean isLHS() {
- return TypeUtil.matchesLHS(_assignmentMask);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.internal.types.IAssignable#isRHS()
- */
- public boolean isRHS() {
- return TypeUtil.matchesRHS(_assignmentMask);
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return Signature.getSignatureSimpleName
- (TypeTransformer.transformBoxPrimitives(_signature));
- }
-
- /**
- * @return an array of all signatures of all super types or empty
- * array if there are no super types for this type
- *
- * Note: if isArray() == true, then these are the super types of
- * the base element
- */
- public String[] getSuperTypes()
- {
- return _superTypes;
- }
-
- /**
- * @return an array of all interfaces implemented or empty array
- * if none
- *
- * Note: if isArray() == true, then these are the interfacess of
- * the base element
- */
- public String[] getInterfaceTypes()
- {
- return _interfaceTypes;
- }
-
- /**
- * @return all types including the base type, super types and interface
- * types.
- *
- * Note: if isArray() == true, then these are the super types of
- * the base element
-
- */
- public String[] getAllTypes()
- {
- if (_allTypes == null)
- {
- int numberOfTypes = 1 + _superTypes.length + _interfaceTypes.length;
- _allTypes = new String[numberOfTypes];
- _allTypes[0] = _signature;
- System.arraycopy(_superTypes, 0, _allTypes, 1, _superTypes.length);
- System.arraycopy(_interfaceTypes, 0, _allTypes, 1+_superTypes.length, _interfaceTypes.length);
- }
- return _allTypes;
- }
-
- /**
- * @return the type arguments for getSignature() if any or empty array if none
- */
- public String[] getTypeArguments()
- {
- return _typeArgs;
- }
-
- /**
- *
- */
- public CompositeType toCompositeType()
- {
- return new CompositeType(getAllTypes(), getAssignability());
- }
-
- /**
- * @param signature
- * @return true if an instance of this type would satisfy instanceof signature
- *
- */
- public boolean isInstanceOf(final String signature)
- {
- // if this is an array, then the super types are for the base
- // type and we can't be an instance of anything but signature
- if (isArray())
- {
- return getSignature().equals(signature);
- }
-
- final String[] allTypes = getAllTypes();
-
- for (int i = 0; i < allTypes.length; i++)
- {
- if (allTypes[i].equals(signature))
- {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * @return true if this is an array type
- */
- public boolean isArray()
- {
- return Signature.getArrayCount(getSignature()) > 0;
- }
-
- /**
- * @return true if the value type represents a (>=Java5) enum type
- */
- public boolean isEnumType() {
- return _isEnumType;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/messages.properties b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/messages.properties
deleted file mode 100644
index b34c98b7c..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/types/messages.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2007 Oracle 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-TypeComparator.Expression.Doesnt.Match.Expected.Types=EL expression does not evaluate to expected types for this attribute
-TypeComparator.Parameter.count.mismatch=Parameter count mismatch
-TypeComparator.Type.mismatch.on.parameter=Type mismatch on parameter
-TypeComparator.Return.Types.Dont.Match=Return types don't match
-TypeComparator.Expression.Not.Gettable=Expression is not gettable
-TypeComparator.Expression.Expected.Settable=Attribute expects settable value, but expression is not settable
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/Entity.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/Entity.java
deleted file mode 100644
index 6af707ee5..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/Entity.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.jsf.common.metadata;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.jsf.common.metadata.query.IEntityVisitor;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Entity</b></em>'.
- * <p><b>Provisional API - subject to change</b></p>
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.Entity#getChildEntities <em>Child Entities</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.Entity#getTraits <em>Traits</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.Entity#getId <em>Id</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.Entity#getType <em>Type</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.Entity#getIncludeGroups <em>Include Groups</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.jsf.common.metadata.MetadataPackage#getEntity()
- * @model extendedMetaData="kind='element' name='entity'"
- * @generated
- */
-public interface Entity extends EObject {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * Returns the value of the '<em><b>Child Entities</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jst.jsf.common.metadata.Entity}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Child Entities</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Child Entities</em>' containment reference list.
- * @see org.eclipse.jst.jsf.common.metadata.MetadataPackage#getEntity_ChildEntities()
- * @model type="org.eclipse.jst.jsf.common.metadata.Entity" containment="true"
- * extendedMetaData="kind='element' name='entity'"
- * @generated
- */
- EList getChildEntities();
-
- /**
- * Returns the value of the '<em><b>Traits</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jst.jsf.common.metadata.Trait}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Traits</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Traits</em>' containment reference list.
- * @see org.eclipse.jst.jsf.common.metadata.MetadataPackage#getEntity_Traits()
- * @model type="org.eclipse.jst.jsf.common.metadata.Trait" containment="true"
- * extendedMetaData="kind='element' name='trait'"
- * @generated
- */
- EList getTraits();
-
- /**
- * Returns the value of the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Id</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Id</em>' attribute.
- * @see #setId(String)
- * @see org.eclipse.jst.jsf.common.metadata.MetadataPackage#getEntity_Id()
- * @model id="true" required="true"
- * @generated
- */
- String getId();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.common.metadata.Entity#getId <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Id</em>' attribute.
- * @see #getId()
- * @generated
- */
- void setId(String value);
-
- /**
- * Returns the value of the '<em><b>Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type</em>' attribute.
- * @see #setType(String)
- * @see org.eclipse.jst.jsf.common.metadata.MetadataPackage#getEntity_Type()
- * @model
- * @generated
- */
- String getType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.common.metadata.Entity#getType <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Type</em>' attribute.
- * @see #getType()
- * @generated
- */
- void setType(String value);
-
- /**
- * Returns the value of the '<em><b>Include Groups</b></em>' reference list.
- * The list contents are of type {@link org.eclipse.jst.jsf.common.metadata.IncludeEntityGroup}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Include Groups</em>' reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Include Groups</em>' reference list.
- * @see org.eclipse.jst.jsf.common.metadata.MetadataPackage#getEntity_IncludeGroups()
- * @model type="org.eclipse.jst.jsf.common.metadata.IncludeEntityGroup"
- * extendedMetaData="kind='element' name='include-entity-group'"
- * @generated
- */
- EList getIncludeGroups();
-
- /**
- * <!-- begin-user-doc -->
- * @param visitor
- * <!-- end-user-doc -->
- * @model visitorDataType="org.eclipse.jst.jsf.common.metadata.query.IEntityVisitor"
- * @generated
- */
- void accept(IEntityVisitor visitor);
-
- /**
- * <!-- begin-user-doc -->
- * @return Model
- * <!-- end-user-doc -->
- * @model kind="operation"
- * @generated
- */
- Model getModel();
-
-} // Entity
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/EntityGroup.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/EntityGroup.java
deleted file mode 100644
index 09e9f73b1..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/EntityGroup.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.jsf.common.metadata;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Entity Group</b></em>'.
- * <p><b>Provisional API - subject to change</b></p>
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jst.jsf.common.metadata.MetadataPackage#getEntityGroup()
- * @model
- * @generated
- */
-public interface EntityGroup extends Entity {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
-} // EntityGroup
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/IncludeEntityGroup.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/IncludeEntityGroup.java
deleted file mode 100644
index be4f1463f..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/IncludeEntityGroup.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.jsf.common.metadata;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Include Entity Group</b></em>'.
- * <p><b>Provisional API - subject to change</b></p>
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.IncludeEntityGroup#getId <em>Id</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.IncludeEntityGroup#getModelUri <em>Model Uri</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.jsf.common.metadata.MetadataPackage#getIncludeEntityGroup()
- * @model
- * @generated
- */
-public interface IncludeEntityGroup extends EObject {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation"; //$NON-NLS-1$
-
- /**
- * Returns the value of the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Id</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Id</em>' attribute.
- * @see #setId(String)
- * @see org.eclipse.jst.jsf.common.metadata.MetadataPackage#getIncludeEntityGroup_Id()
- * @model required="true"
- * @generated
- */
- String getId();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.common.metadata.IncludeEntityGroup#getId <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Id</em>' attribute.
- * @see #getId()
- * @generated
- */
- void setId(String value);
-
- /**
- * Returns the value of the '<em><b>Model Uri</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Model Uri</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Model Uri</em>' attribute.
- * @see #setModelUri(String)
- * @see org.eclipse.jst.jsf.common.metadata.MetadataPackage#getIncludeEntityGroup_ModelUri()
- * @model extendedMetaData="name='uri'"
- * @generated
- */
- String getModelUri();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.common.metadata.IncludeEntityGroup#getModelUri <em>Model Uri</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Model Uri</em>' attribute.
- * @see #getModelUri()
- * @generated
- */
- void setModelUri(String value);
-
-} // IncludeEntityGroup
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/MetadataFactory.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/MetadataFactory.java
deleted file mode 100644
index 8b8ea0c04..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/MetadataFactory.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.jsf.common.metadata;
-
-import org.eclipse.emf.ecore.EFactory;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- * <p><b>NOT API</b></p>
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.MetadataPackage
- * @generated
- */
-public interface MetadataFactory extends EFactory {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation"; //$NON-NLS-1$
-
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- MetadataFactory eINSTANCE = org.eclipse.jst.jsf.common.metadata.internal.impl.MetadataFactoryImpl.init();
-
- /**
- * Returns a new object of class '<em>Trait</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Trait</em>'.
- * @generated
- */
- Trait createTrait();
-
- /**
- * Returns a new object of class '<em>Include Entity Group</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Include Entity Group</em>'.
- * @generated
- */
- IncludeEntityGroup createIncludeEntityGroup();
-
- /**
- * Returns a new object of class '<em>Model</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Model</em>'.
- * @generated
- */
- Model createModel();
-
- /**
- * Returns a new object of class '<em>Entity</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Entity</em>'.
- * @generated
- */
- Entity createEntity();
-
- /**
- * Returns a new object of class '<em>Entity Group</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Entity Group</em>'.
- * @generated
- */
- EntityGroup createEntityGroup();
-
- /**
- * Returns the package supported by this factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the package supported by this factory.
- * @generated
- */
- MetadataPackage getMetadataPackage();
-
-} //MetadataFactory
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/MetadataPackage.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/MetadataPackage.java
deleted file mode 100644
index f97e3c89b..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/MetadataPackage.java
+++ /dev/null
@@ -1,892 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.jsf.common.metadata;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <p><b>NOT API</b></p>
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.MetadataFactory
- * @model kind="package"
- * @generated
- */
-public interface MetadataPackage extends EPackage {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNAME = "metadata";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNS_URI = "http://org.eclipse.jst.jsf.common.metadata/metadata.ecore";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNS_PREFIX = "md";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- MetadataPackage eINSTANCE = org.eclipse.jst.jsf.common.metadata.internal.impl.MetadataPackageImpl.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.common.metadata.internal.impl.TraitImpl <em>Trait</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.TraitImpl
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.MetadataPackageImpl#getTrait()
- * @generated
- */
- int TRAIT = 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.common.metadata.internal.impl.EntityImpl <em>Entity</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.EntityImpl
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.MetadataPackageImpl#getEntity()
- * @generated
- */
- int ENTITY = 2;
-
- /**
- * The feature id for the '<em><b>Child Entities</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ENTITY__CHILD_ENTITIES = 0;
-
- /**
- * The feature id for the '<em><b>Traits</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ENTITY__TRAITS = 1;
-
- /**
- * The feature id for the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ENTITY__ID = 2;
-
- /**
- * The feature id for the '<em><b>Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ENTITY__TYPE = 3;
-
- /**
- * The feature id for the '<em><b>Include Groups</b></em>' reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ENTITY__INCLUDE_GROUPS = 4;
-
- /**
- * The number of structural features of the '<em>Entity</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ENTITY_FEATURE_COUNT = 5;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.common.metadata.internal.impl.ModelImpl <em>Model</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.ModelImpl
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.MetadataPackageImpl#getModel()
- * @generated
- */
- int MODEL = 0;
-
- /**
- * The feature id for the '<em><b>Child Entities</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int MODEL__CHILD_ENTITIES = ENTITY__CHILD_ENTITIES;
-
- /**
- * The feature id for the '<em><b>Traits</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int MODEL__TRAITS = ENTITY__TRAITS;
-
- /**
- * The feature id for the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int MODEL__ID = ENTITY__ID;
-
- /**
- * The feature id for the '<em><b>Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int MODEL__TYPE = ENTITY__TYPE;
-
- /**
- * The feature id for the '<em><b>Include Groups</b></em>' reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int MODEL__INCLUDE_GROUPS = ENTITY__INCLUDE_GROUPS;
-
- /**
- * The feature id for the '<em><b>Entity Groups</b></em>' reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int MODEL__ENTITY_GROUPS = ENTITY_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Source Model Provider</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int MODEL__SOURCE_MODEL_PROVIDER = ENTITY_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Current Model Context</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int MODEL__CURRENT_MODEL_CONTEXT = ENTITY_FEATURE_COUNT + 2;
-
- /**
- * The number of structural features of the '<em>Model</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int MODEL_FEATURE_COUNT = ENTITY_FEATURE_COUNT + 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.common.metadata.internal.impl.IncludeEntityGroupImpl <em>Include Entity Group</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.IncludeEntityGroupImpl
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.MetadataPackageImpl#getIncludeEntityGroup()
- * @generated
- */
- int INCLUDE_ENTITY_GROUP = 4;
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.common.metadata.internal.impl.EntityGroupImpl <em>Entity Group</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.EntityGroupImpl
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.MetadataPackageImpl#getEntityGroup()
- * @generated
- */
- int ENTITY_GROUP = 1;
-
- /**
- * The feature id for the '<em><b>Child Entities</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ENTITY_GROUP__CHILD_ENTITIES = ENTITY__CHILD_ENTITIES;
-
- /**
- * The feature id for the '<em><b>Traits</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ENTITY_GROUP__TRAITS = ENTITY__TRAITS;
-
- /**
- * The feature id for the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ENTITY_GROUP__ID = ENTITY__ID;
-
- /**
- * The feature id for the '<em><b>Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ENTITY_GROUP__TYPE = ENTITY__TYPE;
-
- /**
- * The feature id for the '<em><b>Include Groups</b></em>' reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ENTITY_GROUP__INCLUDE_GROUPS = ENTITY__INCLUDE_GROUPS;
-
- /**
- * The number of structural features of the '<em>Entity Group</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int ENTITY_GROUP_FEATURE_COUNT = ENTITY_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TRAIT__ID = 0;
-
- /**
- * The feature id for the '<em><b>Value</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TRAIT__VALUE = 1;
-
- /**
- * The feature id for the '<em><b>Source Model Provider</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TRAIT__SOURCE_MODEL_PROVIDER = 2;
-
- /**
- * The number of structural features of the '<em>Trait</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TRAIT_FEATURE_COUNT = 3;
-
- /**
- * The feature id for the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int INCLUDE_ENTITY_GROUP__ID = 0;
-
- /**
- * The feature id for the '<em><b>Model Uri</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int INCLUDE_ENTITY_GROUP__MODEL_URI = 1;
-
- /**
- * The number of structural features of the '<em>Include Entity Group</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int INCLUDE_ENTITY_GROUP_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '<em>ITrait Visitor</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.query.ITraitVisitor
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.MetadataPackageImpl#getITraitVisitor()
- * @generated
- */
- int ITRAIT_VISITOR = 5;
-
- /**
- * The meta object id for the '<em>IEntity Visitor</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.query.IEntityVisitor
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.MetadataPackageImpl#getIEntityVisitor()
- * @generated
- */
- int IENTITY_VISITOR = 6;
-
- /**
- * The meta object id for the '<em>IMeta Data Source Model Provider</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.MetadataPackageImpl#getIMetaDataSourceModelProvider()
- * @generated
- */
- int IMETA_DATA_SOURCE_MODEL_PROVIDER = 7;
-
-
- /**
- * The meta object id for the '<em>Model Context</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.internal.ModelKeyDescriptor
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.MetadataPackageImpl#getModelContext()
- * @generated
- */
- int MODEL_CONTEXT = 8;
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.common.metadata.Trait <em>Trait</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Trait</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.Trait
- * @generated
- */
- EClass getTrait();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.common.metadata.Trait#getId <em>Id</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Id</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.Trait#getId()
- * @see #getTrait()
- * @generated
- */
- EAttribute getTrait_Id();
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jst.jsf.common.metadata.Trait#getValue <em>Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Value</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.Trait#getValue()
- * @see #getTrait()
- * @generated
- */
- EReference getTrait_Value();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.common.metadata.Trait#getSourceModelProvider <em>Source Model Provider</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Source Model Provider</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.Trait#getSourceModelProvider()
- * @see #getTrait()
- * @generated
- */
- EAttribute getTrait_SourceModelProvider();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.common.metadata.IncludeEntityGroup <em>Include Entity Group</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Include Entity Group</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.IncludeEntityGroup
- * @generated
- */
- EClass getIncludeEntityGroup();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.common.metadata.IncludeEntityGroup#getId <em>Id</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Id</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.IncludeEntityGroup#getId()
- * @see #getIncludeEntityGroup()
- * @generated
- */
- EAttribute getIncludeEntityGroup_Id();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.common.metadata.IncludeEntityGroup#getModelUri <em>Model Uri</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Model Uri</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.IncludeEntityGroup#getModelUri()
- * @see #getIncludeEntityGroup()
- * @generated
- */
- EAttribute getIncludeEntityGroup_ModelUri();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.common.metadata.Model <em>Model</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Model</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.Model
- * @generated
- */
- EClass getModel();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.common.metadata.Model#getSourceModelProvider <em>Source Model Provider</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Source Model Provider</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.Model#getSourceModelProvider()
- * @see #getModel()
- * @generated
- */
- EAttribute getModel_SourceModelProvider();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.common.metadata.Model#getCurrentModelContext <em>Current Model Context</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Current Model Context</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.Model#getCurrentModelContext()
- * @see #getModel()
- * @generated
- */
- EAttribute getModel_CurrentModelContext();
-
- /**
- * Returns the meta object for the reference list '{@link org.eclipse.jst.jsf.common.metadata.Model#getEntityGroups <em>Entity Groups</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the reference list '<em>Entity Groups</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.Model#getEntityGroups()
- * @see #getModel()
- * @generated
- */
- EReference getModel_EntityGroups();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.common.metadata.Entity <em>Entity</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Entity</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.Entity
- * @generated
- */
- EClass getEntity();
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jst.jsf.common.metadata.Entity#getChildEntities <em>Child Entities</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Child Entities</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.Entity#getChildEntities()
- * @see #getEntity()
- * @generated
- */
- EReference getEntity_ChildEntities();
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jst.jsf.common.metadata.Entity#getTraits <em>Traits</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Traits</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.Entity#getTraits()
- * @see #getEntity()
- * @generated
- */
- EReference getEntity_Traits();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.common.metadata.Entity#getId <em>Id</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Id</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.Entity#getId()
- * @see #getEntity()
- * @generated
- */
- EAttribute getEntity_Id();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.common.metadata.Entity#getType <em>Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Type</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.Entity#getType()
- * @see #getEntity()
- * @generated
- */
- EAttribute getEntity_Type();
-
- /**
- * Returns the meta object for the reference list '{@link org.eclipse.jst.jsf.common.metadata.Entity#getIncludeGroups <em>Include Groups</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the reference list '<em>Include Groups</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.Entity#getIncludeGroups()
- * @see #getEntity()
- * @generated
- */
- EReference getEntity_IncludeGroups();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.common.metadata.EntityGroup <em>Entity Group</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Entity Group</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.EntityGroup
- * @generated
- */
- EClass getEntityGroup();
-
- /**
- * Returns the meta object for data type '{@link org.eclipse.jst.jsf.common.metadata.query.ITraitVisitor <em>ITrait Visitor</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for data type '<em>ITrait Visitor</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.query.ITraitVisitor
- * @model instanceClass="org.eclipse.jst.jsf.common.metadata.query.ITraitVisitor" serializable="false"
- * @generated
- */
- EDataType getITraitVisitor();
-
- /**
- * Returns the meta object for data type '{@link org.eclipse.jst.jsf.common.metadata.query.IEntityVisitor <em>IEntity Visitor</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for data type '<em>IEntity Visitor</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.query.IEntityVisitor
- * @model instanceClass="org.eclipse.jst.jsf.common.metadata.query.IEntityVisitor" serializable="false"
- * @generated
- */
- EDataType getIEntityVisitor();
-
- /**
- * Returns the meta object for data type '{@link org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider <em>IMeta Data Source Model Provider</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for data type '<em>IMeta Data Source Model Provider</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider
- * @model instanceClass="org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider"
- * @generated
- */
- EDataType getIMetaDataSourceModelProvider();
-
- /**
- * Returns the meta object for data type '{@link org.eclipse.jst.jsf.common.metadata.internal.ModelKeyDescriptor <em>Model Context</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for data type '<em>Model Context</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.internal.ModelKeyDescriptor
- * @model instanceClass="org.eclipse.jst.jsf.common.metadata.internal.ModelKeyDescriptor"
- * @generated
- */
- EDataType getModelContext();
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- MetadataFactory getMetadataFactory();
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- interface Literals {
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.common.metadata.internal.impl.TraitImpl <em>Trait</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.TraitImpl
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.MetadataPackageImpl#getTrait()
- * @generated
- */
- @SuppressWarnings("hiding")
- EClass TRAIT = eINSTANCE.getTrait();
-
- /**
- * The meta object literal for the '<em><b>Id</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("hiding")
- EAttribute TRAIT__ID = eINSTANCE.getTrait_Id();
-
- /**
- * The meta object literal for the '<em><b>Value</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("hiding")
- EReference TRAIT__VALUE = eINSTANCE.getTrait_Value();
-
- /**
- * The meta object literal for the '<em><b>Source Model Provider</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("hiding")
- EAttribute TRAIT__SOURCE_MODEL_PROVIDER = eINSTANCE.getTrait_SourceModelProvider();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.common.metadata.internal.impl.IncludeEntityGroupImpl <em>Include Entity Group</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.IncludeEntityGroupImpl
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.MetadataPackageImpl#getIncludeEntityGroup()
- * @generated
- */
- @SuppressWarnings("hiding")
- EClass INCLUDE_ENTITY_GROUP = eINSTANCE.getIncludeEntityGroup();
-
- /**
- * The meta object literal for the '<em><b>Id</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("hiding")
- EAttribute INCLUDE_ENTITY_GROUP__ID = eINSTANCE.getIncludeEntityGroup_Id();
-
- /**
- * The meta object literal for the '<em><b>Model Uri</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("hiding")
- EAttribute INCLUDE_ENTITY_GROUP__MODEL_URI = eINSTANCE.getIncludeEntityGroup_ModelUri();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.common.metadata.internal.impl.ModelImpl <em>Model</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.ModelImpl
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.MetadataPackageImpl#getModel()
- * @generated
- */
- @SuppressWarnings("hiding")
- EClass MODEL = eINSTANCE.getModel();
-
- /**
- * The meta object literal for the '<em><b>Source Model Provider</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("hiding")
- EAttribute MODEL__SOURCE_MODEL_PROVIDER = eINSTANCE.getModel_SourceModelProvider();
-
- /**
- * The meta object literal for the '<em><b>Current Model Context</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("hiding")
- EAttribute MODEL__CURRENT_MODEL_CONTEXT = eINSTANCE.getModel_CurrentModelContext();
-
- /**
- * The meta object literal for the '<em><b>Entity Groups</b></em>' reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("hiding")
- EReference MODEL__ENTITY_GROUPS = eINSTANCE.getModel_EntityGroups();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.common.metadata.internal.impl.EntityImpl <em>Entity</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.EntityImpl
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.MetadataPackageImpl#getEntity()
- * @generated
- */
- @SuppressWarnings("hiding")
- EClass ENTITY = eINSTANCE.getEntity();
-
- /**
- * The meta object literal for the '<em><b>Child Entities</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("hiding")
- EReference ENTITY__CHILD_ENTITIES = eINSTANCE.getEntity_ChildEntities();
-
- /**
- * The meta object literal for the '<em><b>Traits</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("hiding")
- EReference ENTITY__TRAITS = eINSTANCE.getEntity_Traits();
-
- /**
- * The meta object literal for the '<em><b>Id</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("hiding")
- EAttribute ENTITY__ID = eINSTANCE.getEntity_Id();
-
- /**
- * The meta object literal for the '<em><b>Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("hiding")
- EAttribute ENTITY__TYPE = eINSTANCE.getEntity_Type();
-
- /**
- * The meta object literal for the '<em><b>Include Groups</b></em>' reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("hiding")
- EReference ENTITY__INCLUDE_GROUPS = eINSTANCE.getEntity_IncludeGroups();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.common.metadata.internal.impl.EntityGroupImpl <em>Entity Group</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.EntityGroupImpl
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.MetadataPackageImpl#getEntityGroup()
- * @generated
- */
- @SuppressWarnings("hiding")
- EClass ENTITY_GROUP = eINSTANCE.getEntityGroup();
-
- /**
- * The meta object literal for the '<em>ITrait Visitor</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.query.ITraitVisitor
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.MetadataPackageImpl#getITraitVisitor()
- * @generated
- */
- @SuppressWarnings("hiding")
- EDataType ITRAIT_VISITOR = eINSTANCE.getITraitVisitor();
-
- /**
- * The meta object literal for the '<em>IEntity Visitor</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.query.IEntityVisitor
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.MetadataPackageImpl#getIEntityVisitor()
- * @generated
- */
- @SuppressWarnings("hiding")
- EDataType IENTITY_VISITOR = eINSTANCE.getIEntityVisitor();
-
- /**
- * The meta object literal for the '<em>IMeta Data Source Model Provider</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.MetadataPackageImpl#getIMetaDataSourceModelProvider()
- * @generated
- */
- @SuppressWarnings("hiding")
- EDataType IMETA_DATA_SOURCE_MODEL_PROVIDER = eINSTANCE.getIMetaDataSourceModelProvider();
-
- /**
- * The meta object literal for the '<em>Model Context</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.internal.ModelKeyDescriptor
- * @see org.eclipse.jst.jsf.common.metadata.internal.impl.MetadataPackageImpl#getModelContext()
- * @generated
- */
- @SuppressWarnings("hiding")
- EDataType MODEL_CONTEXT = eINSTANCE.getModelContext();
-
- }
-
-} //MetadataPackage
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/Model.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/Model.java
deleted file mode 100644
index fbc5ada2d..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/Model.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.jsf.common.metadata;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider;
-import org.eclipse.jst.jsf.common.metadata.internal.ModelKeyDescriptor;
-import org.eclipse.jst.jsf.common.metadata.query.IEntityVisitor;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Model</b></em>'.
- * <p><b>Provisional API - subject to change</b></p>
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.Model#getEntityGroups <em>Entity Groups</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.Model#getSourceModelProvider <em>Source Model Provider</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.Model#getCurrentModelContext <em>Current Model Context</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.jsf.common.metadata.MetadataPackage#getModel()
- * @model extendedMetaData="kind='element' name='metadatamodel'"
- * @generated
- */
-public interface Model extends Entity {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * Returns the value of the '<em><b>Source Model Provider</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Source Model Provider</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Source Model Provider</em>' attribute.
- * @see #setSourceModelProvider(IMetaDataSourceModelProvider)
- * @see org.eclipse.jst.jsf.common.metadata.MetadataPackage#getModel_SourceModelProvider()
- * @model unique="false" dataType="org.eclipse.jst.jsf.common.metadata.IMetaDataSourceModelProvider" transient="true" volatile="true"
- * @generated
- */
- IMetaDataSourceModelProvider getSourceModelProvider();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.common.metadata.Model#getSourceModelProvider <em>Source Model Provider</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Source Model Provider</em>' attribute.
- * @see #getSourceModelProvider()
- * @generated
- */
- void setSourceModelProvider(IMetaDataSourceModelProvider value);
-
- /**
- * Returns the value of the '<em><b>Current Model Context</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Current Model Context</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Current Model Context</em>' attribute.
- * @see #setCurrentModelContext(ModelKeyDescriptor)
- * @see org.eclipse.jst.jsf.common.metadata.MetadataPackage#getModel_CurrentModelContext()
- * @model dataType="org.eclipse.jst.jsf.common.metadata.ModelContext" transient="true" volatile="true"
- * @generated
- */
- ModelKeyDescriptor getCurrentModelContext();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.common.metadata.Model#getCurrentModelContext <em>Current Model Context</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Current Model Context</em>' attribute.
- * @see #getCurrentModelContext()
- * @generated
- */
- void setCurrentModelContext(ModelKeyDescriptor value);
-
- /**
- * Returns the value of the '<em><b>Entity Groups</b></em>' reference list.
- * The list contents are of type {@link org.eclipse.jst.jsf.common.metadata.EntityGroup}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Entity Groups</em>' reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Entity Groups</em>' reference list.
- * @see org.eclipse.jst.jsf.common.metadata.MetadataPackage#getModel_EntityGroups()
- * @model type="org.eclipse.jst.jsf.common.metadata.EntityGroup"
- * extendedMetaData="kind='element' name='entityGroup'"
- * @generated
- */
- EList getEntityGroups();
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param groupId
- * @return EntityGroup
- * @model
- * @generated
- */
- EntityGroup findIncludeGroup(String groupId);
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @model visitorDataType="org.eclipse.jst.jsf.common.metadata.IEntityVisitor"
- * @generated
- */
- void accept(IEntityVisitor visitor);
-
-} // Model
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/Trait.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/Trait.java
deleted file mode 100644
index 4eb1b30c7..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/Trait.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.jsf.common.metadata;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider;
-import org.eclipse.jst.jsf.common.metadata.query.ITraitVisitor;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Trait</b></em>'.
- * <p><b>Provisional API - subject to change</b></p>
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.Trait#getId <em>Id</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.Trait#getValue <em>Value</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.Trait#getSourceModelProvider <em>Source Model Provider</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.jsf.common.metadata.MetadataPackage#getTrait()
- * @model extendedMetaData="kind='element' name='trait'"
- * @generated
- */
-public interface Trait extends EObject {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation"; //$NON-NLS-1$
-
- /**
- * Returns the value of the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Id</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Id</em>' attribute.
- * @see #setId(String)
- * @see org.eclipse.jst.jsf.common.metadata.MetadataPackage#getTrait_Id()
- * @model id="true" required="true"
- * @generated
- */
- String getId();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.common.metadata.Trait#getId <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Id</em>' attribute.
- * @see #getId()
- * @generated
- */
- void setId(String value);
-
- /**
- * Returns the value of the '<em><b>Value</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value</em>' reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value</em>' containment reference.
- * @see #setValue(EObject)
- * @see org.eclipse.jst.jsf.common.metadata.MetadataPackage#getTrait_Value()
- * @model containment="true" required="true"
- * extendedMetaData="kind='element' namespace='##targetNamespace'"
- * @generated
- */
- EObject getValue();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.common.metadata.Trait#getValue <em>Value</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value</em>' containment reference.
- * @see #getValue()
- * @generated
- */
- void setValue(EObject value);
-
- /**
- * Returns the value of the '<em><b>Source Model Provider</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Source Model Provider</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Source Model Provider</em>' attribute.
- * @see #setSourceModelProvider(IMetaDataSourceModelProvider)
- * @see org.eclipse.jst.jsf.common.metadata.MetadataPackage#getTrait_SourceModelProvider()
- * @model dataType="org.eclipse.jst.jsf.common.metadata.IMetaDataSourceModelProvider"
- * @generated
- */
- IMetaDataSourceModelProvider getSourceModelProvider();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.common.metadata.Trait#getSourceModelProvider <em>Source Model Provider</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Source Model Provider</em>' attribute.
- * @see #getSourceModelProvider()
- * @generated
- */
- void setSourceModelProvider(IMetaDataSourceModelProvider value);
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param visitor
- * @model visitorDataType="org.eclipse.jst.jsf.common.metadata.query.ITraitVisitor"
- * annotation="http://www.eclipse.org/emf/2002/GenModel body='visitor.visit(this);'"
- * @generated
- */
- void accept(ITraitVisitor visitor);
-
-} // Trait
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/AbstractMetaDataLocator.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/AbstractMetaDataLocator.java
deleted file mode 100644
index 8719c1891..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/AbstractMetaDataLocator.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * Convenient abstract class that a source model locator should consider extending.
- */
-public abstract class AbstractMetaDataLocator implements IMetaDataLocator, IMetaDataObservable{
-
- private IDomainSourceModelType domainSourceModelType;
- private Set/*<IMetaDataObserver>*/ observers;
-
- /**
- * Constructor
- */
- public AbstractMetaDataLocator(){
- observers = new HashSet(1);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataLocator#getDomainSourceModelType()
- */
- public IDomainSourceModelType getDomainSourceModelType() {
- return domainSourceModelType;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataLocator#setDomainSourceModelType(org.eclipse.jst.jsf.common.metadata.internal.IDomainSourceModelType)
- */
- public void setDomainSourceModelType(
- IDomainSourceModelType domainSourceModelType) {
- this.domainSourceModelType = domainSourceModelType;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataLocator#addObserver(org.eclipse.jst.jsf.common.metadata.internal.IMetaDataObserver)
- */
- public void addObserver(IMetaDataObserver observer) {
- observers.add(observer);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataLocator#removeObserver(org.eclipse.jst.jsf.common.metadata.internal.IMetaDataObserver)
- */
- public void removeObserver(IMetaDataObserver observer) {
- observers.remove(observer);
- }
-
- /**
- * @return the set of {@link IMetaDataObserver}s for this instance
- */
- public Set/*<IMetaDataObserver>*/ getObservers(){
- return observers;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/AbstractTagLibDomainContentModelMetaDataTranslator.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/AbstractTagLibDomainContentModelMetaDataTranslator.java
deleted file mode 100644
index c1f2f9e16..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/AbstractTagLibDomainContentModelMetaDataTranslator.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import java.util.Iterator;
-
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.xml.type.SimpleAnyType;
-import org.eclipse.emf.ecore.xml.type.XMLTypeFactory;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.MetadataFactory;
-import org.eclipse.jst.jsf.common.metadata.MetadataPackage;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- * Abstract class that the taglib domain translators use to
- * convert the CM model to a standard meta data model
- *
- */
-public abstract class AbstractTagLibDomainContentModelMetaDataTranslator {
-
- /**
- * {@link IMetaDataModelMergeAssistant} to use
- */
- protected IMetaDataModelMergeAssistant _assistant;
-
- /**
- * Set the assistant to use during the translation. Must be called prior to doTransalate(doc);
- * @param assistant
- */
- protected void setAssistant(IMetaDataModelMergeAssistant assistant){
- _assistant = assistant;
- }
-
- /**
- * Transforms the CMDocument into entities and traits of a standard metadata model
- * using the assistant that must be set before this call.
- * @param doc
- */
- protected void doTranslate(CMDocument doc){
- createTags(doc);
- createTagfileTraits(doc);
- }
-
- /**
- * @param entity
- * @param key
- * @param value
- */
- protected void createSimpleStringEntityTraitIfNecessary(final Entity entity, final String key,
- final String value) {
- Trait t = findTraitOnEntityById(entity, key);
- if (t == null){
- t = internalCreateTrait(entity, key);
-
- SimpleAnyType val = XMLTypeFactory.eINSTANCE.createSimpleAnyType();
- val.setInstanceType(EcorePackage.eINSTANCE.getEString());
- val.setValue(value);
-
- t.setValue(val);
- }
- }
-
- /**
- * @param entity
- * @param key
- * @param value
- */
- protected void createSimpleBooleanObjectEntityTraitIfNecessary(final Entity entity,
- String key, boolean value) {
-
- Trait t = findTraitOnEntityById(entity, key);
- if (t == null){
- t = internalCreateTrait(entity, key);
-
- SimpleAnyType val = XMLTypeFactory.eINSTANCE.createSimpleAnyType();
- val.setInstanceType(EcorePackage.eINSTANCE.getEBoolean());
- val.setRawValue(value == true ? "true" : "false");
-
- t.setValue(val);
- }
-
- }
-
- /**
- * @param entity
- * @param key
- * @return Trait
- */
- protected Trait internalCreateTrait(final Entity entity, final String key) {
- Trait t = MetadataFactory.eINSTANCE.createTrait();
- t.setId(key);
- t.setSourceModelProvider(_assistant.getSourceModelProvider());
- entity.getTraits().add(t);
- return t;
- }
-
- /**
- * @param entity
- * @param key
- * @return Trait
- */
- protected Trait findTraitOnEntityById(final Entity entity, final String key) {
- for (Iterator it=entity.getTraits().iterator();it.hasNext();){
- Trait t = (Trait)it.next();
- if (key.equals(t.getId()))
- return t;
- }
- return null;
- }
-
- /**
- * @param nodeName
- * @return Entity
- */
- protected Entity findTagEntity(final String nodeName) {
- for (Iterator it=getMergedModel().getChildEntities().iterator();it.hasNext();){
- Entity entity = (Entity)it.next();
- if (nodeName.equals(entity.getId()))
- return entity;
- }
- return null;
- }
-
- /**
- * Create entities for tags
- * @param doc
- */
- protected void createTags(final CMDocument doc) {
- for (Iterator it=doc.getElements().iterator();it.hasNext();){
- CMElementDeclaration tag = (CMElementDeclaration)it.next();
- Entity entity = findTagEntity(tag.getNodeName());
- if (entity == null){
- entity = MetadataFactory.eINSTANCE.createEntity();
- entity.setId(tag.getNodeName());
- entity.setType("tag");
- getMergedModel().getChildEntities().add(entity);
- }
- setTagEntityTraits(tag, entity);
- }
-
- }
-
- /**
- * Sets the standard traits for a tag entity from the element declaration
- * @param tag
- * @param entity
- */
- protected void setTagEntityTraits(CMElementDeclaration tag, Entity entity) {
- createSimpleStringEntityTraitIfNecessary(entity, "display-label", getTagDisplayName(tag));
- createSimpleStringEntityTraitIfNecessary(entity, "description", getTagDescription(tag));
- createSimpleStringEntityTraitIfNecessary(entity, "small-icon", getTagSmallIcon(tag));
- createSimpleStringEntityTraitIfNecessary(entity, "large-icon", getTagLargeIcon(tag));
- createSimpleBooleanObjectEntityTraitIfNecessary(entity, "expert", getTagIsExpert(tag));
- createSimpleBooleanObjectEntityTraitIfNecessary(entity, "hidden", getTagIsHidden(tag));
-
-// createRequiredAttrTraits(entity, tag);
- }
-
- /**
- * @param tag
- * @return false. subclass should override if CMElementDeclaration has the metadata.
- */
- protected boolean getTagIsHidden(CMElementDeclaration tag) {return false;}
-
- /**
- * @param tag
- * @return false. subclass should override if CMElementDeclaration has the metadata.
- */
- protected boolean getTagIsExpert(CMElementDeclaration tag) {return false;}
-
- /**
- * @param tag
- * @return null. subclass should override if CMElementDeclaration has the metadata.
- */
- protected String getTagLargeIcon(CMElementDeclaration tag) {return null;}
-
- /**
- * @param tag
- * @return null. subclass should override if CMElementDeclaration has the metadata.
- */
- protected String getTagSmallIcon(CMElementDeclaration tag) {return null;}
-
- /**
- * @param tag
- * @return null. subclass should override if CMElementDeclaration has the metadata.
- */
- protected String getTagDescription(CMElementDeclaration tag) {return null;}
-
- /**
- * @param tag
- * @return tag.getElementName()
- */
- protected String getTagDisplayName(CMElementDeclaration tag) {return tag.getElementName();}
-
- /**
- * Creates standard traits for tag file entity from CMDocument metadata
- * @param doc
- */
- protected void createTagfileTraits(CMDocument doc) {
- Model model = getMergedModel();
-
- createSimpleStringEntityTraitIfNecessary(model, "display-label", getURIDisplayLabel());
- createSimpleStringEntityTraitIfNecessary(model, "description", getURIDescription());
- createSimpleStringEntityTraitIfNecessary(model, "default-prefix", getURIDefaultPrefix());
- createSimpleBooleanObjectEntityTraitIfNecessary(model, "expert", getURIExpert());
- createSimpleBooleanObjectEntityTraitIfNecessary(model, "hidden", getURIHidden());
-
- }
-
- /**
- * @return the display label to use for this model. Subclasses should override if model has the meta data.
- */
- protected String getURIDisplayLabel(){
- return getMergedModel().getId();
- }
-
- /**
- * @return default prefix to use for tags. Returns null. Subclasses should override if model has the meta data.
- */
- protected String getURIDefaultPrefix(){
- return null;
- }
-
- /**
- * @return description to use. Default is the URI. Subclasses should override if model has the meta data.
- */
- protected String getURIDescription(){
- return getMergedModel().getId();
- }
-
- /**
- * @return false. Subclasses should override if model has the meta data.
- */
- protected boolean getURIExpert() { return false;}
-
- /**
- * @return false. Subclasses should override if model has the meta data.
- */
- protected boolean getURIHidden() {return false; }
-
- /**
- * @return a model of all entities and traits
- */
- protected Model getMergedModel() {
- Model model = (Model)_assistant.getMergedModel().getRoot();
- if (model == null){
- //need to create model key object
- Model tld = createTLDModel();
- _assistant.getMergedModel().setRoot(tld);
- model = (Model)_assistant.getMergedModel().getRoot();
- }
- return model;
- }
-
- /**
- * @return new model
- */
- protected Model createTLDModel() {
- Model entity = getFactory().createModel();
- entity.setId(_assistant.getMergedModel().getModelKey().getUri());
- return entity;
- }
-
- /**
- * @return MetadataFactory instance
- */
- protected MetadataFactory getFactory(){
- return (MetadataFactory) MetadataPackage.eINSTANCE.getEFactoryInstance();
- }
-
- /**
- * @return CMDocument being used for the current translate call
- */
- protected CMDocument getSourceModel() {
- return (CMDocument)_assistant.getSourceModelProvider().getSourceModel();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/DomainLoadingStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/DomainLoadingStrategy.java
deleted file mode 100644
index ad81c3d4f..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/DomainLoadingStrategy.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * Default class used for loading metadata.
- * Loads the source types from extensions defined against the domain.
- *
- * see org.eclipse.jst.jsf.common.domainLoadingStrategies ext-pt
- */
-public class DomainLoadingStrategy implements IDomainLoadingStrategy, IMetaDataObserver {
-
- /**
- * Domain id
- */
- protected String domain;
-
- private MetaDataModel _model;
- private List /*<IDomainSourceModelType>*/ _sourceTypes;
- private List /*<IMetaDataSourceModelProvider>*/ _sources;
-
- /**
- * Constructor
- * @param domain
- */
- public DomainLoadingStrategy(String domain){
- this.domain = domain;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IDomainLoadingStrategy#load(org.eclipse.jst.jsf.common.metadata.internal.MetaDataModel)
- */
- public void load(MetaDataModel model) {
- this._model = model;
- _sourceTypes = loadDomainSourceModelTypes();
- sortSourceTypes(_sourceTypes);
- _sources = locateMetaDataSourceInstances(_sourceTypes, model);
- mergeModel(model, _sources);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IDomainLoadingStrategy#reload()
- */
- public void reload() throws ModelNotSetException {
- System.out.println("reload");//debug
- if (_model == null)
- throw new ModelNotSetException();
-
- removeOldLocatorObservers();
- _sources = locateMetaDataSourceInstances(_sourceTypes, _model);
- mergeModel(_model, _sources);
- }
-
- /**
- * Responsible for iterating through the sorted list of <code>IMetaDataSourceModelProvider</code>
- * and merging the models after first translating the source model as required, into a single mreged model of
- * standatd metadata Entities and Traits.
- * @param model
- * @param sources
- */
- protected void mergeModel(MetaDataModel model, List/*<IMetaDataSourceModelProvider>*/ sources) {
- IMetaDataModelMergeAssistant assistant = createModelMergeAssistant(model);
- for (Iterator/*<IMetaDataSourceModelProvider>*/ it = sources.iterator();it.hasNext();){
- IMetaDataSourceModelProvider mds = (IMetaDataSourceModelProvider)it.next();
-// assistant.setSourceModel(mds.getSourceModel());
- assistant.setSourceModelProvider(mds);
- Iterator translators = mds.getLocator().getDomainSourceModelType().getTranslators().iterator();
- while (translators.hasNext()){
- IMetaDataTranslator translator = (IMetaDataTranslator)translators.next();
- translator.translate(assistant);
- }
- }
- assistant.setMergeComplete();
- }
-
- /**
- * @param model
- * @return an instance of a IMetaDataModelMergeAssistant to be used while merging source models
- */
- protected IMetaDataModelMergeAssistant createModelMergeAssistant(MetaDataModel model){
- return new MetaDataModelMergeAssistantImpl(model);
- }
-
- /**
- * Allows for subclasses to override the default mechanism for sorting the source types.
- * @param sourceTypes
- */
- protected void sortSourceTypes(List/*<IDomainSourceModelType>*/ sourceTypes) {
- //allows override
- }
-
- /**
- * @return list of <code>IDomainSourceModelType</code>s located in the <code>DomainSourceTypesRegistry</code>
- * for the specified uri
- */
- protected List/*<IDomainSourceModelType>*/ loadDomainSourceModelTypes() {
- return DomainSourceTypesRegistry.getInstance().getDomainSourceTypes(domain);
- }
-
- /**
- * @param sourceTypes
- * @param model
- * @return list of <code>IMetaDataSourceModelProvider</code> instances from the domain source types applicable for
- * this domain for this particular uri specified in the model
- */
- protected List/*<IMetaDataSourceModelProvider>*/ locateMetaDataSourceInstances(List/*<IDomainSourceModelType>*/ sourceTypes, MetaDataModel model) {
- List/*<IMetaDataSourceModelProvider>*/ sources = new ArrayList/*<IMetaDataSourceModelProvider>*/();
- for (Iterator/*<IDomainSourceModelType>*/ it = sourceTypes.iterator();it.hasNext();){
- IDomainSourceModelType sourceType = (IDomainSourceModelType)it.next();
- IMetaDataLocator locator = sourceType.getLocator();
- //We MUST set the sourceType here to associate the handler with locator to use for the source models
- locator.setDomainSourceModelType(sourceType);
-
- //set project context in locator for those that care
- if (locator instanceof IPathSensitiveMetaDataLocator)
- ((IPathSensitiveMetaDataLocator)locator).setProjectContext(model.getModelKey().getProject());
-
- List/*<IMetaDataSourceModelProvider>*/ providers = sourceType.getLocator().locateMetaDataModelProviders(model.getModelKey().getUri());
- if (providers != null && !providers.isEmpty()){
- for (Iterator mdProviders =providers.iterator();mdProviders.hasNext();){
- IMetaDataSourceModelProvider provider = (IMetaDataSourceModelProvider)mdProviders.next();
- //We MUST set the sourceType here to associate the translators to use for the source models
- provider.setLocator(sourceType.getLocator());
- sources.add(provider);
- }
- }
- //listen for changes
- sourceType.getLocator().addObserver(this);
- }
- return sources;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataObserver#notifyMetadataChanged(org.eclipse.jst.jsf.common.metadata.internal.IMetaDataChangeNotificationEvent)
- */
- public void notifyMetadataChanged(IMetaDataChangeNotificationEvent event) {
- //for now, if any event occurs, we need to flush the _model so that it will rebuild
- _model.setNeedsRefresh();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IDomainLoadingStrategy#cleanup()
- */
- public void cleanup(){
- removeOldLocatorObservers();
- _sources = null;
- _sourceTypes = null;
- _model = null;
- }
-
- private void removeOldLocatorObservers(){
- if (_sources != null){
- for (Iterator it= _sources.iterator();it.hasNext();){
- IMetaDataSourceModelProvider provider = (IMetaDataSourceModelProvider)it.next();
- IMetaDataLocator locator = provider.getLocator();
- locator.removeObserver(this);
- locator.setDomainSourceModelType(null);
- provider.setLocator(null);
- }
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/DomainLoadingStrategyRegistry.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/DomainLoadingStrategyRegistry.java
deleted file mode 100644
index f0acd69ae..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/DomainLoadingStrategyRegistry.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.jsf.common.JSFCommonPlugin;
-
-
-/**
- * Registry of strategies used to load domains of metadata.
- * Uses the <code>org.eclipse.jst.jsf.common.domainLoadingStrategies</code> ext-pt to load.
- *
- * see <code>org.eclipse.jst.jsf.common.domainLoadingStrategies</code> ext-pt
- */
-public class DomainLoadingStrategyRegistry{
- private static DomainLoadingStrategyRegistry INSTANCE;
-
- private HashMap/*<String, DomainLoadingStrategyDescriptorImpl>*/ domainLoadingStrategyDescriptors;
-
-// public static final String TAGLIB_DOMAIN ="TagLibraryDomain"; //this does *not* belong here. FIX ME
-// public static final String TAGLIB_DOMAIN_SOURCE_HANDLER_ID = TAGLIB_DOMAIN + "SourceHandler";
-// public static final String TAGLIB_DOMAIN_TRANSLATOR = "com.foo.translators."+TAGLIB_DOMAIN + "Translator";
-
- private static final String EXTENSION_POINT_ID = "domainLoadingStrategies";
-
- private DomainLoadingStrategyRegistry(){
- init();
- }
-
- /**
- * @return singleton instance of the DomainLoadingStrategyRegistry
- */
- public synchronized static DomainLoadingStrategyRegistry getInstance() {
- if (INSTANCE == null){
- INSTANCE = new DomainLoadingStrategyRegistry();
- }
- return INSTANCE;
- }
-
- /**
- * Loads registry with descriptors from the domainLoadingStrategies ext-pt.
- */
- synchronized final void init(){
- IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
- IExtensionPoint point = extensionRegistry.getExtensionPoint(JSFCommonPlugin.PLUGIN_ID, EXTENSION_POINT_ID );
- if (point != null) {
- IConfigurationElement[] elements = point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++) {
- IConfigurationElement element = elements[i];
- DomainLoadingStrategyDescriptorImpl dls = new DomainLoadingStrategyDescriptorImpl(element);
- addDomainLoadingStrategyDescriptor(dls);
- }
- }
- }
-
- /**
- * Add domain loading strategy descriptor for a domain to the registry domains
- * @param strategy
- */
- protected void addDomainLoadingStrategyDescriptor(DomainLoadingStrategyDescriptorImpl strategy){
- getDescriptors().put(strategy.getDomain(), strategy);
- }
-
- /**
- * @param domain
- * @return an instance of an <code>IDomainLoadingStrategy</code> for the given domain
- */
- public IDomainLoadingStrategy getLoadingStrategy(String domain){
- DomainLoadingStrategyDescriptorImpl strategy = (DomainLoadingStrategyDescriptorImpl)getDescriptors().get(domain);
- if (strategy == null){
- return createDefaultLoadingStrategy();
- }
- return createLoadingStrategy(domain);
- }
-
-
- /**
- * @return strategy that will only use standard metadata files
- */
- private IDomainLoadingStrategy createDefaultLoadingStrategy() {
- return new DomainLoadingStrategy(null);
- }
-
- private IDomainLoadingStrategy createLoadingStrategy(String domain){
- return ((DomainLoadingStrategyDescriptorImpl)getDescriptors().get(domain)).newInstance();
- }
-
- private Map/*<String, DomainLoadingStrategyDescriptorImpl>*/ getDescriptors(){
- if (domainLoadingStrategyDescriptors == null){
- domainLoadingStrategyDescriptors = new HashMap/*<String, DomainLoadingStrategyDescriptorImpl>*/();
- }
- return domainLoadingStrategyDescriptors;
- }
-
- /**
- * Implementation of a DomainLoadingStrategy descriptor that is responsible for creating instances of the IDomainLoadingStrategy
- */
- private class DomainLoadingStrategyDescriptorImpl {
- String domain;
- String loadingStrategyClassName;
- String bundleId;
- Class strategy;
- IConfigurationElement element;
-
- DomainLoadingStrategyDescriptorImpl(IConfigurationElement element){
- this.element = element;
- this.init();
- }
-
- private void init() {
- domain = element.getAttribute("domainId");
- bundleId = element.getContributor().getName();
- loadingStrategyClassName = element.getAttribute("domainLoadingStrategy");
- }
-
- /**
- * @return domain id
- */
- public String getDomain() {
- return domain;
- }
-
- /**
- * @return new instance of IDomainLoadingStrategy
- */
- public IDomainLoadingStrategy newInstance(){
- try {
- Class[] parameterTypes = new Class[]{String.class};
- Object[] initargs = new Object[]{domain};
- Object loader = this.getLoadingStrategy().getConstructor(parameterTypes).newInstance(initargs);
- if (loader instanceof IDomainLoadingStrategy)
- return (IDomainLoadingStrategy)loader;
- } catch (InstantiationException e) {
- JSFCommonPlugin.log(IStatus.ERROR, "Unable to instantiate IDomainLoadingStrategy for: "+ domain,e);
- } catch (IllegalAccessException e) {
- JSFCommonPlugin.log(IStatus.ERROR, "IllegalAccessException during creation of IDomainLoadingStrategy for: "+ domain,e);
- } catch (IllegalArgumentException e) {
- JSFCommonPlugin.log(IStatus.ERROR, "IllegalArgumentException during creation of IDomainLoadingStrategy for: "+ domain,e);
- } catch (SecurityException e) {
- JSFCommonPlugin.log(IStatus.ERROR, "SecurityException during creation of IDomainLoadingStrategy for: "+ domain,e);
- } catch (InvocationTargetException e) {
- JSFCommonPlugin.log(IStatus.ERROR, "InvocationTargetException during creation of IDomainLoadingStrategy for: "+ domain,e);
- } catch (NoSuchMethodException e) {
- JSFCommonPlugin.log(IStatus.ERROR, "NoSuchMethodException during creation of IDomainLoadingStrategy for: "+ domain,e);
- }
- return null;
- }
-
- private Class getLoadingStrategy() {
- if (strategy == null){
- strategy = JSFCommonPlugin.loadClass(loadingStrategyClassName, bundleId);
- }
- return strategy;
- }
-
- }
-
-} \ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/DomainSourceModelTypeDescriptor.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/DomainSourceModelTypeDescriptor.java
deleted file mode 100644
index bcd933815..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/DomainSourceModelTypeDescriptor.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.jsf.common.JSFCommonPlugin;
-
-/**
- * Implementation of a {@link IDomainSourceModelType} descriptor.
- * Responsible for producing instances of {@link IDomainSourceModelType}.
- * Also responsible for creating the {@link IMetaDataTranslator} descriptors from the
- * <code>com.eclipse.jst.jsf.common.domainSourceModelTypeTranslators</code> ext-pt
- */
-public class DomainSourceModelTypeDescriptor {
- private static final String TRANSLATORS_EXTENSION_POINT_ID = "domainSourceModelTypeTranslators";
- private static final String STANDARD_FILE_NULL_TRANSLATOR = "org.eclipse.jst.jsf.common.metadata.internal.StandardMetaDataFilesTranslator";
- private String domain = "DEFAULT";
- private String domainSourceModelTypeId;
- private String locatorClassName = "org.eclipse.jst.jsf.common.metadata.internal.StandardMetaDataLocator";
- private Set translatorDescriptors;
- private String bundleId = JSFCommonPlugin.PLUGIN_ID;
- private int ordinal;
- private IDomainSourceModelType _instance;
-
- /**
- * Constructor
- * @param domain
- * @param domainSourceModelTypeId
- * @param locatorClassName
- * @param bundleId
- * @param ordinal
- */
- public DomainSourceModelTypeDescriptor(String domain, String domainSourceModelTypeId, String locatorClassName, String bundleId, int ordinal){
- this.domain = domain;
- this.locatorClassName = locatorClassName;
- this.domainSourceModelTypeId = domainSourceModelTypeId;
- this.bundleId = bundleId;
- this.ordinal = ordinal;
- init();
- }
-
- /**
- * Default model type descriptor that will load only standard metadata files
- */
- public DomainSourceModelTypeDescriptor(){
-// getTranslatorDescriptors();
- //createTranslatorInstances() will add the standard null translator
- }
-
- private synchronized void init() {
- IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
- IExtensionPoint point = extensionRegistry.getExtensionPoint(JSFCommonPlugin.PLUGIN_ID, TRANSLATORS_EXTENSION_POINT_ID );
- if (point != null) {
- IConfigurationElement[] elements = point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++) {
- IConfigurationElement element = elements[i];
- String srcHdlrId = element.getAttribute("domainSourceModelTypeId");
- if (srcHdlrId.equals(domainSourceModelTypeId))
- addTranslatorDescriptor(element);
- }
- }
- }
-
- private void addTranslatorDescriptor(IConfigurationElement element) {
- String translator = element.getAttribute("translatorClass");
- DomainSourceModelTranslatorDescriptor d = new DomainSourceModelTranslatorDescriptor(translator, element.getContributor().getName());
- getTranslatorDescriptors().add(d);
- }
-
- private Set getTranslatorDescriptors(){
- if (translatorDescriptors == null){
- translatorDescriptors = new HashSet();
- }
- return translatorDescriptors;
- }
-
- /**
- * @return domain
- */
- public String getDomain() {
- return domain;
- }
-
- /**
- * @return singleton instance of the {@link IDomainSourceModelType}
- */
- public IDomainSourceModelType getInstance(){
- if (_instance == null){
- _instance = newInstance();
- }
- return _instance;
- }
- /**
- * @return new instance of {@link IDomainSourceModelType}
- */
- private IDomainSourceModelType newInstance(){
-
- return new DomainSourceModelTypeImpl();
- }
-
- /**
- * Internal class implementing {@link IDomainSourceModelType}
- */
- class DomainSourceModelTypeImpl implements IDomainSourceModelType{
-
- private Set translators;
- private IMetaDataLocator locator;
-
- DomainSourceModelTypeImpl(){
- // restrict construction to package scope
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IDomainSourceModelType#getDomain()
- */
- public String getDomain() {
- return domain;
- }
-
- /**
- * @return value of ordinal defined by the ext-pt used for ordering source types for a domain
- */
- public int getOrdinal(){
- return ordinal;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IDomainSourceModelType#getLocator()
- */
- public IMetaDataLocator getLocator() {
- if (locator == null){
- locator = MetaDataLocatorFactory.getInstance().getLocator(locatorClassName, bundleId);
- }
-
- return locator;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IDomainSourceModelType#getTranslators()
- */
- public Set getTranslators() {
- if (translators == null){
- translators = createTranslatorInstances();
- }
- return translators;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString(){
- StringBuffer buf = new StringBuffer("DomainSourceModelTypeImpl");
- buf.append("(domain = ");
- buf.append(getDomain());
- buf.append(", locator = ");
- buf.append(getLocator());
- buf.append(")");
- return buf.toString();
- }
-
- private Set createTranslatorInstances() {
- translators = new HashSet/*<IMetaDataTranslator>*/();
- if (getTranslatorDescriptors().size() == 0){// for TagLibDomain, we are adding null translator via extension (as of 7/16/07)
- //would get here if a domain and source type was defined without a domain translator. Should not happen, but
- //add Null Translator for now....
- //we could/should raise exception.
- //Developers should add a STANDARD_FILE_NULL_TRANSLATOR if using standard metadata format.
- Class klass = JSFCommonPlugin.loadClass(STANDARD_FILE_NULL_TRANSLATOR, JSFCommonPlugin.PLUGIN_ID);
- try {
- translators.add(klass.newInstance());
- return translators;
- } catch (InstantiationException e) {
- // TODO: other error handling?
- JSFCommonPlugin.log(e, "Error in createTranslatorInstances(STANDARD_FILE_NULL_TRANSLATOR)");
- } catch (IllegalAccessException e) {
- // TODO: other error handling?
- JSFCommonPlugin.log(e, "Error in createTranslatorInstances(STANDARD_FILE_NULL_TRANSLATOR)");
- }
-
- }
-
- Iterator/*<DomainSourceModelTranslatorDescriptor>*/it = getTranslatorDescriptors().iterator();
- while (it.hasNext()){
- DomainSourceModelTranslatorDescriptor d = (DomainSourceModelTranslatorDescriptor)it.next();
- Class klass = JSFCommonPlugin.loadClass(d.getTranslator(), d.getBundleId());
- try {
- translators.add(klass.newInstance());
- } catch (InstantiationException e) {
- // TODO: other error handling?
- JSFCommonPlugin.log(e, "Error in createTranslatorInstances");
- } catch (IllegalAccessException e) {
- // TODO: other error handling?
- JSFCommonPlugin.log(e, "Error in createTranslatorInstances");
- }
- }
- return translators;
- }
-
- }
-
- /**
- * Internal class implementing a descriptor for DomainSourceModelTranslators
- */
- class DomainSourceModelTranslatorDescriptor {
-
- private String _translator;
- private String _bundleId;
-
- /**
- * Constructor
- * @param translator
- * @param bundleId
- */
- public DomainSourceModelTranslatorDescriptor(String translator, String bundleId) {
- this._translator = translator;
- this._bundleId = bundleId;
- }
-
- String getTranslator(){
- return _translator;
- }
-
- String getBundleId(){
- return _bundleId;
- }
-
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/DomainSourceTypesRegistry.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/DomainSourceTypesRegistry.java
deleted file mode 100644
index 9ace16449..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/DomainSourceTypesRegistry.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-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.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.jsf.common.JSFCommonPlugin;
-import org.eclipse.jst.jsf.common.metadata.internal.DomainSourceModelTypeDescriptor.DomainSourceModelTypeImpl;
-
-/**
- * Registry of Domain Source Types loaded from domainSourceModelTypes ext-pt.
- */
-public class DomainSourceTypesRegistry{
- private static final String EXTENSION_POINT_ID = "domainSourceModelTypes";
- private static DomainSourceTypesRegistry INSTANCE;
- private Map/*<String, List/*<DomainSourceModelTypeDescriptor>>*/ domainSourceTypeDescriptors;
- private Map/*<String, List/*<IDomainSourceModelType>*/ domainSourceTypes;
-
- private DomainSourceTypesRegistry(){
- init();
- }
-
- /**
- * @return singleton instance of DomainSourceTypesRegistry
- */
- public synchronized static DomainSourceTypesRegistry getInstance() {
- if (INSTANCE == null){
- INSTANCE = new DomainSourceTypesRegistry();
- }
- return INSTANCE;
- }
-
- /**
- * @param domain identifier
- * @return list of <code>IDomainSourceModelType</code> sorted in descending order by ordinal
- */
- public List/*<IDomainSourceModelType>*/ getDomainSourceTypes(String domain){
- if (getDomainSourceTypes().containsKey(domain))
- return (List)getDomainSourceTypes().get(domain);
-
- List/*<DomainSourceModelTypeDescriptor>*/ list = getDomainSourceModelDescriptors(domain);
- List/*<IDomainSourceModelType>*/ types = new ArrayList/*<IDomainSourceModelType>*/();
- for(Iterator/*<DomainSourceModelTypeDescriptor>*/ it=list.iterator();it.hasNext();){
- DomainSourceModelTypeDescriptor d = (DomainSourceModelTypeDescriptor)it.next();
- types.add(d.getInstance());
- }
- //default sort descending by ordinal
- Collections.sort(types, new Comparator(){
- public int compare(Object o1, Object o2) {
- DomainSourceModelTypeImpl desc1 = (DomainSourceModelTypeImpl)o1;
- DomainSourceModelTypeImpl desc2 = (DomainSourceModelTypeImpl)o2;
- if (desc1.getOrdinal() == desc2.getOrdinal())
- return 0;
- if (desc1.getOrdinal() > desc2.getOrdinal())
- return -1;
-
- return 1;
- }
-
- });
-
- getDomainSourceTypes().put(domain, types);
- return types;
- }
-
- private List getDomainSourceModelDescriptors(String domain) {
- List ret = (List)getDescriptors().get(domain);
- if (ret != null && ret.size()>0)
- return ret;
-
- return getDefaultSourceModelDescriptor();
- }
-
- private List getDefaultSourceModelDescriptor() {
- List ret = new ArrayList();
- DomainSourceModelTypeDescriptor desc = new DomainSourceModelTypeDescriptor();
- ret.add(desc);
- return ret;
- }
-
- private synchronized void init() {
- IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
- IExtensionPoint point = extensionRegistry.getExtensionPoint(JSFCommonPlugin.PLUGIN_ID, EXTENSION_POINT_ID );
- if (point != null) {
- IConfigurationElement[] elements = point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++) {
- IConfigurationElement element = elements[i];
- addDomainSourceTypeDescriptor(element);
- }
- }
- }
-
- private void addDomainSourceTypeDescriptor(IConfigurationElement element) {
- String domainId = element.getAttribute("domainId");
- String srcHdlrId = element.getAttribute("domainSourceModelTypeId");
- String locator = element.getAttribute("locator");
- String ordinalStr = element.getAttribute("ordinal");
- int ordinal = 1;
- if (ordinalStr!=null && !ordinalStr.equals("")){
- ordinal = Integer.parseInt(ordinalStr);
- }
- DomainSourceModelTypeDescriptor d = new DomainSourceModelTypeDescriptor(domainId, srcHdlrId, locator, element.getContributor().getName(), ordinal);
- List/*<DomainSourceTypeDescriptor>*/ descs = (List)getDescriptors().get(domainId);
- if (descs == null){
- descs = new ArrayList/*<DomainSourceTypeDescriptor>*/();
- getDescriptors().put(domainId, descs);
- }
- descs.add(d);
- }
-
- private Map/*<String, List/*<DomainSourceTypeDescriptor>>*/ getDescriptors() {
- if (domainSourceTypeDescriptors == null){
- domainSourceTypeDescriptors = new HashMap/*<String, List/*<DomainSourceTypeDescriptor>>*/();
- }
- return domainSourceTypeDescriptors;
- }
-
- private Map/*<String, List/*<IDomainSourceModelType>>*/ getDomainSourceTypes() {
- if (domainSourceTypes == null){
- domainSourceTypes = new HashMap/*<String, List/*<IDomainSourceModelType>>*/();
- }
- return domainSourceTypes;
- }
-
-} \ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IClassLoaderProvider.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IClassLoaderProvider.java
deleted file mode 100644
index 6c8169616..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IClassLoaderProvider.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-/**
- * Provides class loading by using the plugin's classloader that defined an item of metadata
- */
-public interface IClassLoaderProvider {
- /**
- * @param className
- * @return Class - implementers should eat exceptions and return null whenever class cannot be returned
- */
- public Class loadClass(String className);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IDomainLoadingStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IDomainLoadingStrategy.java
deleted file mode 100644
index ee21e6249..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IDomainLoadingStrategy.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-
-/**
- * Defines a strategy to use for loading a standard metadata model for a certain domain.
- * see <code>org.eclipse.jst.jsf.common.domainLoadingStrategies</code> ext-pt
- */
-public interface IDomainLoadingStrategy {
-
- /**
- * Create a merged "standard" metadata model.
- * @param model to load
- *
- */
- public void load(MetaDataModel model);
-
- /**
- * Reload a merged "standard" metadata model.
- * Allows for some optimization for reload.
- * @throws ModelNotSetException
- *
- */
- public void reload() throws ModelNotSetException;
-
-
- /**
- * Opportunity to cleanup and should be called when strategy is being destroyed
- */
- public void cleanup();
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IDomainSourceModelType.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IDomainSourceModelType.java
deleted file mode 100644
index 296c4a7a2..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IDomainSourceModelType.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import java.util.Set;
-
-/**
- * Binds a domain of metadata to a source model type which is defined by a {@link IMetaDataLocator}
- * and set of {@link IMetaDataTranslator}s
- * Not intended to be implemented by clients. Created from ext-pts.
- */
-public interface IDomainSourceModelType {
- /**
- * @return domain id
- */
- public String getDomain();
- /**
- * @return IMetaDataLocator
- */
- public IMetaDataLocator getLocator();
-// public int getOrdinal();
- /**
- * @return set of {@link IMetaDataTranslator}s for the domain source model type
- */
- public Set/*<IMetaDataTranslator>*/ getTranslators();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IImageDescriptorProvider.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IImageDescriptorProvider.java
deleted file mode 100644
index 9405a6a64..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IImageDescriptorProvider.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * Provides image descriptors relative to the plugin that provided the image metadata
- *
- */
-public interface IImageDescriptorProvider {
- /**
- * @param imagePath
- * @return ImageDescriptor - implementers should eat exceptions and return null whenever imageDescriptor cannot be returned
- */
- public ImageDescriptor getImageDescriptor(String imagePath);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataChangeNotificationEvent.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataChangeNotificationEvent.java
deleted file mode 100644
index 29c6ce13f..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataChangeNotificationEvent.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-/**
- * Experimental and not used at the moment.
- *
- */
-public interface IMetaDataChangeNotificationEvent {
- //change to enums if we do Java5
- /**
- * TODO:
- */
- public static final int ADDED = 1;
- /**
- * TODO:
- */
- public static final int REMOVED = 2;
- /**
- * TODO:
- */
- public static final int CHANGED = 3;
-
- /**
- * @return the uri
- */
- public String getURI();
- /**
- * @return when to the event types above
- */
- public int getEventType();
- /**
- * @return the meta-data locator
- */
- public IMetaDataLocator getLocator();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataLocator.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataLocator.java
deleted file mode 100644
index 4bb67feba..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataLocator.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import java.util.List;
-
-/**
- * Locates instances of metadata of a specific source model type
- */
-public interface IMetaDataLocator {
- /**
- * @param uri
- * @return a list of <code>IMetaDataModelProvider</code>s for the uri located by this instance
- */
- public List/*<IMetaDataModelProvider>*/ locateMetaDataModelProviders(String uri);
-
- /**
- * Opportunity for service to start (add listeners, etc.).
- * Framework calls this immediately after construction and all setup should occur at this time.
- */
- public void startLocating();
- /**
- * Stop looking for instances of metadata model sources. An opporttunity to cleanup.
- */
- public void stopLocating();
-
- /**
- * @param observer add a {@link IMetaDataObserver} of this locator
- */
- public void addObserver(IMetaDataObserver observer);
- /**
- * @param observer remove a {@link IMetaDataObserver} of this locator
- */
- public void removeObserver(IMetaDataObserver observer);
-
- /**
- * @return IDomainSourceModelType instance that created this locator
- */
- public IDomainSourceModelType getDomainSourceModelType();
- /**
- * @param domainSourceModelType set the domainSourceModelType instance that created this locator
- */
- public void setDomainSourceModelType(IDomainSourceModelType domainSourceModelType);
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataModelMergeAssistant.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataModelMergeAssistant.java
deleted file mode 100644
index d5744f443..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataModelMergeAssistant.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.EntityGroup;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-
-
-/**
- * Helper class interface to merge source models into a single merged model.
- * Not intended to be implemented by clients
- *
- */
-public interface IMetaDataModelMergeAssistant {
- /**
- * @return merged model
- */
- public MetaDataModel getMergedModel();
- /**
- * Method that will first check to see if an entity with the same id exists in the merged model.
- * If not, it will add it. The entities includeGroups are then also merged.
- * @param entity
- * @return flag indicating whether or not the entity was new and therefore added to the merged model
- *
- */
- public boolean addEntity(Entity entity);
- /**
- * Method will add an entity if not already existing in the merged model, and then check for an existing trait by id on the merged model's entity.
- * @param entity
- * @param trait
- * @return flag indicating whether or not the traits was new and therefore added to the merged model's entity
- */
- public boolean addTrait(Entity entity, Trait trait);
-
- /**
- * Method will add an entityGroup to the model if not already exiting in the merged model (by id).
- * @param entityGroup
- */
- public void addEntityGroup(EntityGroup entityGroup);
- /**
- * Signal that the merge is complete so that any post-processing may occur.
- * This should be the last call made on the merge assistant and should be done before client calls for the merged model result.
- * This should signal that entityGroups processing should begin.
- */
- public void setMergeComplete();
-
- /**
- * @param mds - {@link IMetaDataSourceModelProvider}
- */
- public void setSourceModelProvider(IMetaDataSourceModelProvider mds);
- /**
- * @return {@link IMetaDataSourceModelProvider} for current operation
- */
- public IMetaDataSourceModelProvider getSourceModelProvider();
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataObservable.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataObservable.java
deleted file mode 100644
index 69152d34d..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataObservable.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-/**
- * Allows {@link IMetaDataObserver}s to observe changes.
- * Experimental.
- *
- */
-public interface IMetaDataObservable {
- /**
- * Add the observer to the set of observers. Has no effect if
- * the same observer is already registered
- *
- * @param observer
- */
- public void addObserver(IMetaDataObserver observer);
-
- /**
- * Remove the observer from the set of observers. Has no effect
- * if observer was not already registered.
- *
- * @param observer must not be null
- */
- public void removeObserver(IMetaDataObserver observer);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataObserver.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataObserver.java
deleted file mode 100644
index 5a138a33a..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataObserver.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-/**
- * Interface for notification when an {@link IMetaDataObservable} changes
- *
- */
-public interface IMetaDataObserver {
- /**
- * Callback to observer when an {@link IMetaDataObservable} throws an event
- * @param event
- */
- public void notifyMetadataChanged(IMetaDataChangeNotificationEvent event);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataSourceModelProvider.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataSourceModelProvider.java
deleted file mode 100644
index 6a19c3bb0..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataSourceModelProvider.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import org.eclipse.core.runtime.IAdaptable;
-
-
-/**
- * Provides a source of metadata that can be transformed into a merged standard model
- * LIKELY TO CHANGE
- */
-public interface IMetaDataSourceModelProvider extends IAdaptable{
- /**
- * @return the source model
- */
- public Object getSourceModel();
- /**
- * @return the IMetaDataLocator instance that located this model provider instance
- */
- public IMetaDataLocator getLocator();
- /**
- * @param locator instance that located this model provider instance
- */
- public void setLocator(IMetaDataLocator locator);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataTranslator.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataTranslator.java
deleted file mode 100644
index eaa159b60..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IMetaDataTranslator.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-/**
- * Translate from the source model metadata structure into a standard metadata domain of metadata.
- *
- */
-public interface IMetaDataTranslator {
- /**
- * @param assistant perform translation using the IMetaDataModelMergeAssistant
- */
- public void translate(IMetaDataModelMergeAssistant assistant);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IPathSensitiveMetaDataLocator.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IPathSensitiveMetaDataLocator.java
deleted file mode 100644
index 0f0ed7125..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IPathSensitiveMetaDataLocator.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import org.eclipse.core.resources.IProject;
-
-/**
- * A <code>IMetaDataLocator</code> that is sensitive to the project context
- */
-public interface IPathSensitiveMetaDataLocator extends IMetaDataLocator {
- /**
- * @param project
- */
- public void setProjectContext(IProject project);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IResourceBundleProvider.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IResourceBundleProvider.java
deleted file mode 100644
index 640da3540..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IResourceBundleProvider.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import java.util.ResourceBundle;
-
-/**
- * Provides the resource bundle from the plugin that defined an item of metadata.
- */
-public interface IResourceBundleProvider {
- /**
- * @return ResourceBundle - implementers should eat exceptions and return null whenever resourceBundle cannot be returned
- */
- public ResourceBundle getResourceBundle();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IStandardMetaDataSourceInfo.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IStandardMetaDataSourceInfo.java
deleted file mode 100644
index 02270a31d..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/IStandardMetaDataSourceInfo.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-
-/**
- * Represents the metadata file defined by the StandardMetaDataFile extension-point
- * Not intended to be implemented by clients
- */
-public interface IStandardMetaDataSourceInfo {
- /**
- * @return location of metadata file that the locator class will use
- */
- public String getLocation();
- /**
- * @return bundle id of plugin defining the metadata file
- */
- public String getBundleId();
- /**
- * @return class name of the locator that will find the the standard metadata file
- */
- public String getLocatorClassname();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/JSPTagLibDomainLoadingStrategy.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/JSPTagLibDomainLoadingStrategy.java
deleted file mode 100644
index 9aeb8b4b0..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/JSPTagLibDomainLoadingStrategy.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import java.util.List;
-
-
-/**
- * Strategy for loading tag metadata. Extends and uses the default {@link DomainLoadingStrategy}.
- * Mainly exists for illustrative purposes. Could be removed..
- */
-public class JSPTagLibDomainLoadingStrategy extends DomainLoadingStrategy {
-
- /**
- * Constructor
- * @param domain
- */
- public JSPTagLibDomainLoadingStrategy(String domain) {
- super(domain);
- }
-
- /*@Override*/
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.DomainLoadingStrategy#sortSourceTypes(java.util.List)
- */
- protected void sortSourceTypes(List/*<IDomainSourceType>*/ sourceTypes) {
- //an opportunity to override the priority of the source types...
- }
-
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/Messages.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/Messages.java
deleted file mode 100644
index 74fd0a7b2..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/Messages.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Externalized strings for Metadata
- */
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.jst.jsf.common.metadata.internal.messages"; //$NON-NLS-1$
-
- /**
- * Property key not found in bundle
- */
- public static String Key_not_found;
-
- /**
- * Missing resource
- */
- public static String MissingResource_exception;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- // no external instantiation
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataChangeNotificationEvent.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataChangeNotificationEvent.java
deleted file mode 100644
index 8ecc17df6..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataChangeNotificationEvent.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-/**
- * Experimental. Subject to change.
- *
- */
-public class MetaDataChangeNotificationEvent implements
- IMetaDataChangeNotificationEvent {
-
- private String _uri;
- private IMetaDataLocator _locator;
- private int _type;
-
- /**
- * Constructor
- * @param locator
- * @param uri
- * @param type
- */
- public MetaDataChangeNotificationEvent(IMetaDataLocator locator, String uri, int type){
- this._locator = locator;
- this._uri = uri;
- this._type = type;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataChangeNotificationEvent#getEventType()
- */
- public int getEventType() {
- return _type;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataChangeNotificationEvent#getLocator()
- */
- public IMetaDataLocator getLocator() {
- return _locator;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataChangeNotificationEvent#getURI()
- */
- public String getURI() {
- return _uri;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataLocatorFactory.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataLocatorFactory.java
deleted file mode 100644
index ed92cf1c7..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataLocatorFactory.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jst.jsf.common.JSFCommonPlugin;
-
-/**
- * Creates instances of IMetaDataLocators and caches them so that there is only one instance of a particular locator
- * when client requests one.
- */
-public class MetaDataLocatorFactory {
- private static MetaDataLocatorFactory INSTANCE = null;
-
- /**
- * @return singleton instance of the MetaDataLocatorFactory
- */
- public synchronized static MetaDataLocatorFactory getInstance(){
- if (INSTANCE == null){
- INSTANCE = new MetaDataLocatorFactory();
- }
- return INSTANCE;
- }
-
- private HashMap _locators;
-
- private Map getLocators() {
- if (_locators == null){
- _locators = new HashMap();
- }
- return _locators;
- }
-
- /**
- * @param locatorClassName
- * @param bundleId
- * @return IMetaDataLocator
- */
- public IMetaDataLocator getLocator(String locatorClassName, String bundleId){
- String key = getKey(locatorClassName, bundleId);
- IMetaDataLocator locator = (IMetaDataLocator)getLocators().get(key);
- if (locator == null){
- Class klass = JSFCommonPlugin.loadClass(locatorClassName, bundleId);
- try {
- locator = (IMetaDataLocator)klass.newInstance();
- if (locator != null) {
- getLocators().put(key, locator);
- locator.startLocating();
- }
- } catch (InstantiationException e) {
- JSFCommonPlugin.log(IStatus.ERROR, "Could not instantiate IMetaDataLocator: "+key, e);
- } catch (IllegalAccessException e) {
- JSFCommonPlugin.log(IStatus.ERROR, "IllegalAccessException while creating IMetaDataLocator: "+key, e);
- }
- }
- return locator;
- }
-
- private String getKey(String locatorClassName, String bundleId) {
- StringBuffer buf = new StringBuffer(bundleId);
- buf.append(":");
- buf.append(locatorClassName);
- return buf.toString();
- }
-
- /**
- * Stops and disposes all locators
- */
- public void dispose(){
- for (Iterator it=getLocators().values().iterator();it.hasNext();){
- IMetaDataLocator locator = (IMetaDataLocator)it.next();
- locator.stopLocating();
- }
- getLocators().clear();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataModel.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataModel.java
deleted file mode 100644
index 5554ab7b8..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataModel.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import org.eclipse.jst.jsf.common.metadata.Model;
-
-/**
- * Responsible for loading and holding onto the standard metadata model using the IDomainLoadingStrategy.
- * Wraps the model (root) with the strategy used for loading it, along with the identifying key (modelKeyDescriptor)
- */
-public class MetaDataModel {
-
- private Object root;
- private ModelKeyDescriptor modelKeyDescriptor;
- private IDomainLoadingStrategy strategy;
- private boolean refresh;
-
- /**
- * Constructor
- * @param key
- * @param strategy
- */
- public MetaDataModel(ModelKeyDescriptor key, IDomainLoadingStrategy strategy){
- this.modelKeyDescriptor = key;
- this.strategy = strategy;
- }
-
- /**
- * @return the root of the model.
- */
- public Object getRoot(){
- return root;
- }
-
- /**
- * @param root
- */
- public void setRoot(Object root){
- this.root = root;
- if (root != null)
- ((Model)root).setCurrentModelContext(modelKeyDescriptor);
- }
-
- /**
- * @return ModelKeyDescriptor for this model
- */
- public ModelKeyDescriptor getModelKey(){
- return modelKeyDescriptor;
- }
-
-// public void accept(IEntityVisitor visitor){
-// if (getRoot() instanceof Model)
-// visitor.visit((Model)getRoot());
-// }
-
- /**
- * @return true if the model is null or is not, in fact, a {@link Model}
- */
- public boolean isEmpty() {
- if (root == null || !(root instanceof Model))
- return true;
-
- return false;
- }
-
- /**
- * Load the model. Delegates to the strategy.
- */
- public void load(){
- strategy.load(this);
- }
-
- /**
- * Reloads the model delegating to strategy reload
- * @throws ModelNotSetException
- */
- public void reload()throws ModelNotSetException{
- setRoot(null);
- refresh = false;
- strategy.reload();
- }
-
- /**
- * @return flag indicating that the model is stale
- */
- public boolean needsRefresh() {
- return refresh;
- }
-
- /**
- * Flag that model is stale
- */
- public void setNeedsRefresh() {
- refresh = true;
- }
-
- /**
- * Cleans up the model releasing references.
- */
- public void cleanup(){
- if (strategy != null)
- strategy.cleanup();
- strategy = null;
- root = null;
- modelKeyDescriptor = null;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataModelContextImpl.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataModelContextImpl.java
deleted file mode 100644
index 37b9e16fa..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataModelContextImpl.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import org.eclipse.jst.jsf.common.metadata.query.IMetaDataModelContext;
-
-/**
- * Simple implementation of {@link IMetaDataModelContext}
- *
- */
-public class MetaDataModelContextImpl implements IMetaDataModelContext {
- private String _domain;
-
- /**
- * Constructor
- * @param domain id
- */
- public MetaDataModelContextImpl(String domain){
- _domain = domain;
- }
-
- public String getDomainID() {
- return _domain;
- }
-
- public Object getAdapter(Class adapter) {
- if (adapter.equals(IMetaDataModelContext.class))
- return this;
- return null;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataModelManager.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataModelManager.java
deleted file mode 100644
index 15685528b..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataModelManager.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.jface.util.SafeRunnable;
-import org.eclipse.jst.jsf.common.JSFCommonPlugin;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-
-/**
- * Singleton instance for each IProject used to manage all standard metdata models for that project.
- *
- * Manager is responsible for loading and caching MetaDataModels. Models are keyed by URI.
- *
- * The manager listens for project closing resource events so that the resources can be freed up.
- */
-public class MetaDataModelManager implements IResourceChangeListener{
- /**
- * Key that is used for the IProject instance's session property that
- * holds a MetaDataModelManager instance. Each project will have it's own instance of a model manager.
- */
- public static final QualifiedName KEY_SESSIONPROPERTY =
- new QualifiedName(null, "MetaDataModelManager"); //$NON-NLS-1$ FIX ME
-
- private static MetaDataModelManager SHARED_INSTANCE;
- private ModelMap models;
- private IProject project;
-
- /**
- * @return instance that is project agnostic. * may get removed *
- */
- public synchronized static MetaDataModelManager getSharedInstance(){
- if (SHARED_INSTANCE == null) {
- SHARED_INSTANCE = new MetaDataModelManager(null);
- }
- return SHARED_INSTANCE;
- }
-
- /**
- * @param project
- * @return instance of the model manager for this project. Shouldn't, but may, return null.
- */
- public synchronized static MetaDataModelManager getInstance(IProject project){
- MetaDataModelManager repo = null;
- repo = getFromSessionProperty(project);
- if (repo == null) {
- repo = new MetaDataModelManager(project);
- ResourcesPlugin.getWorkspace().addResourceChangeListener(repo, IResourceChangeEvent.PRE_CLOSE);
- }
- return repo;
- }
- private MetaDataModelManager(IProject project) {
- this.project = project;
- init();
- }
-
- /**
- * @param project
- * @return MetaDataModelManager instance for the project
- */
- protected static MetaDataModelManager getFromSessionProperty(IProject project) {
- MetaDataModelManager repo = null;
- try {
- Object obj = project.getSessionProperty(KEY_SESSIONPROPERTY);
- if (obj != null && obj instanceof MetaDataModelManager) {
- repo = (MetaDataModelManager)obj;
- }
- } catch(CoreException ce) {
- JSFCommonPlugin.log(IStatus.ERROR, "Internal Error: Unable to recover MetaDataModelManager for: "+project.getName(), ce); //$NON-NLS-1$
- }
- return repo;
- }
-
- /**
- * Sets this MetaDataModelManager instance as a session property of its
- * IProject instance.
- */
- protected void setAsSessionProperty() {
- if (project != null) {//&& project.isAccessible()) {
- try {
- project.setSessionProperty(KEY_SESSIONPROPERTY, this);
- } catch(CoreException ce) {
- JSFCommonPlugin.log(IStatus.ERROR, "Internal Error: Unable to store MetaDataModelManager for: "+project.getName(), ce); //$NON-NLS-1$ }
- }
- }
- }
-
- /**
- * Releases a project's MetaDataModelManager instance by removing from project session property
- * @param aProject
- */
- protected void removeAsSessionProperty(IProject aProject){
- try {
- aProject.setSessionProperty(KEY_SESSIONPROPERTY, null);
- } catch (CoreException e) {
- JSFCommonPlugin.log(e, "Error removing session property"); //$NON-NLS-1$
- }
- }
-
- private synchronized void init() {
- models = new ModelMap();
- setAsSessionProperty();
- }
-
-
- /**
- * Will locate the cached MetaDataModel. Sets the model context in the model.
- * @param modelContext
- * @return the MetaDataModel for the given ITaglibDomainMetaDataModelContext
- */
- public synchronized MetaDataModel getModel(final ITaglibDomainMetaDataModelContext modelContext){
- ModelKeyDescriptor modelKeyDescriptor = StandardModelFactory.getInstance().createModelKeyDescriptor(modelContext);
- MetaDataModel model = models.get(modelKeyDescriptor);
- if (model == null || project == null){
-// long in = System.currentTimeMillis();
- model = loadMetadata(modelKeyDescriptor);
-// System.out.println("Time to load "+modelContext.getURI()+": "+String.valueOf(System.currentTimeMillis() - in));
- }
- else if (model.needsRefresh()){
- try {
- model.reload();
- } catch (ModelNotSetException e) {
- //simply load it - should not get here
- model = loadMetadata(modelKeyDescriptor);
- }
- }
- if (model != null && model.getRoot() != null)
- ((Model)model.getRoot()).setCurrentModelContext(modelKeyDescriptor);
-
- return model;
- }
-
- private void addModel(MetaDataModel model) {
-
- if (model != null)
- models.put(model.getModelKey(), model);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
- */
- public void resourceChanged(IResourceChangeEvent event) {
- if (event.getType() == IResourceChangeEvent.PRE_CLOSE){
- //a project is closing - release and cleanup
- final IProject aProject = (IProject)event.getResource();
- if (aProject == this.project){
- SafeRunnable.run(new ISafeRunnable(){
-
- public void handleException(Throwable exception) {
- // FIXME: what to do here?
-
- }
-
- public void run() throws Exception {
- for (Iterator it=models.getModels().iterator();it.hasNext();){
- MetaDataModel model = (MetaDataModel)it.next();
- models.remove(model);
- model.cleanup();
- }
- removeAsSessionProperty(project);
- }
- });
- }
- }
-
- }
-
- private synchronized MetaDataModel loadMetadata(ModelKeyDescriptor modelKeyDescriptor){
- IDomainLoadingStrategy strategy = DomainLoadingStrategyRegistry.getInstance().getLoadingStrategy(modelKeyDescriptor.getDomain());;
- if (strategy == null){
- JSFCommonPlugin.log(IStatus.ERROR, "Internal Error: Unable to locate metadata loading strategy for: "+modelKeyDescriptor.toString()); //$NON-NLS-1$
- return null;
- }
- MetaDataModel model = StandardModelFactory.getInstance().createModel(modelKeyDescriptor, strategy);//new MetaDataModel(modelKey, strategy);
- model.load();
- addModel(model);
-
- return model;
- }
-
- /**
- * Map of models keyed by ModelKeyDescriptor (.toString())
- *
- */
- private class ModelMap{
- private HashMap /*<String, MetaDataModel>*/ map;
-
- ModelMap(){
- map = new HashMap/*<String, MetaDataModel>*/();
- }
-
- /**
- * @param modelKeyDescriptor
- * @param model adds model to the map using the given key descriptor
- */
- public void put(ModelKeyDescriptor modelKeyDescriptor, MetaDataModel model){
- String key = modelKeyDescriptor.toString();
- map.put(key, model);
- }
-
- /**
- * @param modelKeyDescriptor
- * @return MetaDataModel for this ModelKeyDescriptor. May return null.
- */
- public synchronized MetaDataModel get(ModelKeyDescriptor modelKeyDescriptor){
- String key = modelKeyDescriptor.toString();
- return (MetaDataModel)map.get(key);
- }
-
- /**
- * @param model from the map
- */
- public void remove(MetaDataModel model){
- map.remove(model.getModelKey().toString());
- }
- /**
- * @return models in this map as a Set
- */
- public Set getModels(){
- Set ret = new HashSet();
- for (Iterator it=map.entrySet().iterator();it.hasNext();){
- Map.Entry entry = (Map.Entry)it.next();
- ret.add(entry.getValue());
- }
- return ret;
- }
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataModelMergeAssistantImpl.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataModelMergeAssistantImpl.java
deleted file mode 100644
index df3c715e3..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/MetaDataModelMergeAssistantImpl.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.emf.ecore.util.EcoreUtil.Copier;
-import org.eclipse.jst.jsf.common.JSFCommonPlugin;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.EntityGroup;
-import org.eclipse.jst.jsf.common.metadata.IncludeEntityGroup;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-import org.eclipse.jst.jsf.common.metadata.query.MetaDataException;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-import org.eclipse.jst.jsf.common.metadata.query.internal.SearchControl;
-import org.eclipse.jst.jsf.common.metadata.query.internal.SimpleEntityQueryVisitorImpl;
-import org.eclipse.jst.jsf.common.metadata.query.internal.SimpleResultSet;
-import org.eclipse.jst.jsf.common.metadata.query.internal.SimpleTraitQueryVisitorImpl;
-import org.eclipse.jst.jsf.common.metadata.query.internal.HierarchicalSearchControl;
-/**
- * Implements {@link IMetaDataModelMergeAssistant}
- *
- * Responsible for merging source models into one. The first model in has subsequent
- * entities and traits added to it.
- *
- * TODO - make locating of existing entities and traits in the merged model more efficient
- * TODO - refactor out Taglibdomain-only aspects of include-group processing
- *
- */
-public class MetaDataModelMergeAssistantImpl implements
- IMetaDataModelMergeAssistant {
-
- private MetaDataModel mergedModel;
- private Copier copier;
- private SimpleEntityQueryVisitorImpl entityVisitor;
- private SimpleTraitQueryVisitorImpl traitVisitor;
- private IMetaDataSourceModelProvider provider;
-
- /**
- * Constructor. Queries with search control limited to first found.
- * @param model
- */
- public MetaDataModelMergeAssistantImpl(MetaDataModel model) {
- this.mergedModel = model;
- copier = new Copier();
- entityVisitor = new SimpleEntityQueryVisitorImpl(new HierarchicalSearchControl(1,
- HierarchicalSearchControl.SCOPE_ALL_LEVELS));
- traitVisitor = new SimpleTraitQueryVisitorImpl(new SearchControl(1));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataModelMergeAssistant#getMergedModel()
- */
- public MetaDataModel getMergedModel() {
- return mergedModel;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataModelMergeAssistant#getSourceModel()
- */
- public IMetaDataSourceModelProvider getSourceModelProvider() {
- return provider;
- }
-
- public void setSourceModelProvider(IMetaDataSourceModelProvider provider) {
- this.provider = provider;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataModelMergeAssistant#addEntityGroup(org.eclipse.jst.jsf.common.metadata.EntityGroup)
- */
- public void addEntityGroup(EntityGroup entityGroup) {
- Model model = (Model)getMergedModel().getRoot();
- if (!isExistingEntityGroup(model, entityGroup)){
- model.getEntityGroups().add(entityGroup);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataModelMergeAssistant#addEntity(org.eclipse.jst.jsf.common.metadata.Entity)
- */
- public boolean addEntity(final Entity entity) {
- Entity mmEntity = getMergedEntity(entity);
- if (mmEntity == null){
- addEntityAsNecessary((Entity)entity.eContainer(), entity);
- return true;
- }
- addIncludeGroupsAsNecessary(mmEntity, entity);
- return false;
- }
-
- private void addIncludeGroupsAsNecessary(final Entity mmEntity, final Entity entity) {
- for (Iterator it=entity.getIncludeGroups().iterator();it.hasNext();){
- IncludeEntityGroup grp = (IncludeEntityGroup)it.next();
- boolean found = false;
- for (Iterator it2=mmEntity.getIncludeGroups().iterator();it2.hasNext();){
- IncludeEntityGroup grp2 = (IncludeEntityGroup)it2.next();
- if (grp2.equals(grp)){
- found = true;
- break;
- }
- }
- if (!found){//maybe we should clone and add
- mmEntity.getIncludeGroups().add(grp);
- }
- }
- }
-
- /**
- * Checks to see if the entity (by id) is present in the mergedModel or not.
- * If not, it will perform a copy of the entity and it's attributes using
- * EcoreUtil.Copier.
- *
- * @param parent
- * @param entity
- * @return
- */
- private Entity addEntityAsNecessary(final Entity parent, final Entity entity) {
- Entity mmParent = null;
- Entity mmEntity = null;
- if (parent != null){
- mmParent = getMergedEntity(parent);
- if (mmParent == null){
- mmParent = addEntityAsNecessary((Entity)entity.eContainer(), entity);
- }
- }
- if (mmParent != null){
- mmEntity = addEntityInternal(mmParent, entity);
- return mmEntity;
- }
- return mmEntity;
- }
-
- private boolean isExistingEntityGroup(Model model, EntityGroup entityGroup) {
- boolean found = false;
- for(Iterator it=model.getEntityGroups().iterator();it.hasNext();){
- if (entityGroup.getId().equals(((EntityGroup)it.next()).getId()))
- return true;
- }
- return found;
- }
-
- private Entity getExistingChildEntity(final Entity parent, final Entity entity) {
- for(Iterator it=parent.getChildEntities().iterator();it.hasNext();){
- Entity foundEntity = (Entity)it.next();
- if (entity.getId().equals(foundEntity.getId()))
- return foundEntity;
- }
- return null;
- }
-
- private /*synchronized*/ Entity addEntityInternal(final Entity parent, final Entity entity) {
- Entity mmEntity =(Entity)copier.copy(entity);
- copier.copyReferences();
- parent.getChildEntities().add(mmEntity);
- return mmEntity;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataModelMergeAssistant#addTrait(org.eclipse.jst.jsf.common.metadata.Entity, org.eclipse.jst.jsf.common.metadata.Trait)
- */
- public boolean addTrait(Entity entity, Trait trait) {
- Entity returnedEntity = getMergedEntity(entity);
- if (returnedEntity != null){
- return addTraitAsNecessary(returnedEntity, trait);
- }
- return false;
- }
-
-
- private boolean addTraitAsNecessary(Entity mergedEntity, Trait trait) {
- Trait mmTrait = getMergedTrait(mergedEntity, trait);
- if (mmTrait == null){
- mmTrait = addTraitInternal(mergedEntity, trait);
- return true;
-
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataModelMergeAssistant#setMergeComplete()
- */
- public void setMergeComplete() {
- Model model = (Model)getMergedModel().getRoot();
- if (model != null)
- processIncludeGroups(model);
- }
-
- /**
- * Copies the passed trait and adds it to the merged entity.
- * The source model provider of the trait is then set on the trait so that
- * the trait can know where it came from.
- *
- * @param parent
- * @param trait
- * @return merged Trait
- */
- private Trait addTraitInternal(final Entity parent, final Trait trait) {
- Trait mmTrait =(Trait)copier.copy(trait);
- copier.copyReferences();
- parent.getTraits().add(mmTrait);
- //set the model key to know from where the trait came
- mmTrait.setSourceModelProvider(trait.getSourceModelProvider());
- return mmTrait;
- }
-
- /**
- * Locates the entity in the merged model matching by id only.
- * If not located, this method returns null;
- *
- * @param entity
- * @return merged entity
- */
- private Entity getMergedEntity(Entity entity){
- if (entity instanceof Model)
- return (Entity)mergedModel.getRoot();
-
- Entity ret = null;
- String entityKey = getIdRelativeToRoot(entity);
- SimpleResultSet rs = (SimpleResultSet)entityVisitor.findEntities((Entity)mergedModel.getRoot(), entityKey);
- try {
- if (! rs.getResults().isEmpty())
- ret = (Entity)rs.getResults().get(0);
- rs.close();
- } catch (MetaDataException e) {
- JSFCommonPlugin.log(IStatus.ERROR, "Error in getMergedEntity()", e);
- }
- return ret;
- }
-
- private String getIdRelativeToRoot(final Entity entity) {
- Entity e = entity;
- StringBuffer buf = new StringBuffer();
- while (e.eContainer() != null){
- buf.insert(0, e.getId());
- if (e.eContainer()!=null && e.eContainer().eContainer() != null)
- buf.insert(0,"/");
- e = (Entity)e.eContainer();
- }
- return buf.toString();
- }
-
- /**
- * Locates the trait in the merged model matching by id only.
- * If not located, this method returns null;
- *
- * @param entity
- * @param trait
- * @return merged Trait
- */
- public Trait getMergedTrait(Entity entity, Trait trait){
- SimpleResultSet rs = (SimpleResultSet)traitVisitor.findTraits(entity, trait.getId());
- Trait ret = null;
- try {
- if (! rs.getResults().isEmpty())
- ret = (Trait)rs.getResults().get(0);
- rs.close();
- } catch (MetaDataException e) {
- JSFCommonPlugin.log(IStatus.ERROR, "Error in getMergedTrait()", e);
- }
- return ret;
- }
-
- private void processIncludeGroups(final Model root) {
- addEntityGroupReferencesRecursively(root);
- }
-
- private void addEntityGroupReferencesRecursively(final Entity entity) {
- doIncludes(entity);
- for (int i=0, size=entity.getChildEntities().size();i<size;i++){
- addEntityGroupReferencesRecursively((Entity)entity.getChildEntities().get(i));
- }
- }
-
- private void doIncludes(final Entity entity){
- for (int j=0, groupsSize=entity.getIncludeGroups().size();j<groupsSize; j++){
- IncludeEntityGroup include = (IncludeEntityGroup)entity.getIncludeGroups().get(j);
- if (include.getId() != null){
- //is this a local merge?
- if (include.getModelUri() == null||
- (include.getModelUri()
- .equals(getMergedModel()
- .getModelKey().getUri())) ){
- EntityGroup eg = ((Model)getMergedModel().getRoot()).findIncludeGroup(include.getId());
- addIncludeRefs(entity, eg);
- } else //external model include
- addIncludeRefs(entity, include);
- }
- }
- }
- /*
- * Adds traits and child entities from an external entity group to the passed entity
- * @param entity
- * @param include
- */
- private void addIncludeRefs(final Entity entity, final IncludeEntityGroup include) {
- ITaglibDomainMetaDataModelContext modelContext = new TaglibDomainMetaDataModelContextImpl(
- getMergedModel().getModelKey().getDomain(),
- getMergedModel().getModelKey().getProject(),
- include.getModelUri()
- );
-
- Model externalModel = TaglibDomainMetaDataQueryHelper.getModel(modelContext);
- EntityGroup entityGroup = externalModel.findIncludeGroup(include.getId());
-
- addIncludeRefs(entity, entityGroup);
- }
-
- /*
- * Adds traits and child entities from a local entity group to the passed entity if not already present for the entity.
- * First
- * @param entity
- * @param entityGroup
- */
- private void addIncludeRefs(final Entity entity, final EntityGroup entityGroup) {
- if (entityGroup == null)
- return;
-
- for (int i=0, size=entityGroup.getTraits().size();i<size;i++){
- addTrait(entity, (Trait)entityGroup.getTraits().get(i));
- }
-
- for (int i=0, size=entityGroup.getChildEntities().size();i<size;i++){
- traverseAndAddIncludes(entity, (Entity)entityGroup.getChildEntities().get(i));
- }
- }
-
- private void traverseAndAddIncludes(final Entity parent, final Entity entity){
- Entity mergedEntity = addIncludedEntityAsNecessary(parent, entity);
-
- for (final Iterator/*<Trait>*/ it=entity.getTraits().iterator();it.hasNext();){
- Trait trait = (Trait)it.next();
- addTraitAsNecessary(mergedEntity, trait);
- }
-
- for (final Iterator/*<EntityKey>*/ it=entity.getChildEntities().iterator();it.hasNext();){
- Entity e = (Entity)it.next();
- traverseAndAddIncludes(mergedEntity, e);//add as normal
- }
-
- }
-
- /*
- * Checks to see if the entity (by id) is present as a child entity in the parent or not.
- * If not, it will add the entity to the childEntities without copying.
- *
- * @param parent
- * @param entity
- * @return Entity
- */
- private Entity addIncludedEntityAsNecessary(final Entity parent, final Entity entity) {
- Entity mergedEntity = getExistingChildEntity(parent, entity);
- if (mergedEntity == null){
- mergedEntity = addEntityInternal(parent, entity);
- }
- return mergedEntity;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/ModelKeyDescriptor.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/ModelKeyDescriptor.java
deleted file mode 100644
index b08227701..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/ModelKeyDescriptor.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import org.eclipse.core.resources.IProject;
-
-/**
- * Meta data model key descriptor used to lazily load a model when it is required
- *
- */
-public class ModelKeyDescriptor {
- private IProject project;
- private String domain;
- private String uri;
- private String key;
-
- /**
- * Constructor
- * @param project
- * @param domain
- * @param uri
- */
- public ModelKeyDescriptor(IProject project, String domain, String uri){
- this.project = project;
- this.domain = domain;
- this.uri = uri;
- StringBuffer buf = new StringBuffer(domain);
- buf.append(":");
- buf.append(uri);
- key = buf.toString();
- }
-
- /**
- * @return domain id
- */
- public String getDomain(){
- return domain;
- }
-
- /**
- * @return model uri
- */
- public String getUri(){
- return uri;
- }
-
- /**
- * @return project
- */
- public IProject getProject(){
- return project;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString(){
- return key;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/ModelNotSetException.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/ModelNotSetException.java
deleted file mode 100644
index 34b90b125..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/ModelNotSetException.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-/**
- * Experimental
- *
- */
-public class ModelNotSetException extends Exception {
- private static final long serialVersionUID = 1L;
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/PluginRelativeStandardMetaDataSourceFileLocator.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/PluginRelativeStandardMetaDataSourceFileLocator.java
deleted file mode 100644
index 9e19b56f2..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/PluginRelativeStandardMetaDataSourceFileLocator.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-
-/**
- * Default implementation of StandardMetaDataSourceFileLocator that will locate standard metadata files
- * and resource bundles relative to the plugin that registered the files using the
- * <code>org.eclipse.jst.jsf.common.StandardMetaDataFiles</code> ext-pt.
- *
- */
-public class PluginRelativeStandardMetaDataSourceFileLocator extends StandardMetaDataSourceFileLocator{
-
- private ResourceBundle resourceBundle;
-
- /*
- * Returns InputStream of standard metadata file from plugin relative location.
- *
- */
- public InputStream getInputStream() throws IOException {
- URL url = FileLocator.find(Platform.getBundle(fileInfo.getBundleId()), Path.fromOSString(fileInfo.getLocation()), null);
- if (url != null)
- return url.openStream();
-
- String fileName = Path.fromOSString(fileInfo.getLocation()).toString() + " (Plugin: " + fileInfo.getBundleId()+")" ;
- throw new FileNotFoundException("Metadata file not found: "+ fileName);
- }
-
-
- /*
- * Returns property resource bundle if it exists. May return null.
- * This implementation assumes that the basename of the bundle is the same
- * as the source file name and in the same directory.
- *
- */
- public ResourceBundle getResourceBundle() throws IOException, MalformedURLException {
- if (resourceBundle == null){
- URL bundleURL = getStandardMetaDataSourceFileBasenameURL();
- if (bundleURL == null)
- return null;
-
- resourceBundle = ResourceBundleHelper.getResourceBundle(bundleURL);
- }
- return resourceBundle;
- }
-
- private URL getStandardMetaDataSourceFileBasenameURL() {
- IPath annotationPath = Path.fromOSString(fileInfo.getLocation());
- IPath annotationFolder = annotationPath.removeLastSegments(1);
- IPath propertiesLocation = annotationPath.removeFirstSegments(annotationPath.segmentCount() - 1).removeFileExtension();
- // append location of properties file
- IPath propertiesFile = annotationFolder.append(propertiesLocation);
-
- // append .properties extension if needed
- if (propertiesFile.getFileExtension() == null)
- propertiesFile = propertiesFile.addFileExtension("properties"); //$NON-NLS-1$
- // create a URL out of the properties file location
- return FileLocator.find(Platform.getBundle(fileInfo.getBundleId()),
- propertiesFile, null);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/ResourceBundleHelper.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/ResourceBundleHelper.java
deleted file mode 100644
index 58788dcc2..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/ResourceBundleHelper.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * Gerry Kessler/Oracle - copied from org.eclipse.wst.sse.core.internal.encoding.util and modified heavily
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-
-/**
- * ResourceBundleHelper
- *
- */
-public class ResourceBundleHelper {
-
- /**
- * @param resourceURL
- * @return ResourceBundle
- * @throws MalformedURLException - may return null
- * @throws IOException
- */
- public static ResourceBundle getResourceBundle(URL resourceURL) throws MalformedURLException, IOException {
- return getResourceBundle(resourceURL, Locale.getDefault());
- }
-
- /**
- * @param resourceURL
- * @param targetLocale
- * @return ResourceBundle - may return null
- * @throws MalformedURLException
- * @throws IOException
- */
- public static ResourceBundle getResourceBundle(URL resourceURL, Locale targetLocale) throws MalformedURLException, IOException {
- // try to load bundle from the location specified in the resourceURL
- //
- String protocol = resourceURL.getProtocol();
- String host = resourceURL.getHost();
- String file = resourceURL.getFile();
- IPath path = new Path(file);
-
- String dir = "./";
- String bundleName = path.removeFileExtension().segment(path.segmentCount() - 1);
- if (path.segmentCount() > 1)
- dir = path.removeLastSegments(1).toString();
-
- // create a class loader with a class path that points to the resource
- // bundle's location
- //
- URL[] classpath = new URL[1];
- classpath[0] = FileLocator.resolve(new URL(protocol, host, dir));
- ClassLoader resourceLoader = new URLClassLoader(classpath, null);
-
- return ResourceBundle.getBundle(bundleName, targetLocale, resourceLoader);
- }
-}
-
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardMetaDataFileInfo.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardMetaDataFileInfo.java
deleted file mode 100644
index 5dfb331df..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardMetaDataFileInfo.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-/**
- * Contains information about annotation files.
- */
-public final class StandardMetaDataFileInfo implements IStandardMetaDataSourceInfo{
-
- private String fileLocation;
- private String fileLocatorClassname;
- private String bundleId;
-
- /**
- * Constructor
- * @param fileLocation
- * @param bundleId
- * @param fileLocatorClassname
- */
- public StandardMetaDataFileInfo( String fileLocation, String bundleId, String fileLocatorClassname) {
- this.fileLocation = fileLocation.trim();
- this.bundleId = bundleId.trim();
- this.fileLocatorClassname = fileLocatorClassname;
- }
-
- /**
- * Get the location of the annotation file as originally specified.
- *
- * @return String
- */
- public String getLocation() {
- return fileLocation;
- }
-
- /**
- * Get the annotation file locator classname that must implement ICMAnnotationSourceFileLocator.
- * Can return null or empty string. Caller should provide default.
- *
- * @return String
- */
- public String getLocatorClassname() {
- return fileLocatorClassname != null ? fileLocatorClassname.trim() : null;
- }
-
- /**
- * Get the bundle id of the plugin where the annotation file is located.
- *
- * @return String
- */
- public String getBundleId() {
- return bundleId;
- }
-
- public String toString(){
- StringBuffer buf = new StringBuffer("StandardMetaDataFileInfo");
- buf.append(": ");
- buf.append(bundleId);
- buf.append("/");
- buf.append(fileLocation);
- if (getLocatorClassname() != null){
- buf.append(": ");
- buf.append(getLocatorClassname());
- }
- return buf.toString();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardMetaDataFileRegistry.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardMetaDataFileRegistry.java
deleted file mode 100644
index e49ca1ae7..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardMetaDataFileRegistry.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006, 2007 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 - Initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * Gerry Kessler/Oracle - code borrowed and repurposed for JSF subproject
- *
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.jsf.common.JSFCommonPlugin;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper;
-
-
-/**
- * Registry of standard metadata files
- */
-public final class StandardMetaDataFileRegistry {
- private Map/*<String, List<IMetaDataSourceModelProvider>>*/ mdFilesMap = new HashMap/*<String, List<IMetaDataSourceModelProvider>>*/(1);
- private List/*<IMetaDataSourceModelProvider>*/ EMPTY_LIST = new ArrayList/*<IMetaDataSourceModelProvider>*/(0);
-
- private static StandardMetaDataFileRegistry reg;
-
- /**
- * @return the singleton instance of the registry
- */
- public static StandardMetaDataFileRegistry getInstance() {
- if (reg == null){
- reg = new StandardMetaDataFileRegistry();
- }
- return reg;
- }
-
- private StandardMetaDataFileRegistry() {
- new StandardMetaDataFileRegistryReader(this).readRegistry();
- }
-
- /**
- * @param uri as String
- * @return list of standard metadata sources as <code>IMetaDataSourceModelProvider</code>s.
- * Returns empty list of no standard metadata files are registered for the given uri.
- */
- public synchronized List/*<IMetaDataSourceModelProvider>*/ getStandardMetaDataModelProviders(String uri) {
- List/*<IMetaDataSourceModelProvider>*/ theList = (List)mdFilesMap.get(uri);
- return theList != null ? theList : EMPTY_LIST ;
- }
-
- /**
- * For use by registry reader only
- * @param uri
- * @param fileInfo
- */
- public synchronized void addStandardMetaDataFileInfo(String uri, IStandardMetaDataSourceInfo fileInfo) {
- List/*<IMetaDataSourceModelProvider>*/ providers = (List) mdFilesMap.get(uri);
- if (providers == null) {
- providers = new ArrayList/*<IStandardMetaDataSourceInfo>*/();
- mdFilesMap.put(uri, providers);
- }
- providers.add(new StandardMetaDataFilesProvider(fileInfo, uri));
- }
-
-/**
- * Internal implementation of IMetaDataSourceModelProvider for "standard" metadata sources
- *
- */
-class StandardMetaDataFilesProvider implements IMetaDataSourceModelProvider {
-
- private org.eclipse.jst.jsf.common.metadata.internal.IStandardMetaDataSourceInfo info;
- private Object model;
- private IMetaDataLocator locator;
- private StandardMetaDataSourceFileLocator fileLocator = null;
-
- /**
- * Constructor
- * @param info
- * @param uri
- */
- StandardMetaDataFilesProvider(IStandardMetaDataSourceInfo info, String uri){
- this.info = info;
- }
-
- private StandardMetaDataSourceFileLocator getFileLocator(){
- if (fileLocator == null){
- if (info.getLocatorClassname() == null){
- fileLocator = new PluginRelativeStandardMetaDataSourceFileLocator();
- }
- else {
- Class klass = JSFCommonPlugin.loadClass(info.getLocatorClassname(), info.getBundleId());
- try {
- fileLocator = (StandardMetaDataSourceFileLocator)klass.newInstance();
- } catch (InstantiationException e) {
- JSFCommonPlugin.log(IStatus.ERROR, "InstantiationException: StandardMetaDataFilesProvider.getFileLocator()", e); //$NON-NLS-1$
- } catch (IllegalAccessException e) {
- JSFCommonPlugin.log(IStatus.ERROR, "IllegalAccessException: StandardMetaDataFilesProvider.getFileLocator()", e); //$NON-NLS-1$
- }
- }
- if (fileLocator != null)
- fileLocator.setFileInfo(info);
- }
- return fileLocator;
- }
-
- private InputStream getInputStream() throws IOException {
- if (getFileLocator() != null){
- return getFileLocator().getInputStream();
- }
- return null;
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider#getSourceModel()
- */
- public Object getSourceModel() {
- if (model != null)
- return model;
-
- InputStream inputStream = null;
- try {
- inputStream = getInputStream();
- if (inputStream != null){
- EList contents = StandardModelFactory.getInstance().loadStandardFileResource(inputStream, this);
- //check to see if this is a Model
- if (contents != null && contents.get(0) instanceof Model){
- model = contents.get(0);
- ((Model)model).setSourceModelProvider(this);
- }
- }
- } catch (FileNotFoundException e){
- JSFCommonPlugin.log(IStatus.ERROR, e.getLocalizedMessage());
- } catch (IOException e) {
- JSFCommonPlugin.log(IStatus.ERROR,"IOException(1): StandardMetaDataFilesProvider.getSourceModel()", e); //$NON-NLS-1$
- } finally {
- if (inputStream != null){
- try {
- inputStream.close();
- } catch (IOException e) {
- JSFCommonPlugin.log( IStatus.ERROR,"IOException (2): StandardMetaDataFilesProvider.getSourceModel()", e); //$NON-NLS-1$
- }
- }
- }
- return model;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider#getLocator()
- */
- public IMetaDataLocator getLocator() {
- return locator;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider#setLocator(org.eclipse.jst.jsf.common.metadata.internal.IMetaDataLocator)
- */
- public void setLocator(IMetaDataLocator locator) {
- this.locator = locator;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider#getResourceBundle()
- */
- private ResourceBundle internalGetResourceBundle() {
- if (getFileLocator() != null){
- try {
- return fileLocator.getResourceBundle();
- } catch (MissingResourceException e) {
- JSFCommonPlugin.log(IStatus.ERROR, "InternalGetResourceBundle1", e);
- } catch (IOException e) {
- JSFCommonPlugin.log(IStatus.ERROR, "InternalGetResourceBundle2", e);
- }
- }
- return null;
- }
-
- public Object getAdapter(Class klass) {
- final StandardMetaDataFilesProvider mdp = this;
- if (klass == IImageDescriptorProvider.class){
- return new IImageDescriptorProvider(){
- String imageBase;
- public ImageDescriptor getImageDescriptor(String imagePath) {
- imagePath = appendImageBase(imagePath);
- String bundleID = mdp.getFileLocator().getFileInfo().getBundleId();
- URL url = FileLocator.find(Platform.getBundle(bundleID), new Path(imagePath), null);
- return ImageDescriptor.createFromURL(url);
- }
- private String appendImageBase(String imagePath) {
- return getImageBase() + imagePath;
- }
-
- private String getImageBase(){
- if (imageBase == null){
- Model aModel = (Model)getSourceModel();
- Trait t = TaglibDomainMetaDataQueryHelper.getTrait(aModel, "images-base-path"); //$NON-NLS-1$
- if (t == null){
- imageBase = ""; //$NON-NLS-1$
- } else {
- imageBase = TraitValueHelper.getValueAsString(t);
- if (imageBase != null && imageBase.length() > 0){
- imageBase = imageBase +"/"; //$NON-NLS-1$
- }
- }
- }
- return imageBase;
- }
-
- };
-
- } else if (klass == IResourceBundleProvider.class) {
- return new IResourceBundleProvider(){
-
- public ResourceBundle getResourceBundle() {
- return mdp.internalGetResourceBundle();
- }
-
- };
-
- } else if (klass == IClassLoaderProvider.class){
- return new IClassLoaderProvider(){
-
- public Class loadClass(String className) {
- String bundleID = mdp.getFileLocator().getFileInfo().getBundleId();
- try {
- return Platform.getBundle(bundleID).loadClass(className);
- } catch (ClassNotFoundException e) {
- return null;
- }
- }
-
- };
- }
- return null;
- }
-
-}
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardMetaDataFileRegistryReader.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardMetaDataFileRegistryReader.java
deleted file mode 100644
index a6b051b38..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardMetaDataFileRegistryReader.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006, 2007 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 - Initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * Gerry Kessler/Oracle - code borrowed and repurposed for JSF subproject
- *
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.jsf.common.JSFCommonPlugin;
-
-
-/**
- * This class reads the standardMetaDataFiles extensions adds each specified standard metadata
- * file to the StandardMetaDataFileRegistry.
- *
- * @see StandardMetaDataFileRegistry
- * also see StandardMetaDataFile extension-point
- */
-public class StandardMetaDataFileRegistryReader {
- /**
- * EXTENSION POINT ID
- */
- protected static final String EXTENSION_POINT_ID = "standardMetaDataFiles"; //$NON-NLS-1$
- /**
- * IConfigurationElement element name
- */
- protected static final String TAG_NAME = "StandardMetaDataFile"; //$NON-NLS-1$
- /**
- * Uri attribute name for IConfigurationElement
- */
- protected static final String ATT_URI = "uri"; //$NON-NLS-1$
- /**
- * Location attribute name for IConfigurationElement
- */
- protected static final String ATT_LOCATION = "location"; //$NON-NLS-1$
- /**
- * Locator attribute name for IConfigurationElement
- */
- protected static final String ATT_LOCATOR = "locator"; //$NON-NLS-1$
-
- private StandardMetaDataFileRegistry annotationFileRegistry;
-
- /**
- * Constructor
- * @param registry
- */
- public StandardMetaDataFileRegistryReader(StandardMetaDataFileRegistry registry) {
- this.annotationFileRegistry = registry;
- }
-
- /**
- * read the registery
- */
- public void readRegistry() {
- IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
- IExtensionPoint point = extensionRegistry.getExtensionPoint(JSFCommonPlugin.PLUGIN_ID, EXTENSION_POINT_ID);
- if (point != null) {
- IConfigurationElement[] elements = point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++) {
- readElement(elements[i]);
- }
- }
- }
-
- private void readElement(IConfigurationElement element) {
- if (element.getName().equalsIgnoreCase(TAG_NAME)) {
- String uri = element.getAttribute(ATT_URI);
- String location = element.getAttribute(ATT_LOCATION);
- String locator = element.getAttribute(ATT_LOCATOR);
- String bundleId = null;
- if (uri != null && location != null) {
- try {
- bundleId = element.getContributor().getName();
- StandardMetaDataFileInfo fileInfo = new StandardMetaDataFileInfo(location, bundleId, locator);
- annotationFileRegistry.addStandardMetaDataFileInfo(uri, fileInfo);
- }
- catch (Exception e) {
- JSFCommonPlugin.log(IStatus.ERROR, "Internal Error: exception occurred while reading StandardMetaDataFile ext-pt: "+location + ":"+uri, e); //$NON-NLS-1$ }
- }
- }
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardMetaDataFilesTranslator.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardMetaDataFilesTranslator.java
deleted file mode 100644
index 261f24e96..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardMetaDataFilesTranslator.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import java.util.Iterator;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.EntityGroup;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-
-
-/**
- * A 'null' translation of a metadata file. Entities and traits are not transformed.
- *
- */
-public class StandardMetaDataFilesTranslator implements IMetaDataTranslator {
-
- public void translate(IMetaDataModelMergeAssistant assistant) {//TODO: throw proper errors
- //null translate - sourceModel object are already Entities and traits
- //traverse the tree and add to model
-
- //temp - throw proper errors
- //assert assistant.getSourceModel() instanceof ModelKeyDescriptor;
-
- MetaDataModel mm = assistant.getMergedModel();
- if (mm.getRoot() == null)
- mm.setRoot(assistant.getSourceModelProvider().getSourceModel());
-
- else {
- //for each entity and trait call "add". assistant will handle merge.
- Model mk = (Model)assistant.getSourceModelProvider().getSourceModel();
- if (mk != null)//possible that model was not loaded
- traverseAndAdd(assistant, mk);
- }
- }
-
- /**
- * Add entity and any children
- * @param assistant
- * @param entity
- */
- protected void traverseAndAdd(IMetaDataModelMergeAssistant assistant, final Entity entity){
- assistant.addEntity(entity);
-
- if (entity instanceof Model){
- Model model = (Model)entity;
- for (final Iterator/*EntityGroup*/ it=model.getEntityGroups().iterator();it.hasNext();){
- assistant.addEntityGroup((EntityGroup)it.next());
- }
- }
-
- for (final Iterator/*<Trait>*/ it=entity.getTraits().iterator();it.hasNext();){
- Trait trait = (Trait)it.next();
- assistant.addTrait(entity, trait);
- }
-
- for (final Iterator/*<EntityKey>*/ it=entity.getChildEntities().iterator();it.hasNext();){
- Entity e = (Entity)it.next();
- traverseAndAdd(assistant, e);
- }
-
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardMetaDataLocator.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardMetaDataLocator.java
deleted file mode 100644
index fd3e3ea4a..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardMetaDataLocator.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import java.util.List;
-
-
-/**
- * Implementation of IMetaDataLocator for standard metadata sources.
- * Uses StandardMetaDataFileRegistry to locate instances.
- *
- */
-public class StandardMetaDataLocator extends AbstractMetaDataLocator {
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.internal.IMetaDataLocator#locateMetaDataModelProviders(java.lang.String)
- */
- public List locateMetaDataModelProviders(String uri) {
- return StandardMetaDataFileRegistry.getInstance().getStandardMetaDataModelProviders(uri);
- }
-
- /*
- * Does nothing.
- */
- public void startLocating() {
- //do nothing
- }
-
- /*
- * Does nothing.
- */
- public void stopLocating() {
- //do nothing
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardMetaDataSourceFileLocator.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardMetaDataSourceFileLocator.java
deleted file mode 100644
index 418b240b1..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardMetaDataSourceFileLocator.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-
-/**
- * Used to supply an InputStream to the parser of an annotation
- * meta-data file and the URL to the resource bundle for a properties file, if any.
- *
- * Implementors must provide a zero-argument constructor.
- *
- */
-public abstract class StandardMetaDataSourceFileLocator {
- /**
- * metadata file to locate
- */
- protected IStandardMetaDataSourceInfo fileInfo;
-
- /**
- * Set the <code>IStandardMetaDataSourceInfo</code> for this locator
- * @param fileInfo
- */
- public final void setFileInfo(IStandardMetaDataSourceInfo fileInfo){
- this.fileInfo = fileInfo;
- }
-
- /**
- * @return the <code>IStandardMetaDataSourceInfo</code> for this locator
- */
- protected final IStandardMetaDataSourceInfo getFileInfo(){
- return fileInfo;
- }
- /**
- * Return InputStream to the meta-data source file.
- * Callers are responsble for closing the stream.
- * @return InputStream
- * @throws IOException
- */
- public abstract InputStream getInputStream() throws IOException;
-
- /**
- * Return ResourceBundle for the property files if there are any. Return null if not.
- *
- * @return java.util.ResourceBundle
- * @throws IOException
- * @throws MissingResourceException
- */
- public abstract ResourceBundle getResourceBundle() throws IOException, MissingResourceException;
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardModelFactory.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardModelFactory.java
deleted file mode 100644
index 53b99a136..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/StandardModelFactory.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Map;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.emf.ecore.util.BasicExtendedMetaData;
-import org.eclipse.emf.ecore.util.ExtendedMetaData;
-import org.eclipse.emf.ecore.xmi.XMLResource;
-import org.eclipse.emf.ecore.xmi.impl.XMLResourceFactoryImpl;
-import org.eclipse.jst.jsf.common.metadata.internal.util.MetadataResourceImpl;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-
-/**
- * Singelton that produces and loads standard metadata models.
- * All models are loaded into the same ResourceSet
- *
- * see Model
- */
-public class StandardModelFactory {
- private static StandardModelFactory INSTANCE;
- private ExtendedMetaData extendedMetaData;
- private ResourceSet resourceSet;
-
-
- /**
- * @return singleton instance of the metadata model factory
- */
- public synchronized static StandardModelFactory getInstance(){
- if (INSTANCE == null){
- INSTANCE = new StandardModelFactory();
- INSTANCE.init();
- }
- return INSTANCE;
- }
-
- private void init() {
- resourceSet = new ResourceSetImpl();
-
- extendedMetaData = new BasicExtendedMetaData(resourceSet.getPackageRegistry());
-
- // Register the appropriate resource factory to handle all file extentions.
- //
- resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put
- (Resource.Factory.Registry.DEFAULT_EXTENSION,
- new XMLResourceFactoryImpl());
-
- //relying on the org.eclipse.emf.ecore.generated_package ext-pt to register traits
- }
-
-// private void registerTraitTypes(Registry packageRegistry) {
-// for(Iterator/*<EPackage>*/ it=TraitTypeRegistry.getInstance().getEPackages().iterator();it.hasNext();){
-// EPackage pkg = (EPackage)it.next();
-// packageRegistry.put(pkg.getNsURI(), pkg);
-// }
-// }
-
- private StandardModelFactory() {
- super();
- }
-
- /**
- * Factory method that probably belongs somewhere else!
- * @param key
- * @param strategy
- * @return an empty MetaDataModel
- */
- public MetaDataModel createModel(ModelKeyDescriptor key, IDomainLoadingStrategy strategy){
- return new MetaDataModel(key, strategy);
- }
-
- /**
- * Factory method that probably belongs somewhere else!
- * @param modelContext
- * @return a ModelKeyDescriptor for the context
- */
- public ModelKeyDescriptor createModelKeyDescriptor(final ITaglibDomainMetaDataModelContext modelContext) {
- return new ModelKeyDescriptor(modelContext.getProject(), modelContext.getDomainID(), modelContext.getURI());
- }
-
- /**
- * @param inputStream
- * @param provider
- * @return the root of the standard model from the resource as an EList
- * @throws IOException
- */
- public EList loadStandardFileResource(InputStream inputStream, IMetaDataSourceModelProvider provider) throws IOException {
- XMLResource res = new MetadataResourceImpl(provider);
- resourceSet.getResources().add(res);
- setLoadOptions(res);
- res.load(inputStream, null);
- EList root = res.getContents();
- return root;
- }
-
- /**
- * Sets default load options for the resource
- * @param resource
- */
- protected void setLoadOptions(XMLResource resource) {
- Map options = resource.getDefaultLoadOptions();
-// options.put(XMLResource.OPTION_SAVE_TYPE_INFORMATION, true);
- options.put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE);
- options.put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);
- options.put(XMLResource.OPTION_RESOURCE_HANDLER, resource);
- options.put(XMLResource.OPTION_LAX_FEATURE_PROCESSING, Boolean.TRUE);
- options.put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);
-// options.put(XMLResource.OPTION_DOM_USE_NAMESPACES_IN_SCOPE, Boolean.TRUE);
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/TaglibDomainMetaDataModelContextImpl.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/TaglibDomainMetaDataModelContextImpl.java
deleted file mode 100644
index 8f3813a53..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/TaglibDomainMetaDataModelContextImpl.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext;
-
-/**
- * Simple implementation of {@link ITaglibDomainMetaDataModelContext}
- */
-public class TaglibDomainMetaDataModelContextImpl extends MetaDataModelContextImpl implements ITaglibDomainMetaDataModelContext, Cloneable{
- private IProject _project;
- private String _uri;
-
- /**
- * Constructor
- * @param project
- * @param domain
- * @param uri
- */
- public TaglibDomainMetaDataModelContextImpl(String domain, IProject project, String uri){
- super(domain);
- this._project = project;
- this._uri = uri;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext#getProject()
- */
- public IProject getProject() {
- return _project;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.query.ITaglibDomainMetaDataModelContext#getURI()
- */
- public String getURI() {
- return _uri;
- }
-
- public Object getAdapter(Class adapter) {
- if (adapter.equals(ITaglibDomainMetaDataModelContext.class))
- return this;
-
- return super.getAdapter(adapter);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/TraitValueHelper.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/TraitValueHelper.java
deleted file mode 100644
index d45da0f83..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/TraitValueHelper.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.BasicEObjectImpl;
-import org.eclipse.emf.ecore.util.FeatureMap;
-import org.eclipse.emf.ecore.xml.type.AnyType;
-import org.eclipse.emf.ecore.xml.type.SimpleAnyType;
-import org.eclipse.jst.jsf.common.JSFCommonPlugin;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.ListOfValues;
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Experimental/prototype class to assist with decoding trait values.
- * This could/should be made API at some point after "hardening". (https://bugs.eclipse.org/bugs/show_bug.cgi?id=192052)
- */
-public class TraitValueHelper {
- private static final String KEY_NOT_FOUND = Messages.Key_not_found;
- /**
- * @param trait
- * @return EClass of trait value
- */
- public static EClass getValueType(Trait trait){
- if (trait == null)
- return null;
- if (trait.getValue() != null)
- return trait.getValue().eClass();
- return null;
- }
-
- /**
- * @param trait
- * @return value of trait as String Object.
- */
- public static Object getValue(Trait trait){
- if (trait == null)
- return null;
- if (trait.getValue() == null)
- return null;
-
- if (trait.getValue() instanceof SimpleAnyType){
- return ((SimpleAnyType)trait.getValue()).getRawValue();
- }
- else if (trait.getValue() instanceof AnyType){
- AnyType any = (AnyType)trait.getValue();
- FeatureMap map = any.getMixed();
- return getTextValueFromFeatureMap(map);
- }
- else if ( trait.getValue().eIsProxy() && trait.getValue() instanceof BasicEObjectImpl){
- BasicEObjectImpl o = (BasicEObjectImpl)trait.getValue();
- return o.eProxyURI().toString();
- }
- return trait.getValue();
- }
-
- private static String getTextValueFromFeatureMap(FeatureMap map) {
- for (Iterator it=map.iterator();it.hasNext();){
- FeatureMap.Entry entry = (FeatureMap.Entry)it.next();
- if (entry.getEStructuralFeature().getName().equals("text"))
- return (String)entry.getValue();
- }
- return null;
- }
-
- /**
- * @param trait
- * @return value of trait as String. If externalized, will resolve from resource bundle.
- */
- public static String getValueAsString(Trait trait){
- Object val = getValue(trait);
- if (val != null && val instanceof String){
- String result = getNLSValue(trait, (String)val);
- return result;
- }
- return null;
- }
-
- /**
- *
- * @param trait whose value a {@link ListOfValues} or is a single string
- * @return List of Strings. If externalized, will resolve from resource bundle
- * using getNLSValue(Trait trait, String rawValue)
- */
- public synchronized static List getValueAsListOfStrings(Trait trait){
- //PROTO ONLY!!! Need to make WAY more robust!
- List ret = new ArrayList();
- if (trait.getValue() instanceof ListOfValues) {
- for(Iterator it=trait.getValue().eContents().iterator();it.hasNext();){
- Object o = it.next();
- if (o instanceof SimpleAnyType){
- SimpleAnyType sat = (SimpleAnyType)o;
- String rawValue = getTextValueFromFeatureMap(sat.getMixed());
- String nlsValue = getNLSValue(trait, rawValue);
-
- ret.add(nlsValue);
- }
- }
- }
- else {
- //may be single value
- String o = getValueAsString(trait);
- if (o != null)
- ret.add(o);
- }
- return ret;
- }
-
- /**
- * Looks for '%' (and not '%%') at beginning of rawValue. If found, looks to the
- * traits sourceModelProvider for resource bundle to resolve the key after
- * stripping the '%' sign.
- * @param trait
- * @param rawValue of string in from metadata
- * @return the NLS Value or rawValue if it cannot be located
- */
- public static String getNLSValue(Trait trait, String rawValue) {
- String result = rawValue;
- if (rawValue.startsWith("%") && !rawValue.startsWith("%%")){
- String key = rawValue.substring(1);
- result = getNLSPropertyValue(trait, key);
- if (rawValue == null){
- result = rawValue;
- }
- }
- return result == null ? null : result.trim();
- }
-
- //will return null if there is an IOException with ResourceBundle
- private static String getNLSPropertyValue(Trait trait, String key){
- try{
- IMetaDataSourceModelProvider provider = trait.getSourceModelProvider();
- IResourceBundleProvider resourceBundleProvider = (IResourceBundleProvider)provider.getAdapter(IResourceBundleProvider.class);
- if (resourceBundleProvider != null){
- ResourceBundle resourceBundle_ = resourceBundleProvider.getResourceBundle();
- if (resourceBundle_ != null){
- String replVal = resourceBundle_.getString(key);
- return replVal;
- }
- }
- //return original string
- return key;
-
- } catch (MissingResourceException e){
- //fall thru
- JSFCommonPlugin.log(e, NLS.bind(Messages.MissingResource_exception, new String[]{key}));
- }
- return key + KEY_NOT_FOUND;
- }
-
- /**
- * Will take get the value as a String and attempt to coerce to boolean.
- * Will return 'false' if coercion fails, or value was null.
- * @param trait
- * @return true or false
- */
- public static boolean getValueAsBoolean(Trait trait) {
- String val = getValueAsString(trait);
- if (val == null)
- return false;
-
- return Boolean.valueOf(val).booleanValue();
- }
-
-// /**
-// * @param trait
-// * @return name of class or primitive datatype that the value is defined as.
-// * For SimpleAnyTypes, the getInstanceType().getInstanceClassName() is returned.
-// * For AnyType, java.lang.String is always returned.
-// * For all others, the class.getName() is returned.
-// */
-// public static String getValueInstanceClassName(Trait trait) {String.class.getName();
-// if (trait.getValue() instanceof SimpleAnyType) {
-// return ((SimpleAnyType)trait.getValue()).getInstanceType().getInstanceClassName();
-// }
-// else if (trait.getValue() instanceof AnyType) {
-// return String.class.getName();
-// }
-// else {
-// return trait.getValue().getClass().getName();
-// }
-//
-// }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/EntityGroupImpl.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/EntityGroupImpl.java
deleted file mode 100644
index 9343b62de..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/EntityGroupImpl.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: EntityGroupImpl.java,v 1.4 2007/05/11 17:54:55 gkessler Exp $
- */
-package org.eclipse.jst.jsf.common.metadata.internal.impl;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.jst.jsf.common.metadata.EntityGroup;
-import org.eclipse.jst.jsf.common.metadata.MetadataPackage;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Entity Group</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * </p>
- *
- * @generated
- */
-public class EntityGroupImpl extends EntityImpl implements EntityGroup {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("hiding")
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EntityGroupImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return MetadataPackage.Literals.ENTITY_GROUP;
- }
-
-} //EntityGroupImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/EntityImpl.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/EntityImpl.java
deleted file mode 100644
index 22cd9706d..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/EntityImpl.java
+++ /dev/null
@@ -1,415 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: EntityImpl.java,v 1.6 2007/06/11 20:55:58 gkessler Exp $
- */
-package org.eclipse.jst.jsf.common.metadata.internal.impl;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.EObjectResolvingEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.IncludeEntityGroup;
-import org.eclipse.jst.jsf.common.metadata.MetadataPackage;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.query.IEntityVisitor;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Entity</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.internal.impl.EntityImpl#getChildEntities <em>Child Entities</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.internal.impl.EntityImpl#getTraits <em>Traits</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.internal.impl.EntityImpl#getId <em>Id</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.internal.impl.EntityImpl#getType <em>Type</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.internal.impl.EntityImpl#getIncludeGroups <em>Include Groups</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class EntityImpl extends EObjectImpl implements Entity {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The cached value of the '{@link #getChildEntities() <em>Child Entities</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getChildEntities()
- * @generated
- * @ordered
- */
- protected EList childEntities = null;
-
- /**
- * The cached value of the '{@link #getTraits() <em>Traits</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTraits()
- * @generated
- * @ordered
- */
- protected EList traits = null;
-
- /**
- * The default value of the '{@link #getId() <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getId()
- * @generated
- * @ordered
- */
- protected static final String ID_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getId() <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getId()
- * @generated
- * @ordered
- */
- protected String id = ID_EDEFAULT;
-
- /**
- * The default value of the '{@link #getType() <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getType()
- * @generated
- * @ordered
- */
- protected static final String TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getType()
- * @generated
- * @ordered
- */
- protected String type = TYPE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getIncludeGroups() <em>Include Groups</em>}' reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIncludeGroups()
- * @generated
- * @ordered
- */
- protected EList includeGroups = null;
-
- /**
- * The cached value of the Model
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- private Model _model;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EntityImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return MetadataPackage.Literals.ENTITY;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EList getChildEntities() {
- if (childEntities == null) {
- childEntities = new EObjectContainmentEList(Entity.class, this, MetadataPackage.ENTITY__CHILD_ENTITIES);
- }
- return childEntities;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EList getTraits() {
- if (traits == null) {
- traits = new EObjectContainmentEList(Trait.class, this, MetadataPackage.ENTITY__TRAITS);
- }
- return traits;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EList getIncludeGroups() {
- if (includeGroups == null) {
- includeGroups = new EObjectResolvingEList(IncludeEntityGroup.class, this, MetadataPackage.ENTITY__INCLUDE_GROUPS);
- }
- return includeGroups;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getId() {
- return id;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setId(String newId) {
- String oldId = id;
- id = newId;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, MetadataPackage.ENTITY__ID, oldId, id));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getType() {
- return type;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setType(String newType) {
- String oldType = type;
- type = newType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, MetadataPackage.ENTITY__TYPE, oldType, type));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public void accept(IEntityVisitor visitor) {
- if (visitor.stopVisiting())
- return;
- visitor.visit(this);
-
- if (!getChildEntities().isEmpty()){
- for (Iterator/*<Entity>*/ it = getChildEntities().iterator(); it.hasNext();){
- Entity k = (Entity)it.next();
- k.accept(visitor);
- if (visitor.stopVisiting())
- return;
- }
- }
-// if (!getIncludeGroups().isEmpty()){
-// for (Iterator/*<IncludeEntityGroup>*/ it = getIncludeGroups().iterator(); it.hasNext();){
-// IncludeEntityGroup entityGroup = (IncludeEntityGroup)it.next();
-// Model m = getModel(entityGroup);
-// if (m != null){
-// Entity k = m.findIncludeGroup(entityGroup.getId());
-// if (k != null){
-// k.accept(visitor);
-// if (visitor.stopVisiting())
-// return;
-// }
-// }
-// }
-// }
- visitor.visitCompleted(this);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public Model getModel() {
- if (_model == null){
- EObject parent = this.eContainer();
- while (true){
- if (parent instanceof Model){
- _model = (Model)parent;
- break;
- }
- if (parent != null)
- parent = parent.eContainer();
- else
- break;
- }
- }
- return _model;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case MetadataPackage.ENTITY__CHILD_ENTITIES:
- return ((InternalEList)getChildEntities()).basicRemove(otherEnd, msgs);
- case MetadataPackage.ENTITY__TRAITS:
- return ((InternalEList)getTraits()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case MetadataPackage.ENTITY__CHILD_ENTITIES:
- return getChildEntities();
- case MetadataPackage.ENTITY__TRAITS:
- return getTraits();
- case MetadataPackage.ENTITY__ID:
- return getId();
- case MetadataPackage.ENTITY__TYPE:
- return getType();
- case MetadataPackage.ENTITY__INCLUDE_GROUPS:
- return getIncludeGroups();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case MetadataPackage.ENTITY__CHILD_ENTITIES:
- getChildEntities().clear();
- getChildEntities().addAll((Collection)newValue);
- return;
- case MetadataPackage.ENTITY__TRAITS:
- getTraits().clear();
- getTraits().addAll((Collection)newValue);
- return;
- case MetadataPackage.ENTITY__ID:
- setId((String)newValue);
- return;
- case MetadataPackage.ENTITY__TYPE:
- setType((String)newValue);
- return;
- case MetadataPackage.ENTITY__INCLUDE_GROUPS:
- getIncludeGroups().clear();
- getIncludeGroups().addAll((Collection)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case MetadataPackage.ENTITY__CHILD_ENTITIES:
- getChildEntities().clear();
- return;
- case MetadataPackage.ENTITY__TRAITS:
- getTraits().clear();
- return;
- case MetadataPackage.ENTITY__ID:
- setId(ID_EDEFAULT);
- return;
- case MetadataPackage.ENTITY__TYPE:
- setType(TYPE_EDEFAULT);
- return;
- case MetadataPackage.ENTITY__INCLUDE_GROUPS:
- getIncludeGroups().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case MetadataPackage.ENTITY__CHILD_ENTITIES:
- return childEntities != null && !childEntities.isEmpty();
- case MetadataPackage.ENTITY__TRAITS:
- return traits != null && !traits.isEmpty();
- case MetadataPackage.ENTITY__ID:
- return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
- case MetadataPackage.ENTITY__TYPE:
- return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type);
- case MetadataPackage.ENTITY__INCLUDE_GROUPS:
- return includeGroups != null && !includeGroups.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (id: ");
- result.append(id);
- result.append(", type: ");
- result.append(type);
- result.append(')');
- return result.toString();
- }
-
-} //EntityImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/IncludeEntityGroupImpl.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/IncludeEntityGroupImpl.java
deleted file mode 100644
index 0f8cee869..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/IncludeEntityGroupImpl.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: IncludeEntityGroupImpl.java,v 1.2 2007/04/16 19:54:10 itrimble Exp $
- */
-package org.eclipse.jst.jsf.common.metadata.internal.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.jst.jsf.common.metadata.IncludeEntityGroup;
-import org.eclipse.jst.jsf.common.metadata.MetadataPackage;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Include Entity Group</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.internal.impl.IncludeEntityGroupImpl#getId <em>Id</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.internal.impl.IncludeEntityGroupImpl#getModelUri <em>Model Uri</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class IncludeEntityGroupImpl extends EObjectImpl implements IncludeEntityGroup {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The default value of the '{@link #getId() <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getId()
- * @generated
- * @ordered
- */
- protected static final String ID_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getId() <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getId()
- * @generated
- * @ordered
- */
- protected String id = ID_EDEFAULT;
-
- /**
- * The default value of the '{@link #getModelUri() <em>Model Uri</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getModelUri()
- * @generated
- * @ordered
- */
- protected static final String MODEL_URI_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getModelUri() <em>Model Uri</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getModelUri()
- * @generated
- * @ordered
- */
- protected String modelUri = MODEL_URI_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected IncludeEntityGroupImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return MetadataPackage.Literals.INCLUDE_ENTITY_GROUP;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getId() {
- return id;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setId(String newId) {
- String oldId = id;
- id = newId;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, MetadataPackage.INCLUDE_ENTITY_GROUP__ID, oldId, id));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getModelUri() {
- return modelUri;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setModelUri(String newModelUri) {
- String oldModelUri = modelUri;
- modelUri = newModelUri;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, MetadataPackage.INCLUDE_ENTITY_GROUP__MODEL_URI, oldModelUri, modelUri));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case MetadataPackage.INCLUDE_ENTITY_GROUP__ID:
- return getId();
- case MetadataPackage.INCLUDE_ENTITY_GROUP__MODEL_URI:
- return getModelUri();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case MetadataPackage.INCLUDE_ENTITY_GROUP__ID:
- setId((String)newValue);
- return;
- case MetadataPackage.INCLUDE_ENTITY_GROUP__MODEL_URI:
- setModelUri((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case MetadataPackage.INCLUDE_ENTITY_GROUP__ID:
- setId(ID_EDEFAULT);
- return;
- case MetadataPackage.INCLUDE_ENTITY_GROUP__MODEL_URI:
- setModelUri(MODEL_URI_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case MetadataPackage.INCLUDE_ENTITY_GROUP__ID:
- return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
- case MetadataPackage.INCLUDE_ENTITY_GROUP__MODEL_URI:
- return MODEL_URI_EDEFAULT == null ? modelUri != null : !MODEL_URI_EDEFAULT.equals(modelUri);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (id: ");
- result.append(id);
- result.append(", modelUri: ");
- result.append(modelUri);
- result.append(')');
- return result.toString();
- }
-
-} //IncludeEntityGroupImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/MetadataFactoryImpl.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/MetadataFactoryImpl.java
deleted file mode 100644
index ca0430741..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/MetadataFactoryImpl.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: MetadataFactoryImpl.java,v 1.4 2007/05/11 17:54:55 gkessler Exp $
- */
-package org.eclipse.jst.jsf.common.metadata.internal.impl;
-
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.EntityGroup;
-import org.eclipse.jst.jsf.common.metadata.IncludeEntityGroup;
-import org.eclipse.jst.jsf.common.metadata.MetadataFactory;
-import org.eclipse.jst.jsf.common.metadata.MetadataPackage;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider;
-import org.eclipse.jst.jsf.common.metadata.internal.ModelKeyDescriptor;
-
-
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model <b>Factory</b>.
- * <!-- end-user-doc -->
- * @generated
- */
-public class MetadataFactoryImpl extends EFactoryImpl implements MetadataFactory {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return MetadataFactory
- * @generated
- */
- public static MetadataFactory init() {
- try {
- MetadataFactory theMetadataFactory = (MetadataFactory)EPackage.Registry.INSTANCE.getEFactory("http://org.eclipse.jst.jsf.common.metadata/metadata.ecore");
- if (theMetadataFactory != null) {
- return theMetadataFactory;
- }
- }
- catch (Exception exception) {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new MetadataFactoryImpl();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public MetadataFactoryImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EObject create(EClass eClass) {
- switch (eClass.getClassifierID()) {
- case MetadataPackage.MODEL: return createModel();
- case MetadataPackage.ENTITY_GROUP: return createEntityGroup();
- case MetadataPackage.ENTITY: return createEntity();
- case MetadataPackage.TRAIT: return createTrait();
- case MetadataPackage.INCLUDE_ENTITY_GROUP: return createIncludeEntityGroup();
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object createFromString(EDataType eDataType, String initialValue) {
- switch (eDataType.getClassifierID()) {
- case MetadataPackage.IMETA_DATA_SOURCE_MODEL_PROVIDER:
- return createIMetaDataSourceModelProviderFromString(eDataType, initialValue);
- case MetadataPackage.MODEL_CONTEXT:
- return createModelContextFromString(eDataType, initialValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertToString(EDataType eDataType, Object instanceValue) {
- switch (eDataType.getClassifierID()) {
- case MetadataPackage.IMETA_DATA_SOURCE_MODEL_PROVIDER:
- return convertIMetaDataSourceModelProviderToString(eDataType, instanceValue);
- case MetadataPackage.MODEL_CONTEXT:
- return convertModelContextToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Trait createTrait() {
- TraitImpl trait = new TraitImpl();
- return trait;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public IncludeEntityGroup createIncludeEntityGroup() {
- IncludeEntityGroupImpl includeEntityGroup = new IncludeEntityGroupImpl();
- return includeEntityGroup;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Model createModel() {
- ModelImpl model = new ModelImpl();
- return model;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Entity createEntity() {
- EntityImpl entity = new EntityImpl();
- return entity;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EntityGroup createEntityGroup() {
- EntityGroupImpl entityGroup = new EntityGroupImpl();
- return entityGroup;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param eDataType IMetaDataSourceModelProvider
- * @param initialValue
- * @return IMetaDataSourceModelProvider
- * @generated
- */
- public IMetaDataSourceModelProvider createIMetaDataSourceModelProviderFromString(EDataType eDataType, String initialValue) {
- return (IMetaDataSourceModelProvider)super.createFromString(eDataType, initialValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param eDataType
- * @param instanceValue
- * @return String
- * @generated
- */
- public String convertIMetaDataSourceModelProviderToString(EDataType eDataType, Object instanceValue) {
- return super.convertToString(eDataType, instanceValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param eDataType
- * @param initialValue
- * @return ModelKeyDescriptor
- * @generated
- */
- public ModelKeyDescriptor createModelContextFromString(EDataType eDataType, String initialValue) {
- return (ModelKeyDescriptor)super.createFromString(eDataType, initialValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param eDataType
- * @param instanceValue
- * @return String
- * @generated
- */
- public String convertModelContextToString(EDataType eDataType, Object instanceValue) {
- return super.convertToString(eDataType, instanceValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public MetadataPackage getMetadataPackage() {
- return (MetadataPackage)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return MetadataPackage
- * @deprecated
- * @generated
- */
- public static MetadataPackage getPackage() {
- return MetadataPackage.eINSTANCE;
- }
-
-} //MetadataFactoryImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/MetadataPackageImpl.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/MetadataPackageImpl.java
deleted file mode 100644
index 7f9d582c9..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/MetadataPackageImpl.java
+++ /dev/null
@@ -1,604 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: MetadataPackageImpl.java,v 1.6 2007/05/11 17:54:55 gkessler Exp $
- */
-package org.eclipse.jst.jsf.common.metadata.internal.impl;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EOperation;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.EntityGroup;
-import org.eclipse.jst.jsf.common.metadata.IncludeEntityGroup;
-import org.eclipse.jst.jsf.common.metadata.MetadataFactory;
-import org.eclipse.jst.jsf.common.metadata.MetadataPackage;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider;
-import org.eclipse.jst.jsf.common.metadata.internal.ModelKeyDescriptor;
-import org.eclipse.jst.jsf.common.metadata.query.IEntityVisitor;
-import org.eclipse.jst.jsf.common.metadata.query.ITraitVisitor;
-
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model <b>Package</b>.
- * <!-- end-user-doc -->
- * @generated
- */
-public class MetadataPackageImpl extends EPackageImpl implements MetadataPackage {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass traitEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass includeEntityGroupEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass modelEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass entityEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass entityGroupEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EDataType iTraitVisitorEDataType = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EDataType iEntityVisitorEDataType = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EDataType iMetaDataSourceModelProviderEDataType = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EDataType modelContextEDataType = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.jst.jsf.common.metadata.MetadataPackage#eNS_URI
- * @see #init()
- * @generated
- */
- private MetadataPackageImpl() {
- super(eNS_URI, MetadataFactory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this
- * model, and for any others upon which it depends. Simple
- * dependencies are satisfied by calling this method on all
- * dependent packages before doing anything else. This method drives
- * initialization for interdependent packages directly, in parallel
- * with this package, itself.
- * <p>Of this package and its interdependencies, all packages which
- * have not yet been registered by their URI values are first created
- * and registered. The packages are then initialized in two steps:
- * meta-model objects for all of the packages are created before any
- * are initialized, since one package's meta-model objects may refer to
- * those of another.
- * <p>Invocation of this method will not affect any packages that have
- * already been initialized.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return MetadataPackage
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static MetadataPackage init() {
- if (isInited) return (MetadataPackage)EPackage.Registry.INSTANCE.getEPackage(MetadataPackage.eNS_URI);
-
- // Obtain or create and register package
- MetadataPackageImpl theMetadataPackage = (MetadataPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof MetadataPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new MetadataPackageImpl());
-
- isInited = true;
-
- // Create package meta-data objects
- theMetadataPackage.createPackageContents();
-
- // Initialize created meta-data
- theMetadataPackage.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theMetadataPackage.freeze();
-
- return theMetadataPackage;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getTrait() {
- return traitEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getTrait_Value() {
- return (EReference)traitEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getTrait_SourceModelProvider() {
- return (EAttribute)traitEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getIncludeEntityGroup() {
- return includeEntityGroupEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getIncludeEntityGroup_Id() {
- return (EAttribute)includeEntityGroupEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getIncludeEntityGroup_ModelUri() {
- return (EAttribute)includeEntityGroupEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getTrait_Id() {
- return (EAttribute)traitEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getModel() {
- return modelEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getModel_SourceModelProvider() {
- return (EAttribute)modelEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getModel_CurrentModelContext() {
- return (EAttribute)modelEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getModel_EntityGroups() {
- return (EReference)modelEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getEntity() {
- return entityEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getEntity_ChildEntities() {
- return (EReference)entityEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getEntity_Traits() {
- return (EReference)entityEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getEntity_Id() {
- return (EAttribute)entityEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getEntity_Type() {
- return (EAttribute)entityEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getEntity_IncludeGroups() {
- return (EReference)entityEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getEntityGroup() {
- return entityGroupEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EDataType getITraitVisitor() {
- return iTraitVisitorEDataType;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EDataType getIEntityVisitor() {
- return iEntityVisitorEDataType;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EDataType getIMetaDataSourceModelProvider() {
- return iMetaDataSourceModelProviderEDataType;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EDataType getModelContext() {
- return modelContextEDataType;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public MetadataFactory getMetadataFactory() {
- return (MetadataFactory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents() {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- modelEClass = createEClass(MODEL);
- createEReference(modelEClass, MODEL__ENTITY_GROUPS);
- createEAttribute(modelEClass, MODEL__SOURCE_MODEL_PROVIDER);
- createEAttribute(modelEClass, MODEL__CURRENT_MODEL_CONTEXT);
-
- entityGroupEClass = createEClass(ENTITY_GROUP);
-
- entityEClass = createEClass(ENTITY);
- createEReference(entityEClass, ENTITY__CHILD_ENTITIES);
- createEReference(entityEClass, ENTITY__TRAITS);
- createEAttribute(entityEClass, ENTITY__ID);
- createEAttribute(entityEClass, ENTITY__TYPE);
- createEReference(entityEClass, ENTITY__INCLUDE_GROUPS);
-
- traitEClass = createEClass(TRAIT);
- createEAttribute(traitEClass, TRAIT__ID);
- createEReference(traitEClass, TRAIT__VALUE);
- createEAttribute(traitEClass, TRAIT__SOURCE_MODEL_PROVIDER);
-
- includeEntityGroupEClass = createEClass(INCLUDE_ENTITY_GROUP);
- createEAttribute(includeEntityGroupEClass, INCLUDE_ENTITY_GROUP__ID);
- createEAttribute(includeEntityGroupEClass, INCLUDE_ENTITY_GROUP__MODEL_URI);
-
- // Create data types
- iTraitVisitorEDataType = createEDataType(ITRAIT_VISITOR);
- iEntityVisitorEDataType = createEDataType(IENTITY_VISITOR);
- iMetaDataSourceModelProviderEDataType = createEDataType(IMETA_DATA_SOURCE_MODEL_PROVIDER);
- modelContextEDataType = createEDataType(MODEL_CONTEXT);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents() {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Add supertypes to classes
- modelEClass.getESuperTypes().add(this.getEntity());
- entityGroupEClass.getESuperTypes().add(this.getEntity());
-
- // Initialize classes and features; add operations and parameters
- initEClass(modelEClass, Model.class, "Model", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getModel_EntityGroups(), this.getEntityGroup(), null, "entityGroups", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getModel_SourceModelProvider(), this.getIMetaDataSourceModelProvider(), "sourceModelProvider", null, 0, 1, Model.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getModel_CurrentModelContext(), this.getModelContext(), "currentModelContext", null, 0, 1, Model.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- EOperation op = addEOperation(modelEClass, this.getEntityGroup(), "findIncludeGroup", 0, 1);
- addEParameter(op, ecorePackage.getEString(), "groupId", 0, 1);
-
- op = addEOperation(modelEClass, null, "accept");
- addEParameter(op, this.getIEntityVisitor(), "visitor", 0, 1);
-
- initEClass(entityGroupEClass, EntityGroup.class, "EntityGroup", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(entityEClass, Entity.class, "Entity", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getEntity_ChildEntities(), this.getEntity(), null, "childEntities", null, 0, -1, Entity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- getEntity_ChildEntities().getEKeys().add(this.getEntity_Id());
- getEntity_ChildEntities().getEKeys().add(this.getEntity_Type());
- initEReference(getEntity_Traits(), this.getTrait(), null, "traits", null, 0, -1, Entity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- getEntity_Traits().getEKeys().add(this.getTrait_Id());
- initEAttribute(getEntity_Id(), ecorePackage.getEString(), "id", null, 1, 1, Entity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getEntity_Type(), ecorePackage.getEString(), "type", null, 0, 1, Entity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getEntity_IncludeGroups(), this.getIncludeEntityGroup(), null, "includeGroups", null, 0, -1, Entity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- op = addEOperation(entityEClass, null, "accept");
- addEParameter(op, this.getIEntityVisitor(), "visitor", 0, 1);
-
- op = addEOperation(entityEClass, this.getModel(), "getModel", 0, 1);
-
- initEClass(traitEClass, Trait.class, "Trait", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getTrait_Id(), ecorePackage.getEString(), "id", null, 1, 1, Trait.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getTrait_Value(), ecorePackage.getEObject(), null, "value", null, 1, 1, Trait.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getTrait_SourceModelProvider(), this.getIMetaDataSourceModelProvider(), "sourceModelProvider", null, 0, 1, Trait.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- op = addEOperation(traitEClass, null, "accept");
- addEParameter(op, this.getITraitVisitor(), "visitor", 0, 1);
-
- initEClass(includeEntityGroupEClass, IncludeEntityGroup.class, "IncludeEntityGroup", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getIncludeEntityGroup_Id(), ecorePackage.getEString(), "id", null, 1, 1, IncludeEntityGroup.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getIncludeEntityGroup_ModelUri(), ecorePackage.getEString(), "modelUri", null, 0, 1, IncludeEntityGroup.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Initialize data types
- initEDataType(iTraitVisitorEDataType, ITraitVisitor.class, "ITraitVisitor", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
- initEDataType(iEntityVisitorEDataType, IEntityVisitor.class, "IEntityVisitor", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
- initEDataType(iMetaDataSourceModelProviderEDataType, IMetaDataSourceModelProvider.class, "IMetaDataSourceModelProvider", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
- initEDataType(modelContextEDataType, ModelKeyDescriptor.class, "ModelContext", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
-
- // Create resource
- createResource(eNS_URI);
-
- // Create annotations
- // http:///org/eclipse/emf/ecore/util/ExtendedMetaData
- createExtendedMetaDataAnnotations();
- // http://www.eclipse.org/emf/2002/GenModel
- createGenModelAnnotations();
- }
-
- /**
- * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void createExtendedMetaDataAnnotations() {
- String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData";
- addAnnotation
- (modelEClass,
- source,
- new String[] {
- "kind", "element",
- "name", "metadatamodel"
- });
- addAnnotation
- (getModel_EntityGroups(),
- source,
- new String[] {
- "kind", "element",
- "name", "entityGroup"
- });
- addAnnotation
- (entityEClass,
- source,
- new String[] {
- "kind", "element",
- "name", "entity"
- });
- addAnnotation
- (getEntity_ChildEntities(),
- source,
- new String[] {
- "kind", "element",
- "name", "entity"
- });
- addAnnotation
- (getEntity_Traits(),
- source,
- new String[] {
- "kind", "element",
- "name", "trait"
- });
- addAnnotation
- (getEntity_IncludeGroups(),
- source,
- new String[] {
- "kind", "element",
- "name", "include-entity-group"
- });
- addAnnotation
- (getIncludeEntityGroup_ModelUri(),
- source,
- new String[] {
- "name", "uri"
- });
- addAnnotation
- (traitEClass,
- source,
- new String[] {
- "kind", "element",
- "name", "trait"
- });
- addAnnotation
- (getTrait_Value(),
- source,
- new String[] {
- "kind", "element",
- "namespace", "##targetNamespace"
- });
- }
-
- /**
- * Initializes the annotations for <b>http://www.eclipse.org/emf/2002/GenModel</b>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("cast")
- protected void createGenModelAnnotations() {
- String source = "http://www.eclipse.org/emf/2002/GenModel";
- addAnnotation
- ((EOperation)traitEClass.getEOperations().get(0),
- source,
- new String[] {
- "body", "visitor.visit(this);"
- });
- }
-
-} //MetadataPackageImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/ModelImpl.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/ModelImpl.java
deleted file mode 100644
index 764e9a247..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/ModelImpl.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ModelImpl.java,v 1.5 2007/05/16 23:51:15 gkessler Exp $
- */
-package org.eclipse.jst.jsf.common.metadata.internal.impl;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.util.EObjectResolvingEList;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.EntityGroup;
-import org.eclipse.jst.jsf.common.metadata.MetadataPackage;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider;
-import org.eclipse.jst.jsf.common.metadata.internal.ModelKeyDescriptor;
-import org.eclipse.jst.jsf.common.metadata.query.IEntityVisitor;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Model</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.internal.impl.ModelImpl#getEntityGroups <em>Entity Groups</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.internal.impl.ModelImpl#getSourceModelProvider <em>Source Model Provider</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.internal.impl.ModelImpl#getCurrentModelContext <em>Current Model Context</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class ModelImpl extends EntityImpl implements Model {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("hiding")
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The cached value of the '{@link #getEntityGroups() <em>Entity Groups</em>}' reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEntityGroups()
- * @generated
- * @ordered
- */
- protected EList entityGroups = null;
-
- /**
- * The default value of the '{@link #getSourceModelProvider() <em>Source Model Provider</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSourceModelProvider()
- * @generated
- * @ordered
- */
- protected static final IMetaDataSourceModelProvider SOURCE_MODEL_PROVIDER_EDEFAULT = null;
-
- /**
- * The default value of the '{@link #getCurrentModelContext() <em>Current Model Context</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCurrentModelContext()
- * @generated
- * @ordered
- */
- protected static final ModelKeyDescriptor CURRENT_MODEL_CONTEXT_EDEFAULT = null;
-
- private IMetaDataSourceModelProvider sourceModelProvider;
-
- private ModelKeyDescriptor _modelContext;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ModelImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return MetadataPackage.Literals.MODEL;
- }
-
- /**
- * <!-- begin-user-doc -->
- * May return null.
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public IMetaDataSourceModelProvider getSourceModelProvider() {
- return sourceModelProvider;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public void setSourceModelProvider(IMetaDataSourceModelProvider newSourceModelProvider) {
- sourceModelProvider = newSourceModelProvider;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public ModelKeyDescriptor getCurrentModelContext() {
- return _modelContext;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public void setCurrentModelContext(ModelKeyDescriptor newCurrentModelContext) {
- _modelContext = newCurrentModelContext;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EList getEntityGroups() {
- if (entityGroups == null) {
- entityGroups = new EObjectResolvingEList(EntityGroup.class, this, MetadataPackage.MODEL__ENTITY_GROUPS);
- }
- return entityGroups;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case MetadataPackage.MODEL__ENTITY_GROUPS:
- return getEntityGroups();
- case MetadataPackage.MODEL__SOURCE_MODEL_PROVIDER:
- return getSourceModelProvider();
- case MetadataPackage.MODEL__CURRENT_MODEL_CONTEXT:
- return getCurrentModelContext();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case MetadataPackage.MODEL__ENTITY_GROUPS:
- getEntityGroups().clear();
- getEntityGroups().addAll((Collection)newValue);
- return;
- case MetadataPackage.MODEL__SOURCE_MODEL_PROVIDER:
- setSourceModelProvider((IMetaDataSourceModelProvider)newValue);
- return;
- case MetadataPackage.MODEL__CURRENT_MODEL_CONTEXT:
- setCurrentModelContext((ModelKeyDescriptor)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public EntityGroup findIncludeGroup(String groupId){
- EntityGroup ret = null;
- for (Iterator it=getEntityGroups().iterator();it.hasNext();){
- EntityGroup entityGroup = (EntityGroup)it.next();
- if (entityGroup.getId().equals(groupId)){
- ret = entityGroup;
- break;
- }
- }
- return ret;
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case MetadataPackage.MODEL__ENTITY_GROUPS:
- getEntityGroups().clear();
- return;
- case MetadataPackage.MODEL__SOURCE_MODEL_PROVIDER:
- setSourceModelProvider(SOURCE_MODEL_PROVIDER_EDEFAULT);
- return;
- case MetadataPackage.MODEL__CURRENT_MODEL_CONTEXT:
- setCurrentModelContext(CURRENT_MODEL_CONTEXT_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
-
- public void accept(IEntityVisitor visitor) {
- if (visitor.stopVisiting())
- return;
- visitor.visit(this);
-
- if (!getChildEntities().isEmpty()){
- for (Iterator/*<Entity>*/ it = getChildEntities().iterator(); it.hasNext();){
- Entity k = (Entity)it.next();
- k.accept(visitor);
- if (visitor.stopVisiting())
- return;
- }
- }
-
- visitor.visitCompleted(this);
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public Model getModel() {
- return this;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case MetadataPackage.MODEL__ENTITY_GROUPS:
- return entityGroups != null && !entityGroups.isEmpty();
- case MetadataPackage.MODEL__SOURCE_MODEL_PROVIDER:
- return SOURCE_MODEL_PROVIDER_EDEFAULT == null ? getSourceModelProvider() != null : !SOURCE_MODEL_PROVIDER_EDEFAULT.equals(getSourceModelProvider());
- case MetadataPackage.MODEL__CURRENT_MODEL_CONTEXT:
- return CURRENT_MODEL_CONTEXT_EDEFAULT == null ? getCurrentModelContext() != null : !CURRENT_MODEL_CONTEXT_EDEFAULT.equals(getCurrentModelContext());
- }
- return super.eIsSet(featureID);
- }
-
-} //ModelImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/TraitImpl.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/TraitImpl.java
deleted file mode 100644
index 01f3d1fe2..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/impl/TraitImpl.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: TraitImpl.java,v 1.5 2007/06/11 20:55:58 gkessler Exp $
- */
-package org.eclipse.jst.jsf.common.metadata.internal.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.jst.jsf.common.metadata.MetadataPackage;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider;
-import org.eclipse.jst.jsf.common.metadata.query.ITraitVisitor;
-
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Trait</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link com.foo.model.metadata.impl.TraitImpl#getType <em>Type</em>}</li>
- * <li>{@link com.foo.model.metadata.impl.TraitImpl#getValue <em>Value</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-/**
- * @author Owner
- *
- */
-public class TraitImpl extends EObjectImpl implements Trait {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The default value of the '{@link #getId() <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getId()
- * @generated
- * @ordered
- */
- protected static final String ID_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getId() <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getId()
- * @generated
- * @ordered
- */
- protected String id = ID_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getValue() <em>Value</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValue()
- * @generated
- * @ordered
- */
- protected EObject value = null;
-
- /**
- * The default value of the '{@link #getSourceModelProvider() <em>Source Model Provider</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSourceModelProvider()
- * @generated
- * @ordered
- */
- protected static final IMetaDataSourceModelProvider SOURCE_MODEL_PROVIDER_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getSourceModelProvider() <em>Source Model Provider</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSourceModelProvider()
- * @generated
- * @ordered
- */
- protected IMetaDataSourceModelProvider sourceModelProvider = SOURCE_MODEL_PROVIDER_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected TraitImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return MetadataPackage.Literals.TRAIT;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EObject getValue() {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param newValue
- * @param msgs
- * @return NotificationChain
- * @generated
- */
- public NotificationChain basicSetValue(EObject newValue, NotificationChain msgs) {
- EObject oldValue = value;
- value = newValue;
- if (eNotificationRequired()) {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, MetadataPackage.TRAIT__VALUE, oldValue, newValue);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setValue(EObject newValue) {
- if (newValue != value) {
- NotificationChain msgs = null;
- if (value != null)
- msgs = ((InternalEObject)value).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - MetadataPackage.TRAIT__VALUE, null, msgs);
- if (newValue != null)
- msgs = ((InternalEObject)newValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - MetadataPackage.TRAIT__VALUE, null, msgs);
- msgs = basicSetValue(newValue, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, MetadataPackage.TRAIT__VALUE, newValue, newValue));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public IMetaDataSourceModelProvider getSourceModelProvider() {
- return sourceModelProvider;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setSourceModelProvider(IMetaDataSourceModelProvider newSourceModelProvider) {
- IMetaDataSourceModelProvider oldSourceModelProvider = sourceModelProvider;
- sourceModelProvider = newSourceModelProvider;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, MetadataPackage.TRAIT__SOURCE_MODEL_PROVIDER, oldSourceModelProvider, sourceModelProvider));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getId() {
- return id;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setId(String newId) {
- String oldId = id;
- id = newId;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, MetadataPackage.TRAIT__ID, oldId, id));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public void accept(ITraitVisitor visitor) {
- visitor.visit(this);
- visitor.visitCompleted(this);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case MetadataPackage.TRAIT__VALUE:
- return basicSetValue(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case MetadataPackage.TRAIT__ID:
- return getId();
- case MetadataPackage.TRAIT__VALUE:
- return getValue();
- case MetadataPackage.TRAIT__SOURCE_MODEL_PROVIDER:
- return getSourceModelProvider();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case MetadataPackage.TRAIT__ID:
- setId((String)newValue);
- return;
- case MetadataPackage.TRAIT__VALUE:
- setValue((EObject)newValue);
- return;
- case MetadataPackage.TRAIT__SOURCE_MODEL_PROVIDER:
- setSourceModelProvider((IMetaDataSourceModelProvider)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case MetadataPackage.TRAIT__ID:
- setId(ID_EDEFAULT);
- return;
- case MetadataPackage.TRAIT__VALUE:
- setValue((EObject)null);
- return;
- case MetadataPackage.TRAIT__SOURCE_MODEL_PROVIDER:
- setSourceModelProvider(SOURCE_MODEL_PROVIDER_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case MetadataPackage.TRAIT__ID:
- return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
- case MetadataPackage.TRAIT__VALUE:
- return value != null;
- case MetadataPackage.TRAIT__SOURCE_MODEL_PROVIDER:
- return SOURCE_MODEL_PROVIDER_EDEFAULT == null ? sourceModelProvider != null : !SOURCE_MODEL_PROVIDER_EDEFAULT.equals(sourceModelProvider);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (id: ");
- result.append(id);
- result.append(", sourceModelProvider: ");
- result.append(sourceModelProvider);
- result.append(')');
- return result.toString();
- }
-
- public boolean equals(@SuppressWarnings("hiding")Object value){
- if (!(value instanceof String))
- return super.equals(value);
-
- String key = (String)value;
- if (key.equals(getId()))
- return true;
-
- return false;
- }
-} //TraitImpl \ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/messages.properties b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/messages.properties
deleted file mode 100644
index 5e9fd47a8..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/messages.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 Oracle 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:
-# Oracle Corporation - initial API and implementation
-###############################################################################
-
-MissingResource_exception=MissingResourceException for NLSPropertyValue: {0}
-Key_not_found=(key not found)
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/util/MetadataAdapterFactory.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/util/MetadataAdapterFactory.java
deleted file mode 100644
index 81b5e28e0..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/util/MetadataAdapterFactory.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: MetadataAdapterFactory.java,v 1.4 2007/04/16 19:54:01 itrimble Exp $
- */
-package org.eclipse.jst.jsf.common.metadata.internal.util;
-
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.EntityGroup;
-import org.eclipse.jst.jsf.common.metadata.IncludeEntityGroup;
-import org.eclipse.jst.jsf.common.metadata.MetadataPackage;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-
-
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Adapter Factory</b> for the model.
- * It provides an adapter <code>createXXX</code> method for each class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.MetadataPackage
- * @generated
- */
-public class MetadataAdapterFactory extends AdapterFactoryImpl {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The cached model package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected static MetadataPackage modelPackage;
-
- /**
- * Creates an instance of the adapter factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public MetadataAdapterFactory() {
- if (modelPackage == null) {
- modelPackage = MetadataPackage.eINSTANCE;
- }
- }
-
- /**
- * Returns whether this factory is applicable for the type of the object.
- * <!-- begin-user-doc -->
- * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
- * <!-- end-user-doc -->
- * @return whether this factory is applicable for the type of the object.
- * @generated
- */
- public boolean isFactoryForType(Object object) {
- if (object == modelPackage) {
- return true;
- }
- if (object instanceof EObject) {
- return ((EObject)object).eClass().getEPackage() == modelPackage;
- }
- return false;
- }
-
- /**
- * The switch the delegates to the <code>createXXX</code> methods.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected MetadataSwitch modelSwitch =
- new MetadataSwitch() {
- public Object caseModel(Model object) {
- return createModelAdapter();
- }
- public Object caseEntityGroup(EntityGroup object) {
- return createEntityGroupAdapter();
- }
- public Object caseEntity(Entity object) {
- return createEntityAdapter();
- }
- public Object caseTrait(Trait object) {
- return createTraitAdapter();
- }
- public Object caseIncludeEntityGroup(IncludeEntityGroup object) {
- return createIncludeEntityGroupAdapter();
- }
- public Object defaultCase(EObject object) {
- return createEObjectAdapter();
- }
- };
-
- /**
- * Creates an adapter for the <code>target</code>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param target the object to adapt.
- * @return the adapter for the <code>target</code>.
- * @generated
- */
- public Adapter createAdapter(Notifier target) {
- return (Adapter)modelSwitch.doSwitch((EObject)target);
- }
-
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.common.metadata.Trait <em>Trait</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.common.metadata.Trait
- * @generated
- */
- public Adapter createTraitAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.common.metadata.IncludeEntityGroup <em>Include Entity Group</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.common.metadata.IncludeEntityGroup
- * @generated
- */
- public Adapter createIncludeEntityGroupAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.common.metadata.Model <em>Model</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.common.metadata.Model
- * @generated
- */
- public Adapter createModelAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.common.metadata.Entity <em>Entity</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.common.metadata.Entity
- * @generated
- */
- public Adapter createEntityAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.common.metadata.EntityGroup <em>Entity Group</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.common.metadata.EntityGroup
- * @generated
- */
- public Adapter createEntityGroupAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for the default case.
- * <!-- begin-user-doc -->
- * This default implementation returns null.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @generated
- */
- public Adapter createEObjectAdapter() {
- return null;
- }
-
-} //MetadataAdapterFactory
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/util/MetadataResourceFactoryImpl.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/util/MetadataResourceFactoryImpl.java
deleted file mode 100644
index e365a039b..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/util/MetadataResourceFactoryImpl.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: MetadataResourceFactoryImpl.java,v 1.2 2007/01/24 17:22:46 gkessler Exp $
- */
-package org.eclipse.jst.jsf.common.metadata.internal.util;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl;
-import org.eclipse.emf.ecore.xmi.XMLResource;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Resource Factory</b> associated with the package.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.internal.util.MetadataResourceImpl
- * @generated
- */
-public class MetadataResourceFactoryImpl extends ResourceFactoryImpl {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * Creates an instance of the resource factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public MetadataResourceFactoryImpl() {
- super();
- }
-
- /**
- * Creates an instance of the resource.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
- public Resource createResource(URI uri) {
- XMLResource result = new MetadataResourceImpl(uri);
- result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);
- result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);
-
- result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE);
-
- result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
- result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
-
- result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE);
- return result;
- }
-
-} //MetadataResourceFactoryImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/util/MetadataResourceImpl.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/util/MetadataResourceImpl.java
deleted file mode 100644
index a82e0dac9..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/util/MetadataResourceImpl.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: MetadataResourceImpl.java,v 1.7 2007/05/11 17:54:56 gkessler Exp $
- */
-package org.eclipse.jst.jsf.common.metadata.internal.util;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Map;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.xmi.XMLHelper;
-import org.eclipse.emf.ecore.xmi.XMLResource;
-import org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl;
-import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.MetadataPackage;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.IMetaDataSourceModelProvider;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Resource </b> associated with the package.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.internal.util.MetadataResourceFactoryImpl
- * @generated NOT
- */
-public class MetadataResourceImpl extends XMLResourceImpl implements XMLResource.ResourceHandler {
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Oracle inc.";
-
- /**
- * IMetaDataSourceModelProvider
- */
- protected IMetaDataSourceModelProvider _provider;
- /**
- * Creates an instance of the resource.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param uri the URI of the new resource.
- * @generated
- */
- public MetadataResourceImpl(URI uri) {
- super(uri);
- }
-
- /**
- * Constructor
- */
- public MetadataResourceImpl() {
- super();
- }
-
-
- /**
- * Constructorb
- * @param provider
- */
- public MetadataResourceImpl(IMetaDataSourceModelProvider provider){
- super();
- _provider = provider;
- }
- /**
- * Override createXMLHelper so that MetadataPackage.eINSTANCE is used for the NoNamespace package
- * @generated NOT
- */
- protected XMLHelper createXMLHelper() {
- return new XMLHelperImpl(){
- public EPackage getNoNamespacePackage() {
- return MetadataPackage.eINSTANCE;
- }
- };
- }
-
- public void postLoad(XMLResource resource, InputStream inputStream,
- Map options) {
- Object aRoot = resource.getContents().get(0);
- if (aRoot != null && aRoot instanceof Model){
- setModelKeyInTraits((Model)aRoot, (Model)aRoot);
- }
- }
-
- private void setModelKeyInTraits(Model root, Entity currentEntity) {
- // TODO: does this have side effect that we care about? nothing is done with the return value
- MetadataPackage.eINSTANCE.getTrait_SourceModelProvider();
- for (int i=0;i < currentEntity.getTraits().size();i++){
- ((Trait)currentEntity.getTraits().get(i)).setSourceModelProvider(_provider);
- }
- for (int j=0;j < currentEntity.getChildEntities().size();j++){
- setModelKeyInTraits(root,(Entity)currentEntity.getChildEntities().get(j));
- }
-
- if (currentEntity == root){
- for (int k=0;k < root.getEntityGroups().size();k++){
- setModelKeyInTraits(root,(Entity)root.getEntityGroups().get(k));
- }
- }
- }
-
-
- public void postSave(XMLResource resource, OutputStream outputStream,
- Map options) {
- // TODO Auto-generated method stub
-
- }
-
- public void preLoad(XMLResource resource, InputStream inputStream,
- Map options) {
- // TODO Auto-generated method stub
-
- }
-
- public void preSave(XMLResource resource, OutputStream outputStream,
- Map options) {
- // TODO Auto-generated method stub
-
- }
-
-} //MetadataResourceImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/util/MetadataSwitch.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/util/MetadataSwitch.java
deleted file mode 100644
index 4812ac4f7..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/util/MetadataSwitch.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: MetadataSwitch.java,v 1.6 2007/10/01 04:29:45 cbateman Exp $
- */
-package org.eclipse.jst.jsf.common.metadata.internal.util;
-
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.EntityGroup;
-import org.eclipse.jst.jsf.common.metadata.IncludeEntityGroup;
-import org.eclipse.jst.jsf.common.metadata.MetadataPackage;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-
-
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Switch</b> for the model's inheritance hierarchy.
- * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
- * to invoke the <code>caseXXX</code> method for each class of the model,
- * starting with the actual class of the object
- * and proceeding up the inheritance hierarchy
- * until a non-null result is returned,
- * which is the result of the switch.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.MetadataPackage
- * @generated
- */
-public class MetadataSwitch {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The cached model package
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected static MetadataPackage modelPackage;
-
- /**
- * Creates an instance of the switch.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public MetadataSwitch() {
- if (modelPackage == null) {
- modelPackage = MetadataPackage.eINSTANCE;
- }
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param theEObject
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- public Object doSwitch(EObject theEObject) {
- return doSwitch(theEObject.eClass(), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param theEClass
- * @param theEObject
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected Object doSwitch(EClass theEClass, EObject theEObject) {
- if (theEClass.eContainer() == modelPackage) {
- return doSwitch(theEClass.getClassifierID(), theEObject);
- }
- List eSuperTypes = theEClass.getESuperTypes();
- return
- eSuperTypes.isEmpty() ?
- defaultCase(theEObject) :
- doSwitch((EClass)eSuperTypes.get(0), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param classifierID
- * @param theEObject
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected Object doSwitch(int classifierID, EObject theEObject) {
- switch (classifierID) {
- case MetadataPackage.MODEL: {
- Model model = (Model)theEObject;
- Object result = caseModel(model);
- if (result == null) result = caseEntity(model);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case MetadataPackage.ENTITY_GROUP: {
- EntityGroup entityGroup = (EntityGroup)theEObject;
- Object result = caseEntityGroup(entityGroup);
- if (result == null) result = caseEntity(entityGroup);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case MetadataPackage.ENTITY: {
- Entity entity = (Entity)theEObject;
- Object result = caseEntity(entity);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case MetadataPackage.TRAIT: {
- Trait trait = (Trait)theEObject;
- Object result = caseTrait(trait);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case MetadataPackage.INCLUDE_ENTITY_GROUP: {
- IncludeEntityGroup includeEntityGroup = (IncludeEntityGroup)theEObject;
- Object result = caseIncludeEntityGroup(includeEntityGroup);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- default: return defaultCase(theEObject);
- }
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>Trait</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>Trait</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseTrait(Trait object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>Include Entity Group</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>Include Entity Group</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseIncludeEntityGroup(IncludeEntityGroup object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>Model</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>Model</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseModel(Model object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>Entity</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>Entity</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseEntity(Entity object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>Entity Group</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>Entity Group</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseEntityGroup(EntityGroup object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>EObject</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch, but this is the last case anyway.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>EObject</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject)
- * @generated
- */
- public Object defaultCase(EObject object) {
- return null;
- }
-
-} //MetadataSwitch
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/util/MetadataXMLProcessor.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/util/MetadataXMLProcessor.java
deleted file mode 100644
index 39a97912f..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/internal/util/MetadataXMLProcessor.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: MetadataXMLProcessor.java,v 1.3 2007/04/16 19:54:01 itrimble Exp $
- */
-package org.eclipse.jst.jsf.common.metadata.internal.util;
-
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.xmi.util.XMLProcessor;
-import org.eclipse.jst.jsf.common.metadata.MetadataPackage;
-
-
-/**
- * This class contains helper methods to serialize and deserialize XML documents
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-public class MetadataXMLProcessor extends XMLProcessor {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
-
- /**
- * Public constructor to instantiate the helper.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public MetadataXMLProcessor() {
- super((EPackage.Registry.INSTANCE));
- MetadataPackage.eINSTANCE.eClass();
- }
-
- /**
- * Register for "*" and "xml" file extensions the MetadataResourceFactoryImpl factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected Map getRegistrations() {
- if (registrations == null) {
- super.getRegistrations();
- registrations.put(XML_EXTENSION, new MetadataResourceFactoryImpl());
- registrations.put(STAR_EXTENSION, new MetadataResourceFactoryImpl());
- }
- return registrations;
- }
-
-} //MetadataXMLProcessor
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/package-info.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/package-info.java
deleted file mode 100644
index 836883f01..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/package-info.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-/**
- * EMF interface objects for design-time metadata.
- * <p><b>Provisional API - subject to change</b></p>
- */
-package org.eclipse.jst.jsf.common.metadata;
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/AbstractEntityQueryVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/AbstractEntityQueryVisitor.java
deleted file mode 100644
index 282b63923..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/AbstractEntityQueryVisitor.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.query;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-
-/**
- * Abstract class implmenting {@link IEntityQueryVisitor} that concrete subclasses should provide implementations
- * <p><b>Provisional API - subject to change</b></p>
- */
-public abstract class AbstractEntityQueryVisitor extends AbstractEntityVisitor
- implements IEntityQueryVisitor {
-
- /**
- * @return EmptyResultSet. Subclasses should override.
- */
- public IResultSet findEntities(Entity initialEntityContext, String entityKey) {
- return new EmptyResultSet();
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/AbstractEntityVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/AbstractEntityVisitor.java
deleted file mode 100644
index 54e6f0165..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/AbstractEntityVisitor.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.query;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-
-/**
- * Abstract implementation that concrete subclasses should ovveride
- * <p><b>Provisional API - subject to change</b></p>
- */
-public abstract class AbstractEntityVisitor extends AbstractMetaDataVisitor
- implements IEntityVisitor {
-
- public abstract void visit(Entity entity);
-
- public void visitCompleted(Entity entity){
- //subclasses should override if needed
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/AbstractMetaDataVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/AbstractMetaDataVisitor.java
deleted file mode 100644
index 15443e5d5..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/AbstractMetaDataVisitor.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.query;
-
-/**
- * Abstract class implementing {@link IMetaDataVisitor}
- * <p><b>Provisional API - subject to change</b></p>
- */
-public abstract class AbstractMetaDataVisitor implements IMetaDataVisitor {
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.query.IMetaDataVisitor#stopVisiting()
- */
- public boolean stopVisiting() {
- return false;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/AbstractResultSet.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/AbstractResultSet.java
deleted file mode 100644
index e459d7cc3..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/AbstractResultSet.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.query;
-
-import java.util.Collections;
-import java.util.List;
-
-/**
- * Abstract implementation of {@link IResultSet} that developers may subclass.
- * Users should assume that the results are only valid at the time of the query. This may change in the future.
- * <p><b>Provisional API - subject to change</b></p>
- */
-public abstract class AbstractResultSet/*<T>*/ implements IResultSet/*<T>*/ {
- private List _results;
- private boolean _isClosed = false;
-
- public List getResults() throws MetaDataException {
- initIfNecessary();
- return _results;
- }
-
- public final void close() throws MetaDataException {
- doClose();
- _isClosed = true;
- _results = null;
- }
-
- /**
- * Overridable method to close resultset. This is called by close()
- * @throws MetaDataException
- */
- @SuppressWarnings("unused")
- protected void doClose() throws MetaDataException {
- //subclasses to provide override
- }
-
- public final boolean isClosed() {
- return _isClosed;
- }
-
- /**
- * @return List of results. Null is tolerated.
- */
- protected abstract List getInternalResults();
-
- private void initIfNecessary() throws MetaDataException {
- if (_isClosed)
- throw new MetaDataException("Attempt to access a closed resultset.");
-
- if (_results == null) {
- List checkNullResults = getInternalResults();
- if (checkNullResults == null){
- checkNullResults = Collections.EMPTY_LIST;
- }
- _results = Collections.unmodifiableList(checkNullResults);
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/AbstractTraitQueryVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/AbstractTraitQueryVisitor.java
deleted file mode 100644
index ddb894088..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/AbstractTraitQueryVisitor.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.query;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-
-/**
- * Abstract implmentation of {@link ITraitQueryVisitor} that subclasses should use to provide implmentation
- * <p><b>Provisional API - subject to change</b></p>
- */
-public abstract class AbstractTraitQueryVisitor extends AbstractTraitVisitor implements
- ITraitQueryVisitor {
-
- /**
- * @return EmptyResultSet. Subclasses should override.
- */
- public IResultSet findTraits(Entity entity, String traitKey) {
- return new EmptyResultSet();
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/AbstractTraitVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/AbstractTraitVisitor.java
deleted file mode 100644
index 795a473e1..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/AbstractTraitVisitor.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.query;
-
-import org.eclipse.jst.jsf.common.metadata.Trait;
-
-/**
- * Abstract Trait visitor
- * <p><b>Provisional API - subject to change</b></p>
- */
-public abstract class AbstractTraitVisitor extends AbstractMetaDataVisitor implements ITraitVisitor{
-
- public abstract void visit(final Trait trait);
-
- public void visitCompleted(final Trait trait) {
- //subclasses should override if needed
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/EmptyResultSet.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/EmptyResultSet.java
deleted file mode 100644
index 0c6539e43..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/EmptyResultSet.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.query;
-
-import java.util.Collections;
-import java.util.List;
-
-/**
- * Implementation of an empty result set
- * <p><b>Provisional API - subject to change</b></p>
- */
-public final class EmptyResultSet implements IResultSet {
- private boolean _isClosed = false;
- public void close() {
- _isClosed = true;
- }
-
- public List getResults() throws MetaDataException{
- if (_isClosed)
- throw new MetaDataException("Resultset is closed");
-
- return Collections.EMPTY_LIST;
- }
-
- public boolean isClosed() {
- return _isClosed;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/IEntityQueryVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/IEntityQueryVisitor.java
deleted file mode 100644
index 7f168c162..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/IEntityQueryVisitor.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.query;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-
-/**
- * Entity querying interface
- * <p>NOT to implemented by clients directly. Clients should subclass AbstractEntityQueryVisitor instead.
- * <p><b>Provisional API - subject to change</b></p>
- */
-public interface IEntityQueryVisitor extends IEntityVisitor{
- /**
- * @param initialEntityContext
- * @param entityKey to find relative to the passed intialEntityContext
- * @return IResultSet of Entities matching the key. IResultSet must NOT be null. Implementers may return {@link EmptyResultSet}.
- */
- public IResultSet/*<Entity>*/ findEntities(final Entity initialEntityContext,
- final String entityKey);
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/IEntityVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/IEntityVisitor.java
deleted file mode 100644
index fcc178381..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/IEntityVisitor.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.query;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-
-/**
- * Visitor interface for Entities
- * <p>NOT to implemented by clients directly. Clients should subclass AbstractEntityVisitor instead.
- * <p><b>Provisional API - subject to change</b></p>
- */
-public interface IEntityVisitor extends IMetaDataVisitor {
- /**
- * Visit the entity.
- * The entity and then it's children are visited
- * @param entity - must not be NULL
- */
- public void visit(final Entity entity);
- /**
- * Signal that the entity and all it's children is now completely 'visited'.
- * The entity will call this method at the end of the accept method.
- * @param entity - must not be NULL
- */
- public void visitCompleted(Entity entity);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/IMetaDataModelContext.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/IMetaDataModelContext.java
deleted file mode 100644
index c70cdd981..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/IMetaDataModelContext.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.query;
-
-import org.eclipse.jst.jsf.context.IModelContext;
-
-/**
- * <p><b>Provisional API - subject to change</b></p>
- */
-public interface IMetaDataModelContext extends IModelContext {
- /**
- * @return domain identifier for this context.
- * <p>This must match the domain id from the org.eclipse.jst.jsf.common.DomainLoadingStrategies
- */
- public String getDomainID();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/IMetaDataVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/IMetaDataVisitor.java
deleted file mode 100644
index 35a3652a3..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/IMetaDataVisitor.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.query;
-
-/**
- * Common interface for Entity and Trait visitors
- * <p>NOT to implemented by clients directly. Clients should subclass AbstractMetaDataVisitor instead.
- * <p><b>Provisional API - subject to change</b></p>
- */
-public interface IMetaDataVisitor {
- /**
- * @return true if visitor has recognized that visiting should stop
- */
- public boolean stopVisiting();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/IResultSet.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/IResultSet.java
deleted file mode 100644
index 0d0ab4866..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/IResultSet.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.query;
-
-import java.util.List;
-
-
-
-/**
- * Results from a metadata query. The resultset should be considered valid only at the time that the query is performed.
- * Once "closed", the resultset should not be accessed again.
- *
- * <p>Not intended to be implemented directly by clients. Developers should extend {@link AbstractResultSet} instead.
- * <p><b>Provisional API - subject to change</b></p>
- */
-public interface IResultSet/*<T>*/{
-
- /**
- * @return unmodifiable List of results. May NOT be null. Implementer must return Collections.EMPTY_LIST instead.
- * @throws MetaDataException
- */
- public List/*<T>*/ getResults() throws MetaDataException;
-
- /**
- * Signal that the query results are no longer required allowing for any cleanup that may be required
- * Once a resultset is closed, a MetaDataException should be thrown if the next() or hasNext() is called. Clients can check isClosed() first.
- * @throws MetaDataException
- */
- public void close() throws MetaDataException;
-
- /**
- * @return true if this resultset has been closed.
- */
- public boolean isClosed();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/ITaglibDomainMetaDataModelContext.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/ITaglibDomainMetaDataModelContext.java
deleted file mode 100644
index 17595f9ea..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/ITaglibDomainMetaDataModelContext.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.query;
-
-import org.eclipse.core.resources.IProject;
-
-/**
- * Context for determining the Model to locate in the MetaDataManager
- * <p>Should NOT be implemented by clients
- * <p><b>Provisional API - subject to change</b></p>
- */
-public interface ITaglibDomainMetaDataModelContext extends IMetaDataModelContext {
- /**
- * @return project
- */
- public IProject getProject();
- /**
- * @return the namespace URI as String
- */
- public String getURI();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/ITraitQueryVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/ITraitQueryVisitor.java
deleted file mode 100644
index fd96a3721..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/ITraitQueryVisitor.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.query;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-
-/**
- * Trait querying interface
- * <p>NOT to implemented by clients directly. Clients should subclass AbstractTraitQueryVisitor instead.
- * <p><b>Provisional API - subject to change</b></p>
- */
-public interface ITraitQueryVisitor extends ITraitVisitor{
- /**
- * @param entity
- * @param traitKey
- * @return IResultSet of Traits. IResultSet must NOT be null. Implementers may return {@link EmptyResultSet}.
- */
- public IResultSet/*<Trait>*/ findTraits(final Entity entity,
- final String traitKey);
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/ITraitVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/ITraitVisitor.java
deleted file mode 100644
index 9b39a101d..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/ITraitVisitor.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.query;
-
-import org.eclipse.jst.jsf.common.metadata.Trait;
-
-/**
- * Visitor interface for Traits
- * <p>NOT to implemented by clients directly. Clients should subclass AbstractTraitVisitor instead.
- * <p><b>Provisional API - subject to change</b></p>
- */
-public interface ITraitVisitor extends IMetaDataVisitor {
- /**
- * Visit the Trait.
- * Implementer cannot assume ordering of trait visiting.
- * @param trait - must not be null
- */
- public void visit(final Trait trait);
-
- /**
- * Signal that the the trait has been completely visited
- * @param trait
- */
- public void visitCompleted(final Trait trait);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/MetaDataException.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/MetaDataException.java
deleted file mode 100644
index 50b314fbe..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/MetaDataException.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.query;
-
-/**
- * Exception intended to be superclass of all exceptions thrown while handling metadata during query
- * <p><b>Provisional API - subject to change</b></p>
- */
-public class MetaDataException extends Exception {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- /**
- * Constructor
- */
- public MetaDataException(){
- super();
- }
- /**
- * Constructor
- * @param msg
- */
- public MetaDataException(String msg){
- super(msg);
- }
-
- /**
- * Constructor
- * @param msg
- * @param cause
- */
- public MetaDataException(String msg, Throwable cause){
- super(msg, cause);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/TaglibDomainMetaDataQueryHelper.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/TaglibDomainMetaDataQueryHelper.java
deleted file mode 100644
index 582db6d77..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/TaglibDomainMetaDataQueryHelper.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.query;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jst.jsf.common.JSFCommonPlugin;
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Model;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.internal.MetaDataModel;
-import org.eclipse.jst.jsf.common.metadata.internal.TaglibDomainMetaDataModelContextImpl;
-import org.eclipse.jst.jsf.common.metadata.internal.MetaDataModelManager;
-import org.eclipse.jst.jsf.common.metadata.query.internal.SimpleEntityQueryVisitorImpl;
-import org.eclipse.jst.jsf.common.metadata.query.internal.SimpleTraitQueryVisitorImpl;
-import org.eclipse.jst.jsf.common.metadata.query.internal.HierarchicalSearchControl;
-
-
-/**
- * Helper class with static methods to simplify querying of a metadata model.
- *
- * <p>Steps for use:
- * <br>1) Get the ITaglibDomainMetaDataModelContext using createMetaDataModelContext or createTagLibraryDomainMetaDataModelContext
- * <br>2) Use appropriate getXXX methods using the ITaglibDomainMetaDataModelContext.
- * <p><b>Provisional API - subject to change</b></p>
- * @see IResultSet
- * @see IEntityQueryVisitor
- * @see ITraitQueryVisitor
- * @see ITaglibDomainMetaDataModelContext
- * @see Model
- * @see Entity
- * @see Trait
- */
-public final class TaglibDomainMetaDataQueryHelper{
- /**
- * Domain id for Tag library domain of metatdata
- */
- public static final String TAGLIB_DOMAIN = "TagLibraryDomain"; //need better place for this
-
- /**
- * private constructor
- */
- private TaglibDomainMetaDataQueryHelper (){
- super();
- }
-
- /**
- * Convenience method for creating {@link ITaglibDomainMetaDataModelContext}s for TAGLIB_DOMAIN
- * @param project
- * @param uri
- * @return ITaglibDomainMetaDataModelContext
- */
- public static ITaglibDomainMetaDataModelContext createMetaDataModelContext(IProject project, String uri){
- return new TaglibDomainMetaDataModelContextImpl(TAGLIB_DOMAIN, project, uri);
- }
- /**
- * @param modelContext
- * @return Model object for given context. May return null if not located.
- */
- public static Model getModel(final ITaglibDomainMetaDataModelContext modelContext) {
- MetaDataModel model = getMDModel(modelContext);
- //we may want to throw error that model is empty
- if (model != null && !model.isEmpty()){
- return (Model)model.getRoot();
- }
- return null;
- }
-
- /**
- * @param modelContext
- * @param entityKey relative to root of the model
- * @return the first entity match from the root of the model. May return null.
- */
- public static Entity getEntity(final ITaglibDomainMetaDataModelContext modelContext,
- final String entityKey) {
- IEntityQueryVisitor visitor = new SimpleEntityQueryVisitorImpl(new HierarchicalSearchControl(1, HierarchicalSearchControl.SCOPE_ALL_LEVELS));
- IResultSet/*<Entity>*/ rs = getEntities(modelContext,entityKey, visitor);
- Entity e = null;
- try {
- if (! rs.getResults().isEmpty()){
- e = (Entity)rs.getResults().get(0);
- }
- rs.close();
- } catch (MetaDataException ex) {
- JSFCommonPlugin.log(IStatus.ERROR, "Error in Helper.getEntity() - 1", ex);
- }
-
- return e;
- }
-
- /**
- * @param modelContext
- * @param entityKey relative to root of model
- * @param visitor
- * @return an IResultSet of entity objects
- */
- public static IResultSet/*<Entity>*/ getEntities(final ITaglibDomainMetaDataModelContext modelContext,
- final String entityKey, final IEntityQueryVisitor visitor){
- Model model = getModel(modelContext);
- //we may want to throw error that model is empty
- return getEntities(model, entityKey, visitor);
-
- }
-
- /**
- * @param entity
- * @param traitKey
- * @return a trait or null for the given entity and traitKey using a SimpleEntityQueryVisitorImpl
- */
- public static Trait getTrait(final Entity entity, final String traitKey){
- ITraitQueryVisitor visitor = new SimpleTraitQueryVisitorImpl();
- Trait t= null;
- IResultSet/*<Trait>*/ rs = getTraits(entity, traitKey, visitor);
- try {
- if (! rs.getResults().isEmpty()){
- t = (Trait)rs.getResults().get(0);
- }
- rs.close();
- } catch (MetaDataException ex) {
- JSFCommonPlugin.log(IStatus.ERROR, "Error in Helper.getTrait()", ex);
- }
-
- return t;
- }
-
- /**
- * @param entity
- * @param traitKey
- * @param traitQueryVisitor
- * @return an IResultSet of trait objects using supplied traitQueryVisitor. IResultSet should NOT be null.
- */
- public static IResultSet/*<Trait>*/ getTraits(Entity entity, String traitKey,
- ITraitQueryVisitor traitQueryVisitor) {
- IResultSet/*<Trait>*/ rs = traitQueryVisitor.findTraits(entity, traitKey);
- return rs;
- }
-
- /**
- * @param initialEntityContext
- * @param entityKey relative to initial passed entity
- * @return the first entity located by key using SimpleEntityQueryVisitorImpl
- */
- public static Entity getEntity(Entity initialEntityContext, String entityKey) {
- IEntityQueryVisitor visitor = new SimpleEntityQueryVisitorImpl(new HierarchicalSearchControl(1, HierarchicalSearchControl.SCOPE_ALL_LEVELS));
- Entity e= null;
- IResultSet/*<Entity>*/ rs = getEntities(initialEntityContext, entityKey, visitor);
- try {
- if (! rs.getResults().isEmpty()){
- e = (Entity)rs.getResults().get(0);
- }
- rs.close();
- } catch (MetaDataException ex) {
- JSFCommonPlugin.log(IStatus.ERROR, "Error in Helper.getEntity() - 0", ex);
- }
-
- return e;
- }
-
- /**
- * @param initialEntityContext
- * @param entityQuery relative to initial passed entity
- * @param entityKeyQueryVisitor
- * @return IResultSet of entities located by key using entityQueryVisitor. IResultSet should NOT be null.
- */
- public static IResultSet/*<Entity>*/ getEntities(Entity initialEntityContext, String entityQuery,
- IEntityQueryVisitor entityKeyQueryVisitor) {
-
- return entityKeyQueryVisitor.findEntities(initialEntityContext, entityQuery);
- }
-
-
- /**
- * Retrieve the MetaDataModel from the ModelManager for given key
- * @param modelContext
- * @return MetaDataModel
- */
- private static MetaDataModel getMDModel(final ITaglibDomainMetaDataModelContext modelContext){
- MetaDataModelManager mgr = null;
- if (modelContext.getProject() != null)
- mgr = MetaDataModelManager.getInstance(modelContext.getProject());
- else //temp(?)
- mgr = MetaDataModelManager.getSharedInstance();
-
- return mgr.getModel(modelContext);
- }
-
- /**
- * @param modelContext
- * @param entityKey
- * @param traitKey
- * @return first trait found for entity and trait key starting from root of the model using SimpleMetaDataQueryImpl
- */
- public static Trait getTrait(final ITaglibDomainMetaDataModelContext modelContext,
- final String entityKey, final String traitKey) {
- Entity entity = getEntity(modelContext, entityKey);
- Trait t = null;
- if (entity != null){
- t = getTrait(entity, traitKey);
- }
- return t;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/internal/HierarchicalSearchControl.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/internal/HierarchicalSearchControl.java
deleted file mode 100644
index 36d446e56..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/internal/HierarchicalSearchControl.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.metadata.query.internal;
-
-/**
- * Sets controls on how a tree of nodes can be searched
- */
-public class HierarchicalSearchControl extends SearchControl {
- //scope levels
- /**
- * Do not recurse.
- */
- public static final int SCOPE_CURRENT_LEVEL = 0;
- /**
- * Allow for one level of children to be visited from initial context
- */
- public static final int SCOPE_ONE_LEVEL = 1;
- /**
- * Allow unlimited recursion of children
- */
- public static final int SCOPE_ALL_LEVELS = 2;
-
- private int scope = SCOPE_ALL_LEVELS;
-
- /**
- * Constructor using defaults of COUNT_LIMIT_NONE and SCOPE_ALL_LEVELS
- */
- public HierarchicalSearchControl(){
- super();
- }
- /**
- * Constructor
- * @param countLimit
- * @param scope
- */
- public HierarchicalSearchControl(int countLimit, int scope){
- super(countLimit);
- this.scope = scope;
- }
-
-
- /**
- * @param scope
- */
- public void setScope(int scope){
- this.scope= scope;
- }
-
- /**
- * @return scope
- */
- public int getScope(){
- return scope;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/internal/SearchControl.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/internal/SearchControl.java
deleted file mode 100644
index 43e131752..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/internal/SearchControl.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.query.internal;
-
-/**
- * Simple class used by {@link SimpleEntityQueryVisitorImpl} allowing some control of a metadata query.
- * A query visitor can use this to optimize the query results and signal completion.
- */
-public class SearchControl {
-
- /**
- * No limit on query results
- */
- public static final int COUNT_LIMIT_NONE = -1;
-
- //default settings
- private int countLimit = COUNT_LIMIT_NONE;
-
-
- /**
- * Constructor using defaults of COUNT_LIMIT_NONE
- */
- public SearchControl(){
- //use default settings
- }
-
- /**
- * Constructor
- * @param countLimit
- */
- public SearchControl(int countLimit){
- this.countLimit = countLimit;
- }
-
- /**
- * @param limit results count limit
- */
- public void setCountLimit(int limit){
- this.countLimit = limit;
- }
-
- /**
- * @return query results count limit
- */
- public int getCountLimit(){
- return countLimit;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/internal/SimpleEntityQueryVisitorImpl.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/internal/SimpleEntityQueryVisitorImpl.java
deleted file mode 100644
index df909d923..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/internal/SimpleEntityQueryVisitorImpl.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.query.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Stack;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.EntityGroup;
-import org.eclipse.jst.jsf.common.metadata.query.AbstractEntityQueryVisitor;
-import org.eclipse.jst.jsf.common.metadata.query.IResultSet;
-
-
-/**
- * A simple metadata query visitor implementing {@link org.eclipse.jst.jsf.common.metadata.query.IEntityQueryVisitor} and {@link org.eclipse.jst.jsf.common.metadata.query.ITraitQueryVisitor}.
- * - simple find entity and traits by id only
- * - Does not allow for wild card searchs
- */
-public class SimpleEntityQueryVisitorImpl extends AbstractEntityQueryVisitor {
- private HierarchicalSearchControl control;
- private boolean _stop;
-
- private EntityQueryComparator entityComparator;
- private List/*<Entity>*/ _entityResults;
-
- /**
- * Constructor that also creates a default SearchControl
- */
- public SimpleEntityQueryVisitorImpl() {
- super();
- control = new HierarchicalSearchControl();
- }
-
- /**
- * Constructor
- * @param control
- */
- public SimpleEntityQueryVisitorImpl(HierarchicalSearchControl control) {
- super();
- this.control = control;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.query.IEntityQueryVisitor#findEntities(org.eclipse.jst.jsf.common.metadata.Entity, java.lang.String)
- */
- public IResultSet/*<Entity>*/ findEntities(Entity initialEntityContext,
- String entityKey) {
-
- resetQuery();
-
- if (initialEntityContext != null){
- entityComparator = new EntityQueryComparator(entityKey);
- initialEntityContext.accept(this);
- }
-
- return new SimpleResultSet(getInternalEntityResults());
- }
-
- private void resetQuery() {
- _stop = false;
- _entityResults = null;
- }
-
- private List/*<Entity>*/ getInternalEntityResults(){
- if (_entityResults == null){
- _entityResults = new ArrayList/*<Entity>*/();
- }
- return _entityResults;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.query.IEntityVisitor#visit(org.eclipse.jst.jsf.common.metadata.Entity)
- */
- public void visit(Entity key) {
- switch (entityComparator.compareTo(key)){
- case 0:
- getInternalEntityResults().add(key);
- break;
- default:
- break;
-
- }
- checkShouldStopVisitingEntities();
- }
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.query.IEntityVisitor#visitCompleted(Entity entity)
- */
- public void visitCompleted(Entity entity) {
- entityComparator.popContext();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.query.IMetaDataVisitor#stopVisiting()
- */
- public boolean stopVisiting() {
- return _stop;
- }
-
- private void checkShouldStopVisitingEntities(){
- //implement how to set stop to signal to the entity accept() to skip visiting
- if (control.getCountLimit()== getInternalEntityResults().size() && control.getCountLimit() != SearchControl.COUNT_LIMIT_NONE )
- _stop = true;
- }
-
- /**
- * Simple comparator that compares that an entity's id for with another
- */
- private class EntityQueryComparator implements Comparable/*<Entity>*/{
-
- private String entityKey;
- private EntityStack stack;
-
- /**
- * Constructor
- * @param entityKey
- */
- public EntityQueryComparator(String entityKey){
- this.entityKey = entityKey;
- stack = new EntityStack();
- }
-
- public int compareTo(Object entity) {
- stack.push(entity);
- return entityKey.compareTo(getRelativeId());
- }
-
- /**
- * Pop stack
- */
- public void popContext(){
- stack.pop();
- }
-
- private String getRelativeId(){
- int size = stack.size();
- int i = 1;
- StringBuffer buf = new StringBuffer();
- while(i < size){
- Entity e = (Entity)stack.elementAt(i);
- if (!(e instanceof EntityGroup)){
- if (buf.length()>0)
- buf.append("/");
- buf.append(e.getId());
- }
- i++;
- }
- return buf.toString();
- }
- }
-
- /**
- * Stack used for determining relative key of an entity from the initial context.
- */
- private class EntityStack extends Stack/*<Entity>*/ {
- /**
- *
- */
- private static final long serialVersionUID = -6010267544968175003L;
-
- /**
- * Constructor
- */
- public EntityStack(){
- super();
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/internal/SimpleResultSet.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/internal/SimpleResultSet.java
deleted file mode 100644
index a3b2f2ae2..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/internal/SimpleResultSet.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.query.internal;
-
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jst.jsf.common.metadata.query.AbstractResultSet;
-
-/**
- * Simple implementation of {@link org.eclipse.jst.jsf.common.metadata.query.IResultSet} by extending AbstractResultSet
- *
- */
-public final class SimpleResultSet/*<T>*/ extends AbstractResultSet/*<T>*/ {
- private List/*<T>*/ results;
-
- /**
- * Constructor passing a list to hold the results
- * @param results
- */
- public SimpleResultSet(List/*<T>*/ results){
- super();
- this.results = results;
- }
-
- protected List getInternalResults(){
- if (results == null){
- results = Collections.EMPTY_LIST;
- }
- return results;
- }
-
-
-}
-
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/internal/SimpleTraitQueryVisitorImpl.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/internal/SimpleTraitQueryVisitorImpl.java
deleted file mode 100644
index 00423648f..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/query/internal/SimpleTraitQueryVisitorImpl.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.metadata.query.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jst.jsf.common.metadata.Entity;
-import org.eclipse.jst.jsf.common.metadata.Trait;
-import org.eclipse.jst.jsf.common.metadata.query.AbstractTraitQueryVisitor;
-import org.eclipse.jst.jsf.common.metadata.query.IResultSet;
-
-
-/**
- * A simple metadata query visitor implementing {@link org.eclipse.jst.jsf.common.metadata.query.ITraitQueryVisitor}.
- * - simple find traits by id only
- * - Does not allow for wild card searchs
- */
-public class SimpleTraitQueryVisitorImpl extends AbstractTraitQueryVisitor {
-
- private String _traitQuery;
- private SearchControl _control;
- private boolean _stop;
- private List/*<Trait>*/ _traitResults;
-
- /**
- * Constructor that also creates a default SearchControl
- */
- public SimpleTraitQueryVisitorImpl() {
- super();
- _control = new SearchControl();
- }
-
- /**
- * Constructor
- * @param control
- */
- public SimpleTraitQueryVisitorImpl(SearchControl control) {
- super();
- this._control = control;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.query.ITraitQueryVisitor#findTraits(org.eclipse.jst.jsf.common.metadata.Entity, java.lang.String)
- */
- public IResultSet/*<Trait>*/ findTraits(final Entity entity, final String traitQuery){
-
- resetQuery();
- if (entity != null){
- this._traitQuery = traitQuery;
- for (Iterator/*<Trait>*/ it=entity.getTraits().iterator();it.hasNext();){
- Trait t = (Trait)it.next();
- t.accept(this);
- if (stopVisiting())
- break;
- }
- }
- return new SimpleResultSet(getInternalTraitResults());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.query.ITraitVisitor#visit(org.eclipse.jst.jsf.common.metadata.Trait)
- */
- public void visit(Trait trait) {
- if (trait.equals(_traitQuery))
- getInternalTraitResults().add(trait);
-
- checkShouldStopVisitingTraits();
- }
-
- /**
- *
- */
- private void resetQuery() {
- _stop = false;
- _traitResults = null;
- }
-
- /**
- * @return lazy init of a SimpleResultSet of Traits
- */
- private List/*<Trait>*/ getInternalTraitResults(){
- if (_traitResults == null){
- _traitResults = new ArrayList/*<Trait>*/();
- }
- return _traitResults;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.metadata.query.IMetaDataVisitor#stopVisiting()
- */
- public boolean stopVisiting() {
- return _stop;
- }
-
- private void checkShouldStopVisitingTraits(){
- if (_control.getCountLimit()== getInternalTraitResults().size() && _control.getCountLimit() != SearchControl.COUNT_LIMIT_NONE)
- _stop = true;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/ListOfValues.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/ListOfValues.java
deleted file mode 100644
index 52b338259..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/ListOfValues.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.jsf.common.metadata.traittypes.traittypes;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>List Of Values</b></em>'.
- *
- * <p><b>Provisional API - subject to change</b></p>
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.ListOfValues#getEntries <em>Entries</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.TraitTypesPackage#getListOfValues()
- * @model
- * @generated
- */
-public interface ListOfValues extends EObject {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * Returns the value of the '<em><b>Entries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.emf.ecore.xml.type.SimpleAnyType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Entries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Entries</em>' containment reference list.
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.TraitTypesPackage#getListOfValues_Entries()
- * @model type="org.eclipse.emf.ecore.xml.type.SimpleAnyType" containment="true"
- * extendedMetaData="kind='element' name='item'"
- * @generated
- */
- EList getEntries();
-
-} // ListOfValues
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/SetGenerator.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/SetGenerator.java
deleted file mode 100644
index 9c4fea7b5..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/SetGenerator.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.jsf.common.metadata.traittypes.traittypes;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Set Generator</b></em>'.
- *
- * <p><b>Provisional API - subject to change</b></p>
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.TraitTypesPackage#getSetGenerator()
- * @model
- * @generated
- */
-public interface SetGenerator extends EObject {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * Returns the value of the '<em><b>Algorithm</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Algorithm</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Algorithm</em>' attribute.
- * @see #setAlgorithm(String)
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.TraitTypesPackage#getSetGenerator_Algorithm()
- * @model extendedMetaData="kind='element'"
- * @generated
- */
- String getAlgorithm();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.SetGenerator#getAlgorithm <em>Algorithm</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Algorithm</em>' attribute.
- * @see #getAlgorithm()
- * @generated
- */
- void setAlgorithm(String value);
-
- /**
- * Returns the value of the '<em><b>Expression</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Expression</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Expression</em>' attribute.
- * @see #setExpression(String)
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.TraitTypesPackage#getSetGenerator_Expression()
- * @model extendedMetaData="kind='element'"
- * @generated
- */
- String getExpression();
-
- /**
- * Sets the value of the '{@link org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.SetGenerator#getExpression <em>Expression</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Expression</em>' attribute.
- * @see #getExpression()
- * @generated
- */
- void setExpression(String value);
-
-} // SetGenerator
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/TraitTypesFactory.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/TraitTypesFactory.java
deleted file mode 100644
index 6e76eed0b..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/TraitTypesFactory.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.jsf.common.metadata.traittypes.traittypes;
-
-import org.eclipse.emf.ecore.EFactory;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- *
- * <p><b>Provisional API - subject to change</b></p>
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.TraitTypesPackage
- * @generated
- */
-public interface TraitTypesFactory extends EFactory {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- TraitTypesFactory eINSTANCE = org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl.TraitTypesFactoryImpl.init();
-
- /**
- * Returns a new object of class '<em>List Of Values</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>List Of Values</em>'.
- * @generated
- */
- ListOfValues createListOfValues();
-
- /**
- * Returns a new object of class '<em>Set Generator</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Set Generator</em>'.
- * @generated
- */
- SetGenerator createSetGenerator();
-
- /**
- * Returns the package supported by this factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the package supported by this factory.
- * @generated
- */
- TraitTypesPackage getTraitTypesPackage();
-
-} //TraitTypesFactory
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/TraitTypesPackage.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/TraitTypesPackage.java
deleted file mode 100644
index cd4314a15..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/TraitTypesPackage.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jst.jsf.common.metadata.traittypes.traittypes;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- *
- * <p><b>Provisional API - subject to change</b></p>
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.TraitTypesFactory
- * @model kind="package"
- * @generated
- */
-public interface TraitTypesPackage extends EPackage {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNAME = "traittypes";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNS_URI = "http://org.eclipse.jst.jsf.common.metadata/metadataTraitTypes.ecore";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNS_PREFIX = "mdt";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- TraitTypesPackage eINSTANCE = org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl.TraitTypesPackageImpl.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl.ListOfValuesImpl <em>List Of Values</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl.ListOfValuesImpl
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl.TraitTypesPackageImpl#getListOfValues()
- * @generated
- */
- int LIST_OF_VALUES = 0;
-
- /**
- * The feature id for the '<em><b>Entries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LIST_OF_VALUES__ENTRIES = 0;
-
- /**
- * The number of structural features of the '<em>List Of Values</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LIST_OF_VALUES_FEATURE_COUNT = 1;
-
-
- /**
- * The meta object id for the '{@link org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl.SetGeneratorImpl <em>Set Generator</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl.SetGeneratorImpl
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl.TraitTypesPackageImpl#getSetGenerator()
- * @generated
- */
- int SET_GENERATOR = 1;
-
- /**
- * The feature id for the '<em><b>Algorithm</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int SET_GENERATOR__ALGORITHM = 0;
-
- /**
- * The feature id for the '<em><b>Expression</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int SET_GENERATOR__EXPRESSION = 1;
-
- /**
- * The number of structural features of the '<em>Set Generator</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int SET_GENERATOR_FEATURE_COUNT = 0;
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.ListOfValues <em>List Of Values</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>List Of Values</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.ListOfValues
- * @generated
- */
- EClass getListOfValues();
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.ListOfValues#getEntries <em>Entries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Entries</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.ListOfValues#getEntries()
- * @see #getListOfValues()
- * @generated
- */
- EReference getListOfValues_Entries();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.SetGenerator <em>Set Generator</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Set Generator</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.SetGenerator
- * @generated
- */
- EClass getSetGenerator();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.SetGenerator#getAlgorithm <em>Algorithm</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Algorithm</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.SetGenerator#getAlgorithm()
- * @see #getSetGenerator()
- * @generated
- */
- EAttribute getSetGenerator_Algorithm();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.SetGenerator#getExpression <em>Expression</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Expression</em>'.
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.SetGenerator#getExpression()
- * @see #getSetGenerator()
- * @generated
- */
- EAttribute getSetGenerator_Expression();
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- TraitTypesFactory getTraitTypesFactory();
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- interface Literals {
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl.ListOfValuesImpl <em>List Of Values</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl.ListOfValuesImpl
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl.TraitTypesPackageImpl#getListOfValues()
- * @generated
- */
- @SuppressWarnings("hiding")
- EClass LIST_OF_VALUES = eINSTANCE.getListOfValues();
-
- /**
- * The meta object literal for the '<em><b>Entries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("hiding")
- EReference LIST_OF_VALUES__ENTRIES = eINSTANCE.getListOfValues_Entries();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl.SetGeneratorImpl <em>Set Generator</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl.SetGeneratorImpl
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl.TraitTypesPackageImpl#getSetGenerator()
- * @generated
- */
- @SuppressWarnings("hiding")
- EClass SET_GENERATOR = eINSTANCE.getSetGenerator();
-
- /**
- * The meta object literal for the '<em><b>Algorithm</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("hiding")
- EAttribute SET_GENERATOR__ALGORITHM = eINSTANCE.getSetGenerator_Algorithm();
-
- /**
- * The meta object literal for the '<em><b>Expression</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("hiding")
- EAttribute SET_GENERATOR__EXPRESSION = eINSTANCE.getSetGenerator_Expression();
-
- }
-
-} //TraitTypesPackage
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/impl/ListOfValuesImpl.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/impl/ListOfValuesImpl.java
deleted file mode 100644
index c3ce0ea6e..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/impl/ListOfValuesImpl.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: ListOfValuesImpl.java,v 1.3 2007/04/16 19:54:01 itrimble Exp $
- */
-package org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.NotificationChain;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-
-import org.eclipse.emf.ecore.xml.type.SimpleAnyType;
-
-import org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.ListOfValues;
-import org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.TraitTypesPackage;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>List Of Values</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl.ListOfValuesImpl#getEntries <em>Entries</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class ListOfValuesImpl extends EObjectImpl implements ListOfValues {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The cached value of the '{@link #getEntries() <em>Entries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEntries()
- * @generated
- * @ordered
- */
- protected EList entries = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ListOfValuesImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return TraitTypesPackage.Literals.LIST_OF_VALUES;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EList getEntries() {
- if (entries == null) {
- entries = new EObjectContainmentEList(SimpleAnyType.class, this, TraitTypesPackage.LIST_OF_VALUES__ENTRIES);
- }
- return entries;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case TraitTypesPackage.LIST_OF_VALUES__ENTRIES:
- return ((InternalEList)getEntries()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case TraitTypesPackage.LIST_OF_VALUES__ENTRIES:
- return getEntries();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case TraitTypesPackage.LIST_OF_VALUES__ENTRIES:
- getEntries().clear();
- getEntries().addAll((Collection)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case TraitTypesPackage.LIST_OF_VALUES__ENTRIES:
- getEntries().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case TraitTypesPackage.LIST_OF_VALUES__ENTRIES:
- return entries != null && !entries.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
-} //ListOfValuesImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/impl/SetGeneratorImpl.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/impl/SetGeneratorImpl.java
deleted file mode 100644
index e4d96b686..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/impl/SetGeneratorImpl.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: SetGeneratorImpl.java,v 1.2 2007/04/16 19:54:01 itrimble Exp $
- */
-package org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-import org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.SetGenerator;
-import org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.TraitTypesPackage;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Set Generator</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl.SetGeneratorImpl#getAlgorithm <em>Algorithm</em>}</li>
- * <li>{@link org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl.SetGeneratorImpl#getExpression <em>Expression</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class SetGeneratorImpl extends EObjectImpl implements SetGenerator {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The default value of the '{@link #getAlgorithm() <em>Algorithm</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAlgorithm()
- * @generated
- * @ordered
- */
- protected static final String ALGORITHM_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAlgorithm() <em>Algorithm</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAlgorithm()
- * @generated
- * @ordered
- */
- protected String algorithm = ALGORITHM_EDEFAULT;
-
- /**
- * The default value of the '{@link #getExpression() <em>Expression</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExpression()
- * @generated
- * @ordered
- */
- protected static final String EXPRESSION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getExpression() <em>Expression</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExpression()
- * @generated
- * @ordered
- */
- protected String expression = EXPRESSION_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected SetGeneratorImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return TraitTypesPackage.Literals.SET_GENERATOR;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getAlgorithm() {
- return algorithm;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setAlgorithm(String newAlgorithm) {
- String oldAlgorithm = algorithm;
- algorithm = newAlgorithm;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, TraitTypesPackage.SET_GENERATOR__ALGORITHM, oldAlgorithm, algorithm));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getExpression() {
- return expression;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setExpression(String newExpression) {
- String oldExpression = expression;
- expression = newExpression;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, TraitTypesPackage.SET_GENERATOR__EXPRESSION, oldExpression, expression));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case TraitTypesPackage.SET_GENERATOR__ALGORITHM:
- return getAlgorithm();
- case TraitTypesPackage.SET_GENERATOR__EXPRESSION:
- return getExpression();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case TraitTypesPackage.SET_GENERATOR__ALGORITHM:
- setAlgorithm((String)newValue);
- return;
- case TraitTypesPackage.SET_GENERATOR__EXPRESSION:
- setExpression((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(int featureID) {
- switch (featureID) {
- case TraitTypesPackage.SET_GENERATOR__ALGORITHM:
- setAlgorithm(ALGORITHM_EDEFAULT);
- return;
- case TraitTypesPackage.SET_GENERATOR__EXPRESSION:
- setExpression(EXPRESSION_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case TraitTypesPackage.SET_GENERATOR__ALGORITHM:
- return ALGORITHM_EDEFAULT == null ? algorithm != null : !ALGORITHM_EDEFAULT.equals(algorithm);
- case TraitTypesPackage.SET_GENERATOR__EXPRESSION:
- return EXPRESSION_EDEFAULT == null ? expression != null : !EXPRESSION_EDEFAULT.equals(expression);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (algorithm: ");
- result.append(algorithm);
- result.append(", expression: ");
- result.append(expression);
- result.append(')');
- return result.toString();
- }
-
-} //SetGeneratorImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/impl/TraitTypesFactoryImpl.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/impl/TraitTypesFactoryImpl.java
deleted file mode 100644
index 6aa6dfc2b..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/impl/TraitTypesFactoryImpl.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: TraitTypesFactoryImpl.java,v 1.5 2007/05/11 17:54:57 gkessler Exp $
- */
-package org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-import org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.*;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model <b>Factory</b>.
- * <!-- end-user-doc -->
- * @generated
- */
-public class TraitTypesFactoryImpl extends EFactoryImpl implements TraitTypesFactory {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return TraitTypesFactory
- * @generated
- */
- public static TraitTypesFactory init() {
- try {
- TraitTypesFactory theTraitTypesFactory = (TraitTypesFactory)EPackage.Registry.INSTANCE.getEFactory("http://org.eclipse.jst.jsf.common.metadata/metadataTraitTypes.ecore");
- if (theTraitTypesFactory != null) {
- return theTraitTypesFactory;
- }
- }
- catch (Exception exception) {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new TraitTypesFactoryImpl();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public TraitTypesFactoryImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EObject create(EClass eClass) {
- switch (eClass.getClassifierID()) {
- case TraitTypesPackage.LIST_OF_VALUES: return createListOfValues();
- case TraitTypesPackage.SET_GENERATOR: return createSetGenerator();
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ListOfValues createListOfValues() {
- ListOfValuesImpl listOfValues = new ListOfValuesImpl();
- return listOfValues;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public SetGenerator createSetGenerator() {
- SetGeneratorImpl setGenerator = new SetGeneratorImpl();
- return setGenerator;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public TraitTypesPackage getTraitTypesPackage() {
- return (TraitTypesPackage)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return TraitTypesPackage
- * @deprecated
- * @generated
- */
- public static TraitTypesPackage getPackage() {
- return TraitTypesPackage.eINSTANCE;
- }
-
-} //TraitTypesFactoryImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/impl/TraitTypesPackageImpl.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/impl/TraitTypesPackageImpl.java
deleted file mode 100644
index e40e5ef5f..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/impl/TraitTypesPackageImpl.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: TraitTypesPackageImpl.java,v 1.5 2007/05/11 17:54:57 gkessler Exp $
- */
-package org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-
-import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
-
-import org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.ListOfValues;
-import org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.SetGenerator;
-import org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.TraitTypesFactory;
-import org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.TraitTypesPackage;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model <b>Package</b>.
- * <!-- end-user-doc -->
- * @generated
- */
-public class TraitTypesPackageImpl extends EPackageImpl implements TraitTypesPackage {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass listOfValuesEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass setGeneratorEClass = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.TraitTypesPackage#eNS_URI
- * @see #init()
- * @generated
- */
- private TraitTypesPackageImpl() {
- super(eNS_URI, TraitTypesFactory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this
- * model, and for any others upon which it depends. Simple
- * dependencies are satisfied by calling this method on all
- * dependent packages before doing anything else. This method drives
- * initialization for interdependent packages directly, in parallel
- * with this package, itself.
- * <p>Of this package and its interdependencies, all packages which
- * have not yet been registered by their URI values are first created
- * and registered. The packages are then initialized in two steps:
- * meta-model objects for all of the packages are created before any
- * are initialized, since one package's meta-model objects may refer to
- * those of another.
- * <p>Invocation of this method will not affect any packages that have
- * already been initialized.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return TraitTypesPackage
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static TraitTypesPackage init() {
- if (isInited) return (TraitTypesPackage)EPackage.Registry.INSTANCE.getEPackage(TraitTypesPackage.eNS_URI);
-
- // Obtain or create and register package
- TraitTypesPackageImpl theTraitTypesPackage = (TraitTypesPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof TraitTypesPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new TraitTypesPackageImpl());
-
- isInited = true;
-
- // Initialize simple dependencies
- XMLTypePackage.eINSTANCE.eClass();
-
- // Create package meta-data objects
- theTraitTypesPackage.createPackageContents();
-
- // Initialize created meta-data
- theTraitTypesPackage.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theTraitTypesPackage.freeze();
-
- return theTraitTypesPackage;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getListOfValues() {
- return listOfValuesEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getListOfValues_Entries() {
- return (EReference)listOfValuesEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getSetGenerator() {
- return setGeneratorEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getSetGenerator_Algorithm() {
- return (EAttribute)setGeneratorEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getSetGenerator_Expression() {
- return (EAttribute)setGeneratorEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public TraitTypesFactory getTraitTypesFactory() {
- return (TraitTypesFactory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents() {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- listOfValuesEClass = createEClass(LIST_OF_VALUES);
- createEReference(listOfValuesEClass, LIST_OF_VALUES__ENTRIES);
-
- setGeneratorEClass = createEClass(SET_GENERATOR);
- createEAttribute(setGeneratorEClass, SET_GENERATOR__ALGORITHM);
- createEAttribute(setGeneratorEClass, SET_GENERATOR__EXPRESSION);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents() {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
-
- // Add supertypes to classes
-
- // Initialize classes and features; add operations and parameters
- initEClass(listOfValuesEClass, ListOfValues.class, "ListOfValues", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getListOfValues_Entries(), theXMLTypePackage.getSimpleAnyType(), null, "entries", null, 0, -1, ListOfValues.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(setGeneratorEClass, SetGenerator.class, "SetGenerator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getSetGenerator_Algorithm(), ecorePackage.getEString(), "algorithm", null, 0, 1, SetGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getSetGenerator_Expression(), ecorePackage.getEString(), "expression", null, 0, 1, SetGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Create resource
- createResource(eNS_URI);
-
- // Create annotations
- // http:///org/eclipse/emf/ecore/util/ExtendedMetaData
- createExtendedMetaDataAnnotations();
- }
-
- /**
- * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void createExtendedMetaDataAnnotations() {
- String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData";
- addAnnotation
- (getListOfValues_Entries(),
- source,
- new String[] {
- "kind", "element",
- "name", "item"
- });
- addAnnotation
- (getSetGenerator_Algorithm(),
- source,
- new String[] {
- "kind", "element"
- });
- addAnnotation
- (getSetGenerator_Expression(),
- source,
- new String[] {
- "kind", "element"
- });
- }
-
-} //TraitTypesPackageImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/util/TraitTypesAdapterFactory.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/util/TraitTypesAdapterFactory.java
deleted file mode 100644
index 326147700..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/util/TraitTypesAdapterFactory.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: TraitTypesAdapterFactory.java,v 1.4 2007/04/16 19:54:18 itrimble Exp $
- */
-package org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.util;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.*;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Adapter Factory</b> for the model.
- * It provides an adapter <code>createXXX</code> method for each class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.TraitTypesPackage
- * @generated
- */
-public class TraitTypesAdapterFactory extends AdapterFactoryImpl {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The cached model package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected static TraitTypesPackage modelPackage;
-
- /**
- * Creates an instance of the adapter factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public TraitTypesAdapterFactory() {
- if (modelPackage == null) {
- modelPackage = TraitTypesPackage.eINSTANCE;
- }
- }
-
- /**
- * Returns whether this factory is applicable for the type of the object.
- * <!-- begin-user-doc -->
- * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
- * <!-- end-user-doc -->
- * @return whether this factory is applicable for the type of the object.
- * @generated
- */
- public boolean isFactoryForType(Object object) {
- if (object == modelPackage) {
- return true;
- }
- if (object instanceof EObject) {
- return ((EObject)object).eClass().getEPackage() == modelPackage;
- }
- return false;
- }
-
- /**
- * The switch the delegates to the <code>createXXX</code> methods.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected TraitTypesSwitch modelSwitch =
- new TraitTypesSwitch() {
- public Object caseListOfValues(ListOfValues object) {
- return createListOfValuesAdapter();
- }
- public Object caseSetGenerator(SetGenerator object) {
- return createSetGeneratorAdapter();
- }
- public Object defaultCase(EObject object) {
- return createEObjectAdapter();
- }
- };
-
- /**
- * Creates an adapter for the <code>target</code>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param target the object to adapt.
- * @return the adapter for the <code>target</code>.
- * @generated
- */
- public Adapter createAdapter(Notifier target) {
- return (Adapter)modelSwitch.doSwitch((EObject)target);
- }
-
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.ListOfValues <em>List Of Values</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.ListOfValues
- * @generated
- */
- public Adapter createListOfValuesAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.SetGenerator <em>Set Generator</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.SetGenerator
- * @generated
- */
- public Adapter createSetGeneratorAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for the default case.
- * <!-- begin-user-doc -->
- * This default implementation returns null.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @generated
- */
- public Adapter createEObjectAdapter() {
- return null;
- }
-
-} //TraitTypesAdapterFactory
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/util/TraitTypesResourceFactoryImpl.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/util/TraitTypesResourceFactoryImpl.java
deleted file mode 100644
index 6a187a3b5..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/util/TraitTypesResourceFactoryImpl.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: TraitTypesResourceFactoryImpl.java,v 1.3 2007/02/28 21:12:40 cbateman Exp $
- */
-package org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.util;
-
-import org.eclipse.emf.common.util.URI;
-
-import org.eclipse.emf.ecore.resource.Resource;
-
-import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl;
-
-import org.eclipse.emf.ecore.xmi.XMLResource;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Resource Factory</b> associated with the package.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.util.TraitTypesResourceImpl
- * @generated
- */
-public class TraitTypesResourceFactoryImpl extends ResourceFactoryImpl {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * Creates an instance of the resource factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public TraitTypesResourceFactoryImpl() {
- super();
- }
-
- /**
- * Creates an instance of the resource.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Resource createResource(URI uri) {
- XMLResource result = new TraitTypesResourceImpl(uri);
- result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);
- result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);
-
- result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE);
-
- result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
- result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
-
- result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE);
- return result;
- }
-
-} //TraitTypesResourceFactoryImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/util/TraitTypesResourceImpl.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/util/TraitTypesResourceImpl.java
deleted file mode 100644
index ab734a1ce..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/util/TraitTypesResourceImpl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: TraitTypesResourceImpl.java,v 1.3 2007/02/28 21:12:40 cbateman Exp $
- */
-package org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.util;
-
-import org.eclipse.emf.common.util.URI;
-
-import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Resource </b> associated with the package.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.util.TraitTypesResourceFactoryImpl
- * @generated
- */
-public class TraitTypesResourceImpl extends XMLResourceImpl {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * Creates an instance of the resource.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param uri the URI of the new resource.
- * @generated
- */
- public TraitTypesResourceImpl(URI uri) {
- super(uri);
- }
-
-} //TraitTypesResourceImpl
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/util/TraitTypesSwitch.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/util/TraitTypesSwitch.java
deleted file mode 100644
index e3dc79d70..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/util/TraitTypesSwitch.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: TraitTypesSwitch.java,v 1.6 2007/10/01 04:29:44 cbateman Exp $
- */
-package org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.util;
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.*;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Switch</b> for the model's inheritance hierarchy.
- * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
- * to invoke the <code>caseXXX</code> method for each class of the model,
- * starting with the actual class of the object
- * and proceeding up the inheritance hierarchy
- * until a non-null result is returned,
- * which is the result of the switch.
- * <!-- end-user-doc -->
- * @see org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.TraitTypesPackage
- * @generated
- */
-public class TraitTypesSwitch {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
- /**
- * The cached model package
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected static TraitTypesPackage modelPackage;
-
- /**
- * Creates an instance of the switch.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public TraitTypesSwitch() {
- if (modelPackage == null) {
- modelPackage = TraitTypesPackage.eINSTANCE;
- }
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param theEObject
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- public Object doSwitch(EObject theEObject) {
- return doSwitch(theEObject.eClass(), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param theEClass
- * @param theEObject
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected Object doSwitch(EClass theEClass, EObject theEObject) {
- if (theEClass.eContainer() == modelPackage) {
- return doSwitch(theEClass.getClassifierID(), theEObject);
- }
- List eSuperTypes = theEClass.getESuperTypes();
- return
- eSuperTypes.isEmpty() ?
- defaultCase(theEObject) :
- doSwitch((EClass)eSuperTypes.get(0), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param classifierID
- * @param theEObject
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected Object doSwitch(int classifierID, EObject theEObject) {
- switch (classifierID) {
- case TraitTypesPackage.LIST_OF_VALUES: {
- ListOfValues listOfValues = (ListOfValues)theEObject;
- Object result = caseListOfValues(listOfValues);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case TraitTypesPackage.SET_GENERATOR: {
- SetGenerator setGenerator = (SetGenerator)theEObject;
- Object result = caseSetGenerator(setGenerator);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- default: return defaultCase(theEObject);
- }
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>List Of Values</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>List Of Values</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseListOfValues(ListOfValues object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>Set Generator</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>Set Generator</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public Object caseSetGenerator(SetGenerator object) {
- return null;
- }
-
- /**
- * Returns the result of interpretting the object as an instance of '<em>EObject</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch, but this is the last case anyway.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpretting the object as an instance of '<em>EObject</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject)
- * @generated
- */
- public Object defaultCase(EObject object) {
- return null;
- }
-
-} //TraitTypesSwitch
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/util/TraitTypesXMLProcessor.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/util/TraitTypesXMLProcessor.java
deleted file mode 100644
index 2db735611..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/metadata/traittypes/traittypes/internal/util/TraitTypesXMLProcessor.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: TraitTypesXMLProcessor.java,v 1.4 2007/04/16 19:54:18 itrimble Exp $
- */
-package org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.util;
-
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EPackage;
-
-import org.eclipse.emf.ecore.xmi.util.XMLProcessor;
-
-import org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.TraitTypesPackage;
-
-/**
- * This class contains helper methods to serialize and deserialize XML documents
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-public class TraitTypesXMLProcessor extends XMLProcessor {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = "Copyright (c) 2007 Oracle Corporation";
-
-
- /**
- * Public constructor to instantiate the helper.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public TraitTypesXMLProcessor() {
- super((EPackage.Registry.INSTANCE));
- TraitTypesPackage.eINSTANCE.eClass();
- }
-
- /**
- * Register for "*" and "xml" file extensions the TraitTypesResourceFactoryImpl factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected Map getRegistrations() {
- if (registrations == null) {
- super.getRegistrations();
- registrations.put(XML_EXTENSION, new TraitTypesResourceFactoryImpl());
- registrations.put(STAR_EXTENSION, new TraitTypesResourceFactoryImpl());
- }
- return registrations;
- }
-
-} //TraitTypesXMLProcessor
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/AxiomaticSet.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/AxiomaticSet.java
deleted file mode 100644
index 8bc288141..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/AxiomaticSet.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.sets;
-
-import java.util.Set;
-
-/**
- * A java.util.Set with the basic mathematic set axioms of
- * extensionality (equality), union, intersection,
- * relative complement (set subtraction) and empty (already
- * supported by Set).
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author cbateman
- *
- */
-public interface AxiomaticSet extends Set
-{
- /**
- * Implementations should aim to provide O(mn) time cost
- * where n is the number of elements in this set and
- * m is the cost to check membership of an element in this
- * set in toSet. When a set is itself a member of a set,
- * the implementation must call isEquivalent on those subsets
- * recursively.
- *
- * @param toSet
- *
- * @return true iff this set is equivalent toSet. Note
- * that extensionality holds that two sets are equivalent
- * if and only if they contain exactly the same elements.
- *
- *
- */
- boolean isEquivalent(AxiomaticSet toSet);
-
- /**
- * @param set
- * @return the axiomatic union of this set with set
- */
- AxiomaticSet union(AxiomaticSet set);
-
-
- /**
- * @param set
- * @return the axiomatic intersection of this set with set
- */
- AxiomaticSet intersect(AxiomaticSet set);
-
- /**
- * @param set
- * @return convenience method that must be equivalent to
- * (this.intersect(set).isEmpty())
- */
- boolean isDisjoint(AxiomaticSet set);
-
- /**
- * The set constructed by the removing the intersection
- * of this with set from this. The set will contain all
- * elements in this that are not in set.
- *
- * Eqivalence: this - set
- *
- * @param set
- * @return the relative complement or theoretic difference of
- * set from this
- */
- AxiomaticSet subtract(AxiomaticSet set);
-
- /**
- * @return the first element in the set. There is no guarantee which element
- * will be chosen, but the call should always return the same element of the set
- * for multiple invocations on the same set. Generally this is a convience method
- * for when the set only contains one element.
- *
- * @throws java.util.NoSuchElementException if the set is empty.
- */
- Object getFirstElement();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/AxiomaticSetUtil.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/AxiomaticSetUtil.java
deleted file mode 100644
index baf9f8d7a..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/AxiomaticSetUtil.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.sets;
-
-import java.util.Iterator;
-import java.util.Set;
-
-/**
- * Generic (unoptimized) utilities for doing set operations.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author cbateman
- *
- */
-public class AxiomaticSetUtil
-{
- /**
- * Creates the union of firstSet and secondSet in newSet.
- * @param newSet
- * @param firstSet
- * @param secondSet
- */
- public static void union(AxiomaticSet newSet, AxiomaticSet firstSet, AxiomaticSet secondSet)
- {
- newSet.addAll(firstSet);
- newSet.addAll(secondSet);
- }
-
- /**
- * Creates an intersection of firstSet and secondSet in newSet
- * @param newSet
- * @param firstSet
- * @param secondSet
- */
- public static void intersect(AxiomaticSet newSet, AxiomaticSet firstSet, AxiomaticSet secondSet)
- {
- // minor optimization: always iterate through the smaller of the
- // two sets. This way we iterate through the smallest number
- // of elements
- Iterator it = null;
- Set testSet = null;
- // if other set smaller, get its iterator
- if (secondSet.size() < firstSet.size())
- {
- it = secondSet.iterator();
- // test set is other set
- testSet = firstSet;
- }
- // first set is smaller or same
- else
- {
- it = firstSet.iterator();
- testSet = secondSet;
- }
-
- while (it.hasNext())
- {
- Object member = it.next();
- if (testSet.contains(member))
- {
- newSet.add(member);
- }
- }
- }
-
- /**
- * @param firstSet
- * @param secondSet
- * @return true firstSet and secondSet have no common elements (their intersection is empty)
- */
- public static boolean isDisjoint(AxiomaticSet firstSet, AxiomaticSet secondSet)
- {
- return firstSet.intersect(secondSet).isEmpty();
- }
-
- /**
- * @param firstOperand
- * @param secondOperand
- * @return the set formed by removing the intersection of firstOperand and secondOperand
- * from firstOperand, leaving only those elements in firstOperand that are not in secondOperand
- */
- public static AxiomaticSet subtract(
- AxiomaticSet firstOperand, AxiomaticSet secondOperand)
- {
- ConcreteAxiomaticSet relativeComplement = new ConcreteAxiomaticSet();
-
- // iterate through firstOperand and add each element to the result
- // set that is not in secondOperand
- for (final Iterator it = firstOperand.iterator(); it.hasNext();)
- {
- Object member = it.next();
- if (!secondOperand.contains(member))
- {
- relativeComplement.add(member);
- }
- }
-
- return relativeComplement;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/ConcreteAxiomaticSet.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/ConcreteAxiomaticSet.java
deleted file mode 100644
index b82c03fd6..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/ConcreteAxiomaticSet.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.sets;
-
-import java.util.HashSet;
-
-/**
- * Implements a simple axiomatic set based on a hashset
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author cbateman
- *
- */
-public class ConcreteAxiomaticSet extends HashSet implements AxiomaticSet {
-
- /**
- * serial version id
- */
- private static final long serialVersionUID = 7094728081135008203L;
-
- public AxiomaticSet intersect(AxiomaticSet set) {
- AxiomaticSet intersection = new ConcreteAxiomaticSet();
- AxiomaticSetUtil.intersect(intersection, this, set);
- return intersection;
- }
-
- public boolean isEquivalent(AxiomaticSet toSet) {
- return equals(toSet);
- }
-
- public AxiomaticSet union(AxiomaticSet set) {
- AxiomaticSet union = new ConcreteAxiomaticSet();
- AxiomaticSetUtil.union(union, this, set);
- return union;
- }
-
- public boolean isDisjoint(AxiomaticSet set) {
- return AxiomaticSetUtil.isDisjoint(this, set);
- }
-
- public Object getFirstElement() {
- return iterator().next();
- }
-
- public AxiomaticSet subtract(AxiomaticSet set) {
- return AxiomaticSetUtil.subtract(this, set);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/NodeSet.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/NodeSet.java
deleted file mode 100644
index 146b83360..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/NodeSet.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.sets;
-
-import java.util.AbstractSet;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import org.w3c.dom.NodeList;
-
-/**
- * A set backed by a W3C NodeList so as to avoid copying. Note that operations
- * that return new sets still invoke a copy. Also, membership operations
- * require O(n) time. This should generally used for sets that are assumed to be
- * small where O(n) search time will be small compared to doing a full copy.
- *
- * This set is immutable (mutation methods throw exceptions)
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author cbateman
- *
- */
-public class NodeSet extends AbstractSet implements AxiomaticSet
-{
- private NodeList _data;
-
- /**
- * @param data -- wrap the actual data source
- */
- public NodeSet(NodeList data)
- {
- _data = data;
- }
-
- public Iterator iterator() {
- return new Iterator()
- {
- private int pos = 0;
-
- public boolean hasNext() {
- return pos < _data.getLength();
- }
-
- public Object next() {
- return _data.item(pos++);
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- };
- }
-
- public int size() {
- return _data.getLength();
- }
-
- public AxiomaticSet intersect(AxiomaticSet set) {
- ConcreteAxiomaticSet newSet = new ConcreteAxiomaticSet();
- AxiomaticSetUtil.intersect(newSet, this, set);
- return newSet;
- }
-
- public boolean isEquivalent(AxiomaticSet toSet) {
- if (this == toSet)
- {
- return true;
- }
-
- if (toSet instanceof NodeSet
- && ((NodeSet)toSet)._data == this._data)
- {
- return true;
- }
-
- // if different sizes, false
- if (toSet.size() != size())
- {
- return false;
- }
-
- // otherwise, compare item by item
- // Iterator through me with the hope that look ups
- // are more efficent in toSet
- for (Iterator it = iterator(); it.hasNext();)
- {
- Object obj = it.next();
-
- if (!toSet.contains(obj))
- {
- // fail fase on membership mismatch
- return false;
- }
- }
-
- // if we get to here then the item by item match succeeded
- return true;
- }
-
- public AxiomaticSet union(AxiomaticSet set) {
- ConcreteAxiomaticSet newSet = new ConcreteAxiomaticSet();
- AxiomaticSetUtil.union(newSet, this, set);
- return newSet;
- }
-
- public boolean isDisjoint(AxiomaticSet set) {
- return AxiomaticSetUtil.isDisjoint(this, set);
- }
-
- public Object getFirstElement() {
- if (_data.getLength()>0)
- {
- return _data.item(0);
- }
- throw new NoSuchElementException("Set is empty"); //$NON-NLS-1$
- }
-
- public AxiomaticSet subtract(AxiomaticSet set) {
- return AxiomaticSetUtil.subtract(this, set);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/constraint/AbstractMemberConstraint.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/constraint/AbstractMemberConstraint.java
deleted file mode 100644
index d71ebf020..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/constraint/AbstractMemberConstraint.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.sets.constraint;
-
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jst.jsf.common.sets.AxiomaticSet;
-
-/**
- * A set constraint that is specific to members of the set.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author cbateman
- *
- */
-public class AbstractMemberConstraint extends AbstractSetConstraint {
-
- public Diagnostic isSatisfied(AxiomaticSet set) {
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/constraint/AbstractSetConstraint.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/constraint/AbstractSetConstraint.java
deleted file mode 100644
index f176a3775..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/constraint/AbstractSetConstraint.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.sets.constraint;
-
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jst.jsf.common.sets.AxiomaticSet;
-
-/**
- * Super-class of all axiomatic set constraints.
- *
- * A set constraint applies one or more pre-conditions on a set
- * and returns a diagnostic that flags whether or not the set
- * satisfies that constraint or not.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author cbateman
- *
- */
-public abstract class AbstractSetConstraint
-{
- /**
- * The following post-conditions must hold:
- *
- * 1) if the set satisfies the constraint with no caveats,
- * the returned diagnostic must in turn satisfy
- * Diagnostic.getSeverity() == Diagnostic.OK
- *
- * 2) if the set does not satisfy the constraint, the returned diagnostic
- * must satisfy Diagnostic.getSeverity() == Diagnostic.ERROR
- *
- * 3) if the set strictly satisfies the constraint but the constraint includes
- * parameters that can only be heuristically applied, the constraint may choose
- * to return a diagnostic where Diagnostic.getSeverity() == Diagnostic.WARNING
- *
- * The diagnostic returned should _never_ have any other severity but OK, ERROR or WARNING
- *
- * Algorithmically:
- *
- * Constraint is satisfied can be tested by Diagnostic.getSeverity() != ERROR
- * Constraint is not satisfied can be tested by Diagnostic.getSeverity() == ERROR
- *
- * @param set
- * @return a diagnostic object that contains information about whether
- * or not the constraint is satisfied for set.
- * <b>MUST NOT RETURN NULL</b>
- */
- public abstract Diagnostic isSatisfied(AxiomaticSet set);
-
- /**
- * Convenience method
- *
- * @param set
- * @return true if the constraint is satisfied for set
- */
- public final boolean passesConstraint(AxiomaticSet set)
- {
- return isSatisfied(set).getSeverity() != Diagnostic.ERROR;
- }
-
- /**
- * Convenience method
- *
- * @param set
- * @return true if the constraint is <b>not</b> satisfied for set
- */
- public final boolean failsConstraint(AxiomaticSet set)
- {
- return !passesConstraint(set);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/mapping/AbstractObjectInjectiveSetMapping.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/mapping/AbstractObjectInjectiveSetMapping.java
deleted file mode 100644
index 8c2d5b53a..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/mapping/AbstractObjectInjectiveSetMapping.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.sets.mapping;
-
-import java.util.Iterator;
-
-import org.eclipse.jst.jsf.common.sets.AxiomaticSet;
-import org.eclipse.jst.jsf.common.sets.ConcreteAxiomaticSet;
-
-/**
- * Super-class of all ObjectInjectiveSetMapping.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author cbateman
- *
- */
-public abstract class AbstractObjectInjectiveSetMapping implements
- ObjectInjectiveSetMapping {
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.sets.mapping.ObjectInjectiveSetMapping#mapIterator(org.eclipse.jst.jsf.common.sets.AxiomaticSet)
- */
- public Iterator mapIterator(final AxiomaticSet set)
- {
- return new Iterator()
- {
- final Iterator setIterator = set.iterator();
-
- public boolean hasNext()
- {
- return setIterator.hasNext();
- }
-
- public Object next()
- {
- return map(setIterator.next());
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException("cannot modify iterator"); //$NON-NLS-1$
- }
- };
- }
-
- /**
- * @param element
- * @return the result object from the mapping on element
- */
- public abstract Object map(Object element);
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.common.sets.mapping.AxiomaticSetMapping#map(org.eclipse.jst.jsf.common.sets.AxiomaticSet)
- */
- public final AxiomaticSet map(AxiomaticSet set) {
- AxiomaticSet resultSet = new ConcreteAxiomaticSet();
-
- for (final Iterator it = mapIterator(set); it.hasNext();)
- {
- resultSet.add(it.next());
- }
-
- return resultSet;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/mapping/AxiomaticSetMapping.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/mapping/AxiomaticSetMapping.java
deleted file mode 100644
index d6ab1ff51..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/mapping/AxiomaticSetMapping.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.sets.mapping;
-
-import org.eclipse.jst.jsf.common.sets.AxiomaticSet;
-
-/**
- * Defines an axiomatic mapping from set to another. In formal notation, this may
- * also be defined as a "function" or a "proposition".
- *
- * Applying the map method can be seen as being equivalent to:
- *
- * AxiomaticSetMapping: set -> map(set)
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author cbateman
- *
- */
-public interface AxiomaticSetMapping
-{
- /**
- * @param set
- * @return the new set resulting from applying the map to set
- */
- AxiomaticSet map(AxiomaticSet set);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/mapping/ObjectInjectiveSetMapping.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/mapping/ObjectInjectiveSetMapping.java
deleted file mode 100644
index ce33eecc3..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/sets/mapping/ObjectInjectiveSetMapping.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.sets.mapping;
-
-import java.util.Iterator;
-
-import org.eclipse.jst.jsf.common.sets.AxiomaticSet;
-
-/**
- * A type of axiomatic set mapping that operates injectively on the input
- * set to create its result set. Note that the injection (one-to-oneness)
- * of the mapping is based on Java objects and not on the value of the object.
- * Therefore, the result set is not guaranteed to be injective on the basis
- * of value.
- *
- * For example, consider a set of integers:
- *
- * X = {new Integer(4), new Integer(6), new Integer(9)}
- *
- * an ObjectInjectiveSetMapping may be defined that maps this set
- * to a result based on:
- *
- * map(x) = new Boolean(x < 8) for all x in X
- *
- * An ObjectiveInjectiveSetMapping result set would look like this:
- *
- * map(X) = {new Boolean(true), new Boolean(true), new Boolean(false)}
- *
- * Note that boolean TRUE maps twice, so based on the value of the set members,
- * the mapping is not injective. However, each Java object in X maps to a
- * distinct Java object in map(X)
- *
- * This interface should not be implemented by clients. Clients should
- * sub-class AbstractObjectInjectiveSetMapping to avoid future API breakage.
- *
- * <p><b>Provisional API - subject to change</b></p>
- *
- * @author cbateman
- *
- */
-public interface ObjectInjectiveSetMapping extends AxiomaticSetMapping
-{
- /**
- * This method optimizes the case where a client wants to apply some
- * mapping or constraint to each element of a set until a particular
- * condition applies and then stop.
- *
- * Mapping's that implement this
- * interface should generally implement their map(set) method as:
- *
- * for (Iterator it = mapIterator(set); it.hasNext();)
- * {
- * result.add(doMapping(it.next));
- * }
- *
- * @param set
- * @return an iterator that allows a client to apply the mapping
- * one element of set at a time. The iterator is immutable and should
- * throw UnsupportedOperationException if remove() is called.
- */
- public Iterator mapIterator(AxiomaticSet set);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/util/JDTBeanIntrospector.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/util/JDTBeanIntrospector.java
deleted file mode 100644
index e5842337c..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/util/JDTBeanIntrospector.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.util;
-
-import java.beans.Introspector;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.Flags;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.ITypeHierarchy;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.JSFCommonPlugin;
-
-/**
- * A class that does bean introspection on a JDT IType
- *
- * This functionality is not meant to replace runtime bean
- * introspection. Rather, it is meant to provide a
- * more "lightweight" (in terms of class loading as well as
- * error handling of bean instantiation out of context) way
- * to determine a bean's properties at design time.
- *
- * This class may not be sub-classed by clients.
- *
- * @author cbateman
- *
- */
-public class JDTBeanIntrospector
-{
- private final static String GET_PREFIX = "get"; //$NON-NLS-1$
- private final static String SET_PREFIX = "set"; //$NON-NLS-1$
- private final static String IS_PREFIX = "is"; //$NON-NLS-1$
-
- private final IType _type;
-
- /**
- * @param type
- */
- public JDTBeanIntrospector(IType type)
- {
- _type = type;
- }
-
- /**
- * @return an map of all properties with the property names
- * as keys and the values being JDTBeanProperty objects representing
- * the properties.
- */
- public Map<String, JDTBeanProperty> getProperties()
- {
- final Map<String, JDTBeanProperty> propertiesWorkingCopy =
- new HashMap<String, JDTBeanProperty>();
- final IMethod[] methods = getAllMethods();
-
- for (int i = 0; i < methods.length; i++)
- {
- final IMethod method = methods[i];
-
- try
- {
- processPropertyMethod(method, propertiesWorkingCopy);
- }
- catch (JavaModelException jme)
- {
- // log and then proceed to next method
- JSFCommonPlugin.log(jme, "Error processing IMethod for bean property info"); //$NON-NLS-1$
- }
- }
-
- final Map properties = new HashMap();
-
- for (Entry<String, JDTBeanProperty> entry : propertiesWorkingCopy.entrySet())
- {
- final String key = entry.getKey();
- JDTBeanPropertyWorkingCopy wcopy = (JDTBeanPropertyWorkingCopy) entry.getValue();
- properties.put(key, wcopy.toValueObject());
- }
-
- return properties;
- }
-
- private void processPropertyMethod(IMethod method, Map<String, JDTBeanProperty> properties) throws JavaModelException
- {
- // to be a bean method, it must not a constructor, must be public
- // and must not be static
- if (!method.isConstructor()
- && Flags.isPublic(method.getFlags())
- && !Flags.isStatic(method.getFlags()))
- {
- final String methodName = method.getElementName();
- final String returnType = method.getReturnType();
-
- // either starts with get or is boolean and starts with is
-
- // is access must start with 'is', have a boolean return type and no parameters
- final boolean startsWithIs = methodName.startsWith(IS_PREFIX)
- && Signature.SIG_BOOLEAN.equals(returnType)
- && method.getNumberOfParameters() == 0
- && methodName.length() > IS_PREFIX.length();
-
- // get accessor must start with 'get', have no parameters and return non-void
- final boolean startsWithGet = (methodName.startsWith(GET_PREFIX)
- && method.getNumberOfParameters() == 0)
- && !Signature.SIG_VOID.equals(returnType)
- && methodName.length() > GET_PREFIX.length();
-
- // mutator must start with 'set' and have one parameter and a void return type
- final boolean startsWithSet = methodName.startsWith(SET_PREFIX)
- && method.getNumberOfParameters() == 1
- && Signature.SIG_VOID.equals(returnType)
- && methodName.length() > SET_PREFIX.length();
-
- if (startsWithGet || startsWithSet || startsWithIs)
- {
- final String propertyName =
- Introspector.decapitalize(methodName.substring(startsWithIs ? 2 : 3));
-
- JDTBeanPropertyWorkingCopy workingCopy =
- (JDTBeanPropertyWorkingCopy) properties.get(propertyName);
-
- if (workingCopy == null)
- {
- workingCopy = new JDTBeanPropertyWorkingCopy(_type);
- properties.put(propertyName, workingCopy);
- }
-
- if (startsWithIs)
- {
- workingCopy.setIsGetter(method);
- }
- else if (startsWithGet)
- {
- workingCopy.setGetter(method);
- }
- else if (startsWithSet)
- {
- workingCopy.addSetter(method);
- }
- }
- }
- }
-
- /**
- * @return all methods for the type including inherited ones
- */
- public IMethod[] getAllMethods()
- {
- IMethod[] methods = new IMethod[0];
-
- try
- {
- // type not resolved so don't proceed
- if (_type != null)
- {
- // TODO: type hierarchy is potentially expensive, should
- // cache once and listen for changes
- ITypeHierarchy hierarchy = _type.newSupertypeHierarchy(new NullProgressMonitor());
-
- methods = getAllMethods(hierarchy, _type);
- }
- }
- catch(JavaModelException jme)
- {
- JSFCommonPlugin.log(jme, "Error getting type information for bean"); //$NON-NLS-1$
- }
-
- return methods;
- }
-
- /**
- * @param typeHierarchy
- * @param type
- * @return all methods of the type and it's super types
- */
- private static IMethod[] getAllMethods(final ITypeHierarchy typeHierarchy, final IType type)
- {
- final List<IMethod> methods = new ArrayList<IMethod>();
- final IType[] superTypes = typeHierarchy.getAllSuperclasses(type);
- final IType[] closure = new IType[superTypes.length+1];
- closure[0] = type;
- System.arraycopy(superTypes, 0, closure, 1, superTypes.length);
-
- for (int i = 0; i < closure.length; i++)
- {
- try {
- final IType superType = closure[i];
- methods.addAll(Arrays.asList(superType.getMethods()));
- } catch (JavaModelException e) {
- JSFCommonPlugin.log(e, "Error getting super type information for bean"); //$NON-NLS-1$
- }
- }
-
- return methods.toArray(new IMethod[methods.size()]);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/util/JDTBeanProperty.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/util/JDTBeanProperty.java
deleted file mode 100644
index 3f92f8361..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/util/JDTBeanProperty.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.common.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.JSFCommonPlugin;
-
-/**
- * Represents a single bean property backed by JDT data
- *
- * This class may not be sub-classed by clients.
- *
- * @author cbateman
- *
- */
-public class JDTBeanProperty
-{
- /**
- * the IMethod for the accessor (either is or get)
- */
- private IMethod _getter;
-
- /**
- * the IMethod for a "set" accessor method
- */
- private IMethod _setter;
-
- /**
- * The IType that this property belongs to
- */
- protected final IType _type;
-
- /**
- * @param type
- */
- protected JDTBeanProperty(IType type)
- {
- _type = type;
- }
-
- /**
- * @return true if this property is readable
- */
- public boolean isReadable()
- {
- return _getter != null;
- }
-
- /**
- * @return true if this property is writable
- */
- public boolean isWritable()
- {
- return _setter != null;
- }
-
-
- /**
- * @return the get accessor IMethod or null if none
- */
- public IMethod getGetter() {
- return _getter;
- }
-
-
-
- /**
- * Set the get accessor IMethod
- * @param getter -- may be null to indicate none
- */
- void setGetter(IMethod getter) {
- _getter = getter;
- }
-
-
- /**
- * @return the set mutator IMethod or null if none
- */
- public IMethod getSetter() {
- return _setter;
- }
-
- /**
- * @param setter
- */
- void setSetter(IMethod setter) {
- _setter = setter;
- }
-
- /**
- * @return the IType for this property's type or null if it
- * cannot determined. Note that null does not necessarily indicate an error
- * since some types like arrays of things do not have corresponding JDT IType's
- * If typeSignature represents an array, the base element IType is returned
- * if possible
- */
- public IType getType()
- {
- final String typeSignature = Signature.getElementType(getTypeSignature());
- return TypeUtil.resolveType(_type, typeSignature);
- }
-
- /**
- * @return the number of array nesting levels in typeSignature.
- * Returns 0 if not an array.
- */
- public int getArrayCount()
- {
- return Signature.getArrayCount(getTypeSignature());
- }
-
- /**
- * @return true if property is an enum type, false otherwise or if cannot be resolved
- */
- public boolean isEnumType()
- {
- return TypeUtil.isEnumType(getType());
- }
-
- /**
- * Fully equivalent to:
- *
- * getTypeSignature(true)
- *
- * @return the fully resolved (if possible) type signature for
- * the property or null if unable to determine.
- *
- * NOTE: this is the "type erasure" signature, so any type parameters
- * will be removed and only the raw type signature will be returned.
- */
- public String getTypeSignature()
- {
- return getTypeSignature(true);
- }
-
-
- /**
- * @param eraseTypeParameters if true, the returned type has type parameters
- * erased. If false, template types are resolved.
- *
- * @see org.eclipse.jst.jsf.common.util.TypeUtil#resolveTypeSignature(IType, String, boolean)
- * for more information on how specific kinds of unresolved generics are resolved
- *
- * @return the fully resolved (if possible) type signature for
- * the property or null if unable to determine.
- */
- public String getTypeSignature(boolean eraseTypeParameters)
- {
- try
- {
- String unResolvedSig = getUnresolvedType();
- return TypeUtil.resolveTypeSignature(_type, unResolvedSig, eraseTypeParameters);
- }
- catch (JavaModelException jme)
- {
- JSFCommonPlugin.log(jme, "Error resolving bean property type signature"); //$NON-NLS-1$
- return null;
- }
- }
-
- /**
- * For example, if this property was formed from: List<String> getListOfStrings()
- * then the list would consist of the signature "Ljava.lang.String;". All
- * nested type paramters are resolved
- *
- * @see org.eclipse.jst.jsf.common.util.TypeUtil#resolveTypeSignature(IType, String, boolean)
- * for more information on how specific kinds of unresolved generics are resolved
- *
- * @return a list of type signatures (fully resolved if possible)
- * of this property's bounding type parameters.
- */
- public List<String> getTypeParameterSignatures()
- {
- List<String> signatures = new ArrayList<String>();
-
- try
- {
- final String[] typeParameters = Signature.getTypeArguments(getUnresolvedType());
- //System.err.println(getUnresolvedType());
- for (String parameter : typeParameters)
- {
- //System.out.println(parameter);
- signatures.add(TypeUtil.resolveTypeSignature(_type, parameter, false));
- }
- }
- catch (JavaModelException jme)
- {
- JSFCommonPlugin.log(jme, "Error resolving bean property type signature"); //$NON-NLS-1$
- // fall-through and return empty array
- }
-
- return signatures;
- }
-
-// public Map<String, String> getTypeParameterSignatureMap()
-// {
-// Map<String, String> signatures = new HashMap<String, String>();
-//
-// try
-// {
-// final String[] typeParameters = Signature.getTypeArguments(getUnresolvedType());
-//
-// for (String parameter : typeParameters)
-// {
-// signatures.add(TypeUtil.resolveTypeSignature(_type, parameter, false));
-// }
-// }
-// catch (JavaModelException jme)
-// {
-// JSFCommonPlugin.log(jme, "Error resolving bean property type signature"); //$NON-NLS-1$
-// // fall-through and return empty array
-// }
-//
-// return signatures;
-// }
-
- private String getUnresolvedType() throws JavaModelException
- {
- String typeSig = null;
-
- // first decide which method to use; getter always gets precendence
- if (_getter != null)
- {
- typeSig = _getter.getReturnType();
- }
- // TODO: if no getter or setter could we have been created?
- // use setter
- else
- {
- typeSig = _setter.getParameterTypes()[0];
- }
-
- return typeSig;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/util/JDTBeanPropertyWorkingCopy.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/util/JDTBeanPropertyWorkingCopy.java
deleted file mode 100644
index f3bdf1408..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/util/JDTBeanPropertyWorkingCopy.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.common.util;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.jsf.common.JSFCommonPlugin;
-
-/**
- * A writable version of the JDTBeanProperty object
- *
- * This class may not be sub-classed by clients
- *
- * @author cbateman
- *
- */
-public class JDTBeanPropertyWorkingCopy extends JDTBeanProperty
-{
- private final List _setters;
-
- /**
- * the IMethod for the boolean "is" accessor method
- */
- private IMethod _isGetter;
-
- /**
- * Constructor
- * @param type
- */
- public JDTBeanPropertyWorkingCopy(IType type)
- {
- super(type);
- _setters = new ArrayList();
- }
-
- /**
- * @return the bean properties spawned from this working copy
- * Normally, there is only one property in the array, however,
- * since this working copy represents all properties with the same
- * name, there could be multiple properties since setters can
- * be overloaded by name and could result in zero or one readable
- * properties plus zero or more write-only properties with the same
- * name. I can't see anywhere in the spec that covers this
- * boundary case
- */
- public JDTBeanProperty toValueObject()
- {
- // if the isGetter is present that it takes precedence
- // over the the normal getter
- IMethod getter = getIsGetter() != null ?
- getIsGetter() : getGetter();
- IMethod matchedSetter = null;
-
- if (getter != null)
- {
- matchedSetter = determineMatchedSetter(getter);
- }
- // if there's no getter than pick any setter: there
- // are bigger problem when there's no getter than
- // ambiguous setters
- else if (_setters.size() > 0)
- {
- matchedSetter = (IMethod) _setters.get(0);
- }
-
- JDTBeanProperty beanProp = new JDTBeanProperty(_type);
- beanProp.setGetter(getter);
- beanProp.setSetter(matchedSetter);
- return beanProp;
- }
-
- private IMethod determineMatchedSetter(IMethod getter)
- {
- IMethod matchedSetter = null;
-
- try
- {
- final String getterSig =
- TypeUtil.resolveTypeSignature(_type, getter.getReturnType());
-
- FIND_MATCHING_SETTER:for
- (final Iterator it = _setters.iterator(); it.hasNext();)
- {
- final IMethod setter = (IMethod) it.next();
- if (setter.getNumberOfParameters() == 1)
- {
- final String paramSig =
- TypeUtil.resolveTypeSignature
- (_type,setter.getParameterTypes()[0]);
-
- if (paramSig.equals(getterSig))
- {
- // we've found our match since only one
- // setter with the same name as the getter
- // can have the same matching type for a
- // single arg method
- matchedSetter = setter;
- break FIND_MATCHING_SETTER;
- }
- }
- }
- }
- catch (JavaModelException jme)
- {
- JSFCommonPlugin.log(jme, "Error determining getter return type, bean properties analysis may be inaccurate"); //$NON-NLS-1$
- }
-
- return matchedSetter;
- }
-
- //@Override
- public void setGetter(IMethod getter) {
- super.setGetter(getter);
- }
-
- /**
- * @param isGetter
- */
- public void setIsGetter(IMethod isGetter) {
- _isGetter = isGetter;
- }
-
- /**
- * @param setter
- */
- public void addSetter(IMethod setter) {
- if (setter != null
- && setter.getNumberOfParameters() == 1)
- {
- _setters.add(setter);
- }
- }
-
- /**
- * Not supported on working copy. This is synthetically generated
- * on toValueObject()
- * @return nothing; throws exception
- */
- public final IMethod getSetter()
- {
- throw new UnsupportedOperationException("Setter not calculated in working copy. Call toValueObject().getSetter()"); //$NON-NLS-1$
- }
-
- /**
- * @return the "is" getter method or null if not found
- */
- public IMethod getIsGetter() {
- return _isGetter;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/util/TypeUtil.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/util/TypeUtil.java
deleted file mode 100644
index 50041deee..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/util/TypeUtil.java
+++ /dev/null
@@ -1,591 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.common.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.ITypeHierarchy;
-import org.eclipse.jdt.core.ITypeParameter;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.jsf.common.JSFCommonPlugin;
-import org.eclipse.jst.jsf.common.internal.types.TypeConstants;
-
-/**
- * Utility for handling IType's and type signatures
- *
- * Class is static and cannot be extended or instantiated.
- *
- * @author cbateman
- *
- */
-public final class TypeUtil
-{
- static IType resolveType(final IType owningType, final String typeSignature)
- {
- // if type signature is already resolved then simply look it up
- if (typeSignature.charAt(0) == Signature.C_RESOLVED
- || (Signature.getTypeSignatureKind(typeSignature) == Signature.ARRAY_TYPE_SIGNATURE
- && Signature.getElementType(typeSignature).charAt(0) == Signature.C_RESOLVED))
- {
- IType type = null;
-
- try
- {
- type = owningType.getJavaProject().
- findType(getFullyQualifiedName(typeSignature));
- }
- catch (JavaModelException jme)
- {
- // do nothing; return type == null;
- }
-
- return type;
- }
-
-
- return resolveTypeRelative(owningType, typeSignature);
- }
-
- /**
- * Fully equivalent to:
- *
- * #resolveTypeSignature(owningType, typeSignature, true)
- *
- * If resolved, type signature has generic type parameters erased (absent).
- *
- * @param owningType
- * @param typeSignature
- * @return the resolved type signature for typeSignature in owningType or
- * typeSignature unchanged if cannot resolve.
- */
- public static String resolveTypeSignature(final IType owningType, final String typeSignature)
- {
- return resolveTypeSignature(owningType, typeSignature, true);
- }
-
- /**
- * Resolve typeSignature in the context of owningType. This method will return
- * a type erased signture if eraseTypeParameters == true and will attempt to
- * resolve and include parameters if eraseTypeParamters == false
- *
- * NOTE: special rules apply to the way unresolved type parameters and wildcards
- * are resolved:
- *
- * 1) If a fully unresolved type parameter is found, then it will be replaced with Ljava.lang.Object;
- *
- * i.e. List<T> -> Ljava.util.List<Ljava.lang.Object;>; for any unresolved T.
- *
- * 2) Any bounded wildcard will be replaced by the bound:
- *
- * i.e. List<? extends String> -> Ljava.util.List<Ljava.lang.String;>;
- * i.e. List<? super String> -> Ljava.util.List<Ljava.lang.String;>;
- *
- * Note limitation here: bounds that use 'super' will take the "best case" scenario that the list
- * type is of that type.
- *
- * 3) The unbounded wildcard will be replaced by Ljava.lang.Object;
- *
- * i.e. List<?> -> Ljava.util.List<Ljava.lang.Object;>;
- *
- *
- * The reason for this substition is to return the most accurate reasonable approximation
- * of the type within what is known by owningType
- *
- * @param owningType
- * @param typeSignature
- * @param eraseTypeParameters if set to false, type parameters are resolved included
- * in the signature
- * @return the resolved type signature for typeSignature in owningType or
- * typeSignature unchanged if cannot resolve.
- */
- public static String resolveTypeSignature(final IType owningType, final String typeSignature, boolean eraseTypeParameters)
- {
- final int sigKind = Signature.getTypeSignatureKind(typeSignature);
-
- switch (sigKind)
- {
- case Signature.BASE_TYPE_SIGNATURE:
- return typeSignature;
-
- case Signature.ARRAY_TYPE_SIGNATURE:
- {
- final String elementType = Signature.getElementType(typeSignature);
-
- if (Signature.getTypeSignatureKind(elementType) == Signature.BASE_TYPE_SIGNATURE)
- {
- return typeSignature;
- }
-
- final String resolvedElementType = resolveSignatureRelative(owningType, elementType, eraseTypeParameters);
- String resultType = ""; //$NON-NLS-1$
- for (int i = 0; i < Signature.getArrayCount(typeSignature);i++)
- {
- resultType+=Signature.C_ARRAY;
- }
-
- return resultType+resolvedElementType;
- }
-
- case Signature.TYPE_VARIABLE_SIGNATURE:
- return resolveSignatureRelative(owningType, typeSignature, eraseTypeParameters);
-
- case Signature.CLASS_TYPE_SIGNATURE:
- return resolveSignatureRelative(owningType, typeSignature, eraseTypeParameters);
-
- case Signature.WILDCARD_TYPE_SIGNATURE:
- // strip the wildcard and try again. Too bad Signature doesn't seem to have a method
- // for this
- if (typeSignature.charAt(0) == Signature.C_STAR)
- {
- return TypeConstants.TYPE_JAVAOBJECT;
- }
- return resolveTypeSignature(owningType, typeSignature.substring(1), eraseTypeParameters);
-
- case Signature.CAPTURE_TYPE_SIGNATURE:
- // strip the capture and try again
- return resolveTypeSignature(owningType, Signature.removeCapture(typeSignature), eraseTypeParameters);
-// case Signature.TYPE_VARIABLE_SIGNATURE:
-// resolveSignatureRelative(owningType, typeSignature, eraseTypeParameters);
-
- default:
- return typeSignature;
- }
- }
-
- /**
- * @param owningType -- type relative to which typeSignature will be resolved
- * @param typeSignature -- non-array type signature
- * @return the resolved type signature if possible or typeSignature if not
- */
- private static String resolveSignatureRelative(final IType owningType, final String typeSignature, final boolean eraseTypeParameters)
- {
- // if already fully resolved, return the input
- if (typeSignature.charAt(0) == Signature.C_RESOLVED)
- {
- return typeSignature;
- }
-
- List<String> typeParameters = new ArrayList<String>();
-
- IType resolvedType = resolveTypeRelative(owningType, typeSignature);
-
- if (resolvedType != null)
- {
- if (!eraseTypeParameters)
- {
- // ensure that type parameters are resolved recursively
- for (String typeParam : Signature.getTypeArguments(typeSignature))
- {
- typeParam = Signature.removeCapture(typeParam);
- // check and remove bound wildcarding (extends/super/?)
- if (Signature.getTypeSignatureKind(typeParam) == Signature.WILDCARD_TYPE_SIGNATURE)
- {
- // convert ? to Object, strip extends/super
- if (typeParam.charAt(0) == Signature.C_STAR)
- {
- typeParam = TypeConstants.TYPE_JAVAOBJECT;
- }
- else
- {
- typeParam = typeParam.substring(1);
- }
- }
- final String resolvedParameter =
- resolveSignatureRelative(
- // use the enclosing type,
- // *not* the resolved type because
- // we need to resolve in that context
- owningType,
- typeParam, eraseTypeParameters);
- typeParameters.add(resolvedParameter);
- }
- }
-
- final String resolvedTypeSignature =
- Signature.createTypeSignature
- (resolvedType.getFullyQualifiedName(), true);
-
-
- if (typeParameters.size() > 0 && !eraseTypeParameters)
- {
- StringBuffer sb = new StringBuffer(resolvedTypeSignature);
-
- if (sb.charAt(sb.length()-1) == ';')
- {
- sb = sb.delete(sb.length()-1, sb.length());
- }
-
- sb.append("<"); //$NON-NLS-1$
- for(String param : typeParameters)
- {
- //System.out.println("type param: "+resolvedType.getTypeParameter(param));
- sb.append(param);
- }
-
- // replace the dangling ',' with the closing ">"
- sb.append(">;"); //$NON-NLS-1$
- return sb.toString();
- }
-
- return resolvedTypeSignature;
- }
-
- if (Signature.getTypeSignatureKind(typeSignature) ==
- Signature.CLASS_TYPE_SIGNATURE
- || Signature.getTypeSignatureKind(typeSignature)
- == Signature.TYPE_VARIABLE_SIGNATURE)
- {
- // if we are unable to resolve, check to see if the owning type has
- // a parameter by this name
- ITypeParameter typeParam = owningType.getTypeParameter(Signature.getSignatureSimpleName(typeSignature));
-
- // if we have a type parameter and it hasn't been resolved to a type,
- // then assume it is a method template placeholder (i.e. T in ArrayList).
- // at runtime these unresolved parameter variables are effectively
- // turned into Object's. For example, think List.add(E o). At runtime,
- // E will behave exactly like java.lang.Object in that signature
- if (typeParam.exists())
- {
- return TypeConstants.TYPE_JAVAOBJECT;
- }
-
- // TODO: is there a better way to handle a failure to resolve
- // than just garbage out?
- //JSFCommonPlugin.log(new Exception("Failed to resolve type: "+typeSignature), "Failed to resolve type: "+typeSignature); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- return typeSignature;
- }
-
- private static IType resolveTypeRelative(final IType owningType, final String typeSignature)
- {
- final String fullName = getFullyQualifiedName(typeSignature);
-
- IType resolvedType = null;
-
- try
- {
- // TODO: this call is only supported on sourceTypes!
- String[][] resolved = owningType.resolveType(fullName);
-
- if (resolved != null && resolved.length > 0)
- {
- resolvedType = owningType.getJavaProject().findType(resolved[0][0], resolved[0][1]);
- }
- else
- {
- resolvedType = resolveInParents(owningType, fullName);
- }
- }
- catch (JavaModelException jme)
- {
- // do nothing; newType == null
- }
-
- return resolvedType;
- }
-
- /**
- * @param type
- * @return a type signature for a type
- */
- public static String getSignature(IType type)
- {
- final String fullyQualifiedName = type.getFullyQualifiedName();
- return Signature.createTypeSignature(fullyQualifiedName, true);
- }
-
-
- /**
- * @param owner
- * @param unresolvedSignature
- * @return the resolved method signature for unresolvedSignature in owner
- */
- public static String resolveMethodSignature(final IType owner,
- final String unresolvedSignature)
- {
- // get the list of parameters
- final String[] parameters =
- Signature.getParameterTypes(unresolvedSignature);
-
- for (int i = 0; i < parameters.length; i++)
- {
- // try to full resolve the type
- parameters[i] = resolveTypeSignature(owner, parameters[i]);
- }
-
- // resolve return type
- final String resolvedReturn =
- resolveTypeSignature(owner,
- Signature.getReturnType(unresolvedSignature));
-
- return Signature.createMethodSignature(parameters, resolvedReturn);
- }
-
- /**
- * @param typeSignature
- * @return a fully qualified Java class name from a type signature
- * i.e. Ljava.lang.String; -> java.lang.String
- */
- public static String getFullyQualifiedName(final String typeSignature)
- {
- final String packageName = Signature.getSignatureQualifier(typeSignature);
- final String typeName = Signature.getSignatureSimpleName(typeSignature);
- return "".equals(packageName) ? typeName : packageName + "." + typeName; //$NON-NLS-1$//$NON-NLS-2$
- }
-
- private static IType resolveInParents(IType childType, String fullyQualifiedName)
- throws JavaModelException
- {
- IType resolvedType = null;
-
- // not resolved? try the supertypes
- final ITypeHierarchy typeHierarchy =
- childType.newSupertypeHierarchy(new NullProgressMonitor());
- IType[] superTypes = typeHierarchy.getAllSupertypes(childType);
- String[][] resolved;
-
- LOOP_UNTIL_FIRST_MATCH:
- for (int i = 0; i < superTypes.length; i++)
- {
- IType type = superTypes[i];
- resolved = type.resolveType(fullyQualifiedName);
-
- if (resolved != null && resolved.length > 0)
- {
- resolvedType = childType.getJavaProject().findType(resolved[0][0], resolved[0][1]);
- break LOOP_UNTIL_FIRST_MATCH;
- }
- }
-
- return resolvedType;
- }
-
- /**
- * Attempts to get a Java IType for a fully qualified signature. Note that
- * generic type arguments are generally ignored by JDT when doing such
- * look ups.
- *
- * @param javaProject the project context inside which to resolve the type
- * @param fullyResolvedTypeSignature a fully resolved type signature
- * @return the IType if resolved, null otherwise
- */
- public static IType resolveType(final IJavaProject javaProject, final String fullyResolvedTypeSignature)
- {
- final String fullyQualifiedName =
- getFullyQualifiedName(fullyResolvedTypeSignature);
-
- try {
- return javaProject.findType(fullyQualifiedName);
- } catch (JavaModelException e) {
- // accessible problem
- JSFCommonPlugin.log(e);
- return null;
- }
- }
-
- /**
- * @param type
- * @param typeParamSignature -- must be a Type Variable Signature
- * @param typeArguments
- * @return the signature for the type argument in typeArguments that matches the
- * named typeParamSignature in type.
- * @throws IllegalArgumentException if typeParamSignature is not valid
- *
- * For example, given type for java.util.Map, typeParamSignature == "V" and
- * typeArguments = {Ljava.util.String;, Lcom.test.Blah;}, the result would be
- * the typeArgument that matches "V", which is "Lcom.test.Blah;}
- *
- * returns null if the match cannot be found.
- */
- public static String matchTypeParameterToArgument(final IType type, final String typeParamSignature, final List<String> typeArguments)
- {
- if (Signature.getTypeSignatureKind(typeParamSignature) != Signature.TYPE_VARIABLE_SIGNATURE)
- {
- throw new IllegalArgumentException();
- }
-
- try
- {
- ITypeParameter[] typeParams = type.getTypeParameters();
-
- for (int pos = 0; pos < typeParams.length; pos++)
- {
- if (typeParams[pos].getElementName().equals(Signature.getSignatureSimpleName(typeParamSignature)))
- {
- if (pos < typeArguments.size())
- {
- // TODO: should typeArguments.size ever != typeParams.length?
- return typeArguments.get(pos);
- }
- }
- }
- }
- catch (JavaModelException e)
- {
- JSFCommonPlugin.log(e);
- }
-
- return null;
- }
-
- /**
- * @param type
- * @param fieldName
- * @return true if fieldName is a member of type. Note that if type is java.lang.Enum
- * then this will always return true since we cannot know what fields the instance has (it could be any enum)
- */
- public static boolean isEnumMember(final IType type, final String fieldName)
- {
- try
- {
- if (type == null || !isEnumType(type))
- {
- throw new IllegalArgumentException("type must be non-null and isEnum()==true"); //$NON-NLS-1$
- }
-
- if (fieldName == null)
- {
- throw new IllegalArgumentException("fieldName must be non-null"); //$NON-NLS-1$
- }
-
- // if type is the java.lang.Enum, always true
- if (TypeConstants.TYPE_ENUM_BASE.equals(Signature.createTypeSignature(type.getFullyQualifiedName(), true)))
- {
- return true;
- }
-
- final IField field = type.getField(fieldName);
-
- if (field.exists() && field.isEnumConstant())
- {
- return true;
- }
- }
- catch (JavaModelException jme)
- {
- // fall through and return false
- }
-
- return false;
- }
-
- /**
- * @param typeSig1 the type signature of the first enum. Must be non-null, fully resolved enum type.
- * @param typeSig2 the type signature of the second enum. Must be non-null, fully resolved enum type.
- *
- * @return true if typeSig1.compareTo(typeSig2) is a legal operation (won't throw a CCE)
- */
- public static boolean isEnumsCompareCompatible(final String typeSig1, final String typeSig2)
- {
- if (typeSig1 == null || typeSig2 == null)
- {
- throw new IllegalArgumentException("args must not be null"); //$NON-NLS-1$
- }
-
- if (Signature.getTypeSignatureKind(typeSig1) != Signature.CLASS_TYPE_SIGNATURE
- || Signature.getTypeSignatureKind(typeSig2) != Signature.CLASS_TYPE_SIGNATURE)
- {
- throw new IllegalArgumentException("args must be resolved class types"); //$NON-NLS-1$
- }
-
- // if one or the other is the raw enum type, then they *may* be comparable; we don't know
- if (TypeConstants.TYPE_ENUM_BASE.equals(typeSig1)
- || TypeConstants.TYPE_ENUM_BASE.equals(typeSig2))
- {
- return true;
- }
-
- // TODO: support the case of enum base type with generic type argument
-
- // only comparable if is the same class
- return typeSig1.equals(typeSig2);
- }
-
- /**
- * @param typeSig1 the type signature of the first enum. Must be non-null, fully resolved enum type.
- * @param typeSig2 the type signature of the second enum. Must be non-null, fully resolved enum type.
- * @return true if instances typeSig1 and typeSig2 can never be equal due
- * their being definitively different enum types
- */
- public static boolean canNeverBeEqual(final String typeSig1, final String typeSig2)
- {
- if (typeSig1 == null || typeSig2 == null)
- {
- throw new IllegalArgumentException("args must not be null"); //$NON-NLS-1$
- }
-
- if (Signature.getTypeSignatureKind(typeSig1) != Signature.CLASS_TYPE_SIGNATURE
- || Signature.getTypeSignatureKind(typeSig2) != Signature.CLASS_TYPE_SIGNATURE)
- {
- throw new IllegalArgumentException("args must be resolved class types"); //$NON-NLS-1$
- }
-
- // if either one is the base enum type, then we can't be sure
- if (TypeConstants.TYPE_ENUM_BASE.equals(typeSig1)
- || TypeConstants.TYPE_ENUM_BASE.equals(typeSig2))
- {
- return false;
- }
-
- // if they are definitely not the same enum types, then their values
- // can never be equal
- return !typeSig1.equals(typeSig2);
- }
-
-
- /**
- * NOTE: we diverge from IType.isEnum() because we also return true if the base type
- * is a java.lang.Enum since we consider this to be "any enumeration type" whereas JDT considers
- * it merely a class since it doesn't use an "enum" keyword declaration.
- * @param type
- * @return true if type is an enum type or is java.lang.Enum
- */
- static boolean isEnumType(IType type)
- {
- if (type == null)
- {
- return false;
- }
-
- // check if it's the enumeration base type
- if (TypeConstants.TYPE_ENUM_BASE.equals(Signature.createTypeSignature(type.getFullyQualifiedName(), true)))
- {
- return true;
- }
-
- try
- {
- return type.isEnum();
- }
- catch (JavaModelException jme)
- {
- // log and fallthrough to return false
- JSFCommonPlugin.log(jme, "Problem resolving isEnum"); //$NON-NLS-1$
- }
-
- // if unresolved assume false
- return false;
- }
-
- private TypeUtil()
- {
- // no external instantiation
- }
-}

Back to the top