Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 167972 | Differences between
and this patch

Collapse All | Expand All

(-)plugin-src/src/org/eclipse/emf/validation/model/CategoryManager.java (-6 / +26 lines)
Lines 17-22 Link Here
17
17
18
import org.eclipse.core.runtime.IConfigurationElement;
18
import org.eclipse.core.runtime.IConfigurationElement;
19
import org.eclipse.core.runtime.Platform;
19
import org.eclipse.core.runtime.Platform;
20
import org.eclipse.emf.common.EMFPlugin;
20
import org.eclipse.emf.validation.internal.EMFModelValidationDebugOptions;
21
import org.eclipse.emf.validation.internal.EMFModelValidationDebugOptions;
21
import org.eclipse.emf.validation.internal.EMFModelValidationPlugin;
22
import org.eclipse.emf.validation.internal.EMFModelValidationPlugin;
22
import org.eclipse.emf.validation.internal.l10n.ValidationMessages;
23
import org.eclipse.emf.validation.internal.l10n.ValidationMessages;
Lines 230-248 Link Here
230
	 * point.
231
	 * point.
231
	 */
232
	 */
232
	private void loadCategories() {
233
	private void loadCategories() {
233
		IConfigurationElement[] elements = Platform.getExtensionRegistry().getExtensionPoint(
234
		IConfigurationElement[] elements = new IConfigurationElement[0];
235
		if (EMFPlugin.IS_ECLIPSE_RUNNING) {
236
			elements = Platform.getExtensionRegistry().getExtensionPoint(
234
				EMFModelValidationPlugin.getPluginId(),
237
				EMFModelValidationPlugin.getPluginId(),
235
				EMFModelValidationPlugin.CONSTRAINT_PROVIDERS_EXT_P_NAME)
238
				EMFModelValidationPlugin.CONSTRAINT_PROVIDERS_EXT_P_NAME)
236
					.getConfigurationElements();
239
					.getConfigurationElements();
237
		
238
		for (IConfigurationElement next : elements) {
239
			if (next.getName().equals(XmlConfig.E_CATEGORY)) {
240
				loadCategories(globalCategory, next);
241
			}
242
		}
240
		}
241
		configureCategories(elements);
243
	}
242
	}
244
	
243
	
245
	/**
244
	/**
245
	 * <p>
246
	 * Configures my categories from the Eclipse configuration
247
	 * <code>elements</code>
248
	 * </p>
249
	 * <p>
250
	 * <b>NOTE</b> that this method should only be called by the EMF Model
251
	 * Validation Plug-in, not by any client code!
252
	 * </p>
253
	 * 
254
	 * @param elements 
255
	 */
256
	public void configureCategories(IConfigurationElement[] elements) {
257
	     for (int i = 0; i < elements.length; i++) {
258
	        IConfigurationElement next = elements[i];	        
259
	        if (next.getName().equals(XmlConfig.E_CATEGORY)) {
260
	            loadCategories(globalCategory, next);
261
	        }
262
	     }        
263
	}	
264
	
265
	/**
246
	 * Loads subcategories of the specified <code>parent</code> category.
266
	 * Loads subcategories of the specified <code>parent</code> category.
247
	 * @param parent
267
	 * @param parent
248
	 * @param element
268
	 * @param element
(-)plugin-src/src/org/eclipse/emf/validation/preferences/EMFModelValidationPreferences.java (-1 / +2 lines)
Lines 14-19 Link Here
14
14
15
import org.eclipse.core.runtime.Preferences;
15
import org.eclipse.core.runtime.Preferences;
16
16
17
import org.eclipse.emf.common.EMFPlugin;
17
import org.eclipse.emf.validation.internal.EMFModelValidationPlugin;
18
import org.eclipse.emf.validation.internal.EMFModelValidationPlugin;
18
import org.eclipse.emf.validation.service.ConstraintRegistry;
19
import org.eclipse.emf.validation.service.ConstraintRegistry;
19
import org.eclipse.emf.validation.service.IConstraintDescriptor;
20
import org.eclipse.emf.validation.service.IConstraintDescriptor;
Lines 27-33 Link Here
27
	static final String CONSTRAINT_DISABLED_PREFIX = "con.disabled/"; //$NON-NLS-1$
28
	static final String CONSTRAINT_DISABLED_PREFIX = "con.disabled/"; //$NON-NLS-1$
28
	
29
	
29
	private static final Preferences prefs =
30
	private static final Preferences prefs =
30
		EMFModelValidationPlugin.getPlugin().getPluginPreferences();
31
		(!EMFPlugin.IS_ECLIPSE_RUNNING)?new Preferences():EMFModelValidationPlugin.getPlugin().getPluginPreferences();
31
	
32
	
32
	/**
33
	/**
33
	 * Not instantiable, as all features are static.
34
	 * Not instantiable, as all features are static.
(-)plugin-src/src/org/eclipse/emf/validation/internal/service/TraversalStrategyManager.java (-3 / +5 lines)
Lines 18-23 Link Here
18
import org.eclipse.core.runtime.CoreException;
18
import org.eclipse.core.runtime.CoreException;
19
import org.eclipse.core.runtime.IConfigurationElement;
19
import org.eclipse.core.runtime.IConfigurationElement;
20
import org.eclipse.core.runtime.Platform;
20
import org.eclipse.core.runtime.Platform;
21
import org.eclipse.emf.common.EMFPlugin;
21
import org.eclipse.emf.ecore.EClass;
22
import org.eclipse.emf.ecore.EClass;
22
import org.eclipse.emf.ecore.EClassifier;
23
import org.eclipse.emf.ecore.EClassifier;
23
import org.eclipse.emf.ecore.EObject;
24
import org.eclipse.emf.ecore.EObject;
Lines 95-105 Link Here
95
	 * required by a validation operation.
96
	 * required by a validation operation.
96
	 */
97
	 */
97
	private void initStrategies() {
98
	private void initStrategies() {
98
		IConfigurationElement[] strats =
99
		IConfigurationElement[] strats = new IConfigurationElement[0];
99
			Platform.getExtensionRegistry().getConfigurationElementsFor(
100
		if (EMFPlugin.IS_ECLIPSE_RUNNING) {		
101
			strats = Platform.getExtensionRegistry().getConfigurationElementsFor(
100
				EMFModelValidationPlugin.getPluginId(),
102
				EMFModelValidationPlugin.getPluginId(),
101
				TRAVERSAL_EXT_P_NAME);
103
				TRAVERSAL_EXT_P_NAME);
102
		
104
		}
103
		for (int i = 0; i < strats.length; i++) {
105
		for (int i = 0; i < strats.length; i++) {
104
			IConfigurationElement config = strats[i];
106
			IConfigurationElement config = strats[i];
105
			
107
			
(-)plugin-src/src/org/eclipse/emf/validation/internal/EMFModelValidationPlugin.java (-2 / +66 lines)
Lines 12-27 Link Here
12
12
13
package org.eclipse.emf.validation.internal;
13
package org.eclipse.emf.validation.internal;
14
14
15
import java.net.URL;
15
import java.util.Collection;
16
import java.util.Collection;
16
import java.util.HashMap;
17
import java.util.HashMap;
17
import java.util.Iterator;
18
import java.util.Iterator;
18
import java.util.Map;
19
import java.util.Map;
19
20
21
import org.eclipse.core.runtime.CoreException;
22
import org.eclipse.core.runtime.IConfigurationElement;
20
import org.eclipse.core.runtime.IStatus;
23
import org.eclipse.core.runtime.IStatus;
21
import org.eclipse.core.runtime.Status;
24
import org.eclipse.core.runtime.Status;
22
import org.eclipse.emf.common.EMFPlugin;
25
import org.eclipse.emf.common.EMFPlugin;
23
import org.eclipse.emf.common.util.ResourceLocator;
26
import org.eclipse.emf.common.util.ResourceLocator;
24
import org.eclipse.emf.validation.internal.l10n.ValidationMessages;
27
import org.eclipse.emf.validation.internal.l10n.ValidationMessages;
28
import org.eclipse.emf.validation.internal.service.ClientContextManager;
29
import org.eclipse.emf.validation.internal.util.XmlConstraintFactory;
30
import org.eclipse.emf.validation.model.CategoryManager;
31
import org.eclipse.emf.validation.service.ConstraintFactory;
32
import org.eclipse.emf.validation.service.ModelValidationService;
33
import org.eclipse.emf.validation.util.XmlConfig;
25
import org.eclipse.osgi.util.NLS;
34
import org.eclipse.osgi.util.NLS;
26
35
27
/**
36
/**
Lines 166-171 Link Here
166
		new EMFModelValidationPlugin();
175
		new EMFModelValidationPlugin();
167
176
168
	private static Implementation plugin;
177
	private static Implementation plugin;
178
	
179
	/**
180
	 * Flag to track standalone configuration, that should happen once
181
	 * to prevent multiple registration of constraint providers, parsers, 
182
	 * etc. 
183
	 */
184
	private boolean alreadyConfigured = false;	
169
185
170
	/**
186
	/**
171
	 * Initializes me.
187
	 * Initializes me.
Lines 174-179 Link Here
174
		super(new ResourceLocator[]{});
190
		super(new ResourceLocator[]{});
175
	}
191
	}
176
192
193
	/**
194
	 * Configures parsers, constraint providers, categories and constraint bindings
195
	 * from the given XML document <code>urls</code> in standalone mode (no Eclipse).
196
	 * <p>
197
	 * At a minimum one URL should refer to the <code>org.eclipse.emf.validation</code> plugin descriptor. For example:
198
	 * <pre>jar:file:///c:/mydir/lib/org.eclipse.emf.validation_1.1.0.v200705301635.jar!/plugin.xml</pre>
199
	 * and another URL should refer to the user contributed constraint providers. For example:
200
	 * <pre>file:///c:/mydir/plugin.xml</pre>
201
	 * To enable support for OCL constraints, add a URL to the <code>org.eclipse.emf.validation.ocl</code> plugin descriptor. For example:
202
	 * <pre>jar:file:///c:/mydir/lib/org.eclipse.emf.validation.ocl_1.1.0.v200705301635.jar!/plugin.xml</pre> 
203
	 * 
204
	 * @param urls the locations of the XML documents to use for standalone initialization. 
205
	 * @throws CoreException on any problem parsing an XML file
206
	 */
207
	public void configureStandalone(URL[] urls) throws CoreException {
208
	    assert urls != null;
209
	    if (!EMFPlugin.IS_ECLIPSE_RUNNING && !alreadyConfigured) {
210
	        alreadyConfigured = true;
211
	        for (int i=0; i < urls.length; i++) {
212
	             IConfigurationElement element = XmlConfig.load(urls[i]);
213
	             // Configure any defined parsers                
214
	             IConfigurationElement[] parsers = 
215
	            	 XmlConfig.findExtensionPoint(getPluginId() + "." + XmlConstraintFactory.CONSTRAINT_PARSERS_EXT_P_NAME, element);
216
	             if (parsers != null) { 
217
	                 ((XmlConstraintFactory)ConstraintFactory.getInstance()).configureParsers(parsers);
218
	             }
219
	             // Configure any defined constraint providers and categories               
220
	             IConfigurationElement[] providers = 
221
	                 XmlConfig.findExtensionPoint(getPluginId() + "." + CONSTRAINT_PROVIDERS_EXT_P_NAME, element);
222
	             if (providers != null) {
223
	                 ModelValidationService.getInstance().configureProviders(providers);
224
	                 CategoryManager.getInstance().configureCategories(providers);
225
	             }
226
                 // Configure any defined constraint bindings
227
	             IConfigurationElement[] bindings = 
228
	                 XmlConfig.findExtensionPoint(getPluginId() + "." + CONSTRAINT_BINDINGS_EXT_P_NAME, element);
229
	             if (bindings != null) {
230
	                 ClientContextManager.getInstance().configureConstraintBindings(bindings);
231
	             }                
232
	         }
233
	     }
234
	}
235
	
177
	// implements the inherited method
236
	// implements the inherited method
178
	@Override
237
	@Override
179
	public ResourceLocator getPluginResourceLocator() {
238
	public ResourceLocator getPluginResourceLocator() {
Lines 195-201 Link Here
195
	 * @return my plug-in unique ID
254
	 * @return my plug-in unique ID
196
	 */
255
	 */
197
	public static String getPluginId() {
256
	public static String getPluginId() {
198
		return getPlugin().getBundle().getSymbolicName();
257
		if (!EMFPlugin.IS_ECLIPSE_RUNNING) {
258
			return "org.eclipse.emf.validation";
259
		}
260
		else {
261
			return getPlugin().getBundle().getSymbolicName();
262
		}
199
	}
263
	}
200
264
201
	/**
265
	/**
Lines 229-235 Link Here
229
    	 * 
293
    	 * 
230
    	 */
294
    	 */
231
    	protected static boolean shouldTrace() {
295
    	protected static boolean shouldTrace() {
232
    		return plugin.isDebugging();
296
    		return (!EMFPlugin.IS_ECLIPSE_RUNNING)?false:plugin.isDebugging();
233
    	}
297
    	}
234
298
235
    	/**
299
    	/**
(-)plugin-src/src/org/eclipse/emf/validation/internal/util/ConstraintsContentHandler.java (+5 lines)
Lines 31-36 Link Here
31
import org.xml.sax.SAXParseException;
31
import org.xml.sax.SAXParseException;
32
import org.xml.sax.helpers.DefaultHandler;
32
import org.xml.sax.helpers.DefaultHandler;
33
33
34
import org.eclipse.emf.common.EMFPlugin;
34
import org.eclipse.emf.validation.internal.EMFModelValidationPlugin;
35
import org.eclipse.emf.validation.internal.EMFModelValidationPlugin;
35
import org.eclipse.emf.validation.internal.EMFModelValidationStatusCodes;
36
import org.eclipse.emf.validation.internal.EMFModelValidationStatusCodes;
36
37
Lines 529-534 Link Here
529
		if ((s == null) || !s.startsWith("%")) { //$NON-NLS-1$
530
		if ((s == null) || !s.startsWith("%")) { //$NON-NLS-1$
530
			return s;
531
			return s;
531
		} else if (resourceBundle == null) {
532
		} else if (resourceBundle == null) {
533
			// FIXME Localize in standalone mode           
534
			if (!EMFPlugin.IS_ECLIPSE_RUNNING) {                
535
				return s;               
536
			}     			
532
			return Platform.getResourceString(
537
			return Platform.getResourceString(
533
					Platform.getBundle(extension.getNamespaceIdentifier()),
538
					Platform.getBundle(extension.getNamespaceIdentifier()),
534
					s);
539
					s);
(-)plugin-src/src/org/eclipse/emf/validation/internal/util/Log.java (-3 / +23 lines)
Lines 16-21 Link Here
16
16
17
import org.eclipse.core.runtime.IStatus;
17
import org.eclipse.core.runtime.IStatus;
18
import org.eclipse.core.runtime.Status;
18
import org.eclipse.core.runtime.Status;
19
import org.eclipse.emf.common.EMFPlugin;
19
import org.eclipse.emf.validation.internal.EMFModelValidationPlugin;
20
import org.eclipse.emf.validation.internal.EMFModelValidationPlugin;
20
21
21
/**
22
/**
Lines 141-148 Link Here
141
		
142
		
142
		Status s = new Status(severity, EMFModelValidationPlugin.getPluginId(),
143
		Status s = new Status(severity, EMFModelValidationPlugin.getPluginId(),
143
			code, message, throwable);
144
			code, message, throwable);
144
145
		if (!EMFPlugin.IS_ECLIPSE_RUNNING) {
145
		EMFModelValidationPlugin.getPlugin().log(s);
146
			if (s.isOK()) {
147
				System.out.println(s);
148
			}
149
			else {
150
				System.err.println(s);
151
			}			
152
		}
153
		else {
154
			EMFModelValidationPlugin.getPlugin().log(s);
155
		}
146
	}
156
	}
147
157
148
	/**
158
	/**
Lines 154-160 Link Here
154
	 * @param status The status object on which to base the log.
164
	 * @param status The status object on which to base the log.
155
	 */
165
	 */
156
	public static void log(IStatus status) {
166
	public static void log(IStatus status) {
157
		EMFModelValidationPlugin.getPlugin().log(status);
167
		if (!EMFPlugin.IS_ECLIPSE_RUNNING) {
168
			if (status.isOK()) {
169
				System.out.println(status);
170
			}
171
			else {
172
				System.err.println(status);
173
			}						
174
		}
175
		else {
176
			EMFModelValidationPlugin.getPlugin().log(status);
177
		}
158
	}
178
	}
159
179
160
	/**
180
	/**
(-)plugin-src/src/org/eclipse/emf/validation/internal/util/XmlConfigurationElement.java (-5 / +13 lines)
Lines 91-102 Link Here
91
	 */
91
	 */
92
	public Object createExecutableExtension(String propertyName)
92
	public Object createExecutableExtension(String propertyName)
93
			throws CoreException {
93
			throws CoreException {
94
		
94
		Object result = null;
95
		String message = EMFModelValidationPlugin.getMessage(
95
		String className = getAttribute(propertyName);
96
		try {
97
			Class<?> clazz = this.getClass().getClassLoader().loadClass(className);
98
			result = clazz.newInstance();
99
		}
100
		catch (Exception ex) {
101
			String message = EMFModelValidationPlugin.getMessage(		
96
				EMFModelValidationStatusCodes.XML_CREATE_EXTENSION_MSG,
102
				EMFModelValidationStatusCodes.XML_CREATE_EXTENSION_MSG,
97
				new Object[] {getName()});
103
				new Object[] {getName()});
98
		
104
		
99
		CoreException ce = new CoreException(
105
			CoreException ce = new CoreException(
100
				new Status(
106
				new Status(
101
						IStatus.ERROR,
107
						IStatus.ERROR,
102
						EMFModelValidationPlugin.getPluginId(),
108
						EMFModelValidationPlugin.getPluginId(),
Lines 104-111 Link Here
104
						message,
110
						message,
105
						null));
111
						null));
106
		
112
		
107
		Trace.throwing(getClass(), "createExecutableExtension", ce); //$NON-NLS-1$
113
			Trace.throwing(getClass(), "createExecutableExtension", ce); //$NON-NLS-1$
108
		throw ce;
114
			throw ce;
115
		}
116
		return result;
109
	}
117
	}
110
118
111
	// implements the interface method
119
	// implements the interface method
(-)plugin-src/src/org/eclipse/emf/validation/internal/util/JavaConstraintParser.java (-2 / +7 lines)
Lines 157-164 Link Here
157
		Bundle bundle = Platform.getBundle(bundleName);
157
		Bundle bundle = Platform.getBundle(bundleName);
158
		
158
		
159
		try {
159
		try {
160
			Class<?> resultType = bundle.loadClass(className);
160
			Class<?> resultType = null;
161
161
			if (bundle == null) {
162
				resultType = this.getClass().getClassLoader().loadClass(className);
163
			}
164
			else {
165
				resultType = bundle.loadClass(className);
166
			}			
162
			if (AbstractModelConstraint.class.isAssignableFrom(resultType)) {
167
			if (AbstractModelConstraint.class.isAssignableFrom(resultType)) {
163
				// instantiate the class extending AbstractModelConstraint
168
				// instantiate the class extending AbstractModelConstraint
164
				result = new ConstraintAdapter(
169
				result = new ConstraintAdapter(
(-)plugin-src/src/org/eclipse/emf/validation/internal/util/XmlConstraintFactory.java (-4 / +12 lines)
Lines 43-49 Link Here
43
	/**
43
	/**
44
	 * Extension point name for the model providers extension point.
44
	 * Extension point name for the model providers extension point.
45
	 */
45
	 */
46
	private static final String CONSTRAINT_PARSERS_EXT_P_NAME =
46
	public static final String CONSTRAINT_PARSERS_EXT_P_NAME =
47
			"constraintParsers"; //$NON-NLS-1$
47
			"constraintParsers"; //$NON-NLS-1$
48
48
49
	/** Mapping of language names to parser implementations. */
49
	/** Mapping of language names to parser implementations. */
Lines 115-120 Link Here
115
		}
115
		}
116
	}
116
	}
117
	
117
	
118
	public void configureParsers(IConfigurationElement[] elements) {
119
		for (int i = 0; i < elements.length; i++) {
120
			registerParser(elements[i]);
121
		}
122
	}
123
	
118
	@SuppressWarnings("deprecation")
124
	@SuppressWarnings("deprecation")
119
	protected IModelConstraint createConstraint(IParameterizedConstraintDescriptor descriptor) {
125
	protected IModelConstraint createConstraint(IParameterizedConstraintDescriptor descriptor) {
120
		final String lang = descriptor.getLanguage();
126
		final String lang = descriptor.getLanguage();
Lines 210-220 Link Here
210
	 * extension point.
216
	 * extension point.
211
	 */
217
	 */
212
	private void initializeParsers() {
218
	private void initializeParsers() {
213
		IConfigurationElement[] configs = 
219
		IConfigurationElement[] configs = new IConfigurationElement[0];
214
			Platform.getExtensionRegistry().getConfigurationElementsFor(
220
		if (Platform.getExtensionRegistry() != null) {
221
			configs = 
222
				Platform.getExtensionRegistry().getConfigurationElementsFor(
215
				EMFModelValidationPlugin.getPluginId(),
223
				EMFModelValidationPlugin.getPluginId(),
216
				CONSTRAINT_PARSERS_EXT_P_NAME);
224
				CONSTRAINT_PARSERS_EXT_P_NAME);
217
225
		}
218
		for (IConfigurationElement config : configs) {
226
		for (IConfigurationElement config : configs) {
219
			registerParser(config);
227
			registerParser(config);
220
		}
228
		}
(-)plugin-src/src/org/eclipse/emf/validation/util/XmlConfig.java (+179 lines)
Lines 20-26 Link Here
20
20
21
import org.eclipse.core.runtime.CoreException;
21
import org.eclipse.core.runtime.CoreException;
22
import org.eclipse.core.runtime.IConfigurationElement;
22
import org.eclipse.core.runtime.IConfigurationElement;
23
import org.eclipse.core.runtime.IContributor;
24
import org.eclipse.core.runtime.IExtension;
25
import org.eclipse.core.runtime.IPluginDescriptor;
23
import org.eclipse.core.runtime.IStatus;
26
import org.eclipse.core.runtime.IStatus;
27
import org.eclipse.core.runtime.InvalidRegistryObjectException;
24
import org.eclipse.core.runtime.Platform;
28
import org.eclipse.core.runtime.Platform;
25
import org.eclipse.core.runtime.Status;
29
import org.eclipse.core.runtime.Status;
26
import org.eclipse.emf.validation.internal.EMFModelValidationDebugOptions;
30
import org.eclipse.emf.validation.internal.EMFModelValidationDebugOptions;
Lines 351-356 Link Here
351
				element.getDeclaringExtension().getNamespaceIdentifier()).getEntry("/"); //$NON-NLS-1$
355
				element.getDeclaringExtension().getNamespaceIdentifier()).getEntry("/"); //$NON-NLS-1$
352
		}
356
		}
353
	}
357
	}
358
	
359
	/**
360
	 * Loads a configuration element from the specified <code>url</code>
361
	 * 
362
	 * @param url the location of the XML document
363
	 * @return the configuration element representing the XML document
364
	 * @throws CoreException on any problem parsing an XML file
365
	 * @see #load(IConfigurationElement, URL)
366
	 */
367
	public static IConfigurationElement load(URL url) 
368
	    throws CoreException {
369
	        return load(new DummyConfigurationElement(), url);
370
	}	
354
371
355
	/**
372
	/**
356
	 * Loads a <tt>&lt;constraints&gt;</tt> element from the specified
373
	 * Loads a <tt>&lt;constraints&gt;</tt> element from the specified
Lines 410-415 Link Here
410
		}
427
		}
411
	}
428
	}
412
	
429
	
430
    /**
431
	 * Returns the children of the configuration element that matches the given
432
	 * <code>extensionPoint</code>, searches recursively the given parent element. 
433
	 *  
434
	 * @param extensionPoint The name of the extension point to match
435
	 * @param parent The top level configuration element to search 
436
	 * @return the matching configuration element children or null if not found
437
	 */
438
	public static IConfigurationElement[] findExtensionPoint(String extensionPoint, IConfigurationElement parent) {
439
	    if (parent.getAttribute("point") != null && parent.getAttribute("point").equals(extensionPoint)) {
440
	        return parent.getChildren();
441
	    }
442
	    else {
443
	        // Recurse
444
	        IConfigurationElement[] children = parent.getChildren();
445
	        if (children != null) {
446
	        	for (int i = 0; i < children.length; i++) {
447
	                IConfigurationElement[] result = findExtensionPoint(extensionPoint, children[i]);
448
	                if (result != null) {
449
	                    return result;
450
	                }
451
	            } 
452
	        }
453
	    }
454
	    return null;
455
	}
456
	
413
	/**
457
	/**
414
	 * Flushes the resource bundles that were loaded for localization of strings
458
	 * Flushes the resource bundles that were loaded for localization of strings
415
	 * in an XML constraint provider's XML constraint declarations.
459
	 * in an XML constraint provider's XML constraint declarations.
Lines 440-443 Link Here
440
484
441
        return result;
485
        return result;
442
    }
486
    }
487
    
488
    // Inner classes
489
    
490
    /**
491
     * A mock configuration element used to supply a valid extension namespace identifier  
492
     * <p>
493
     * This class is not intended to be used outside of the validation framework.
494
     * </p>
495
     * @see XmlConfig#load(URL)
496
     */
497
    private static class DummyConfigurationElement implements IConfigurationElement {
498
           
499
        IExtension dummyExtension = new DummyExtension("org.eclipse.emf.validation.internal");
500
            
501
        public IExtension getDeclaringExtension() throws InvalidRegistryObjectException {
502
            return dummyExtension;
503
        }
504
            
505
        // Unused Methods
506
           
507
        public Object createExecutableExtension(String propertyName) throws CoreException {
508
            return null;
509
        }
510
    
511
        public String getAttribute(String name) throws InvalidRegistryObjectException {
512
            return null;
513
        }
514
    
515
        public String getAttributeAsIs(String name) throws InvalidRegistryObjectException {
516
            return null;
517
        }
518
    
519
        public String[] getAttributeNames() throws InvalidRegistryObjectException {
520
            return null;
521
        }
522
    
523
        public IConfigurationElement[] getChildren() throws InvalidRegistryObjectException {
524
            return null;
525
        }
526
    
527
        public IConfigurationElement[] getChildren(String name) throws InvalidRegistryObjectException {
528
            return null;
529
        }
530
    
531
        public IContributor getContributor() throws InvalidRegistryObjectException {
532
            return null;
533
        }
534
    
535
        public String getName() throws InvalidRegistryObjectException {
536
            return null;
537
        }
538
    
539
        public String getNamespace() throws InvalidRegistryObjectException {
540
            return null;
541
        }
542
    
543
        public String getNamespaceIdentifier() throws InvalidRegistryObjectException {
544
            return null;
545
        }
546
    
547
        public Object getParent() throws InvalidRegistryObjectException {
548
            return null;
549
        }
550
    
551
        public String getValue() throws InvalidRegistryObjectException {
552
            return null;
553
        }
554
    
555
        public String getValueAsIs() throws InvalidRegistryObjectException {
556
            return null;
557
        }
558
    
559
        public boolean isValid() {
560
            return false;
561
        }
562
            
563
    }
564
        
565
    /**
566
     * A mock extension used to supply a valid namespace identifier  
567
     * <p>
568
     * This class is not intended to be used outside of the validation framework.
569
     * </p>
570
     * @see XmlConfig#load(URL)
571
     */
572
    private static class DummyExtension implements IExtension {
573
            
574
        String namespaceIndentifier = null;
575
            
576
        public DummyExtension(String namespaceIdentifier) {
577
            this.namespaceIndentifier = namespaceIdentifier;
578
        }
579
    
580
        public String getNamespaceIdentifier() throws InvalidRegistryObjectException {
581
            return namespaceIndentifier;
582
        }
583
            
584
        // Unused Methods 
585
            
586
        public IConfigurationElement[] getConfigurationElements() throws InvalidRegistryObjectException {
587
            return null;
588
        }
589
    
590
        public IContributor getContributor() throws InvalidRegistryObjectException {
591
            return null;
592
        }
593
    
594
        public IPluginDescriptor getDeclaringPluginDescriptor() throws InvalidRegistryObjectException {
595
            return null;
596
        }
597
    
598
        public String getExtensionPointUniqueIdentifier() throws InvalidRegistryObjectException {
599
            return null;
600
        }
601
    
602
        public String getLabel() throws InvalidRegistryObjectException {
603
            return null;
604
        }
605
    
606
        public String getNamespace() throws InvalidRegistryObjectException {
607
            return null;
608
        }
609
    
610
        public String getSimpleIdentifier() throws InvalidRegistryObjectException {
611
            return null;
612
        }
613
    
614
        public String getUniqueIdentifier() throws InvalidRegistryObjectException {
615
            return null;
616
        }
617
    
618
        public boolean isValid() {
619
            return false;
620
        }            
621
    }       
443
}
622
}

Return to bug 167972