Skip to main content
summaryrefslogtreecommitdiffstats
blob: cd88bdf5c9f4f505ccd31d9b2018f8c6c16fd8b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*******************************************************************************
 * Copyright (c) 2000, 2006 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.wst.wsdl.internal.generator.extension;

import org.eclipse.wst.wsdl.internal.generator.ContentGenerator;
import org.osgi.framework.Bundle;

/*
 * Class which acts as a container to hold information about the extension.
 */
public class ContentGeneratorExtensionDescriptor {
	protected Bundle bundle;
	protected ContentGenerator contentGenerator;
	protected String namespace;
	protected String name;
	protected String className;
	
	public ContentGeneratorExtensionDescriptor(Bundle bundle, String classString, String namespace, String name) {
		this.bundle = bundle;
		this.namespace = namespace;
		this.name = name;
		this.className = classString;
	}
	
	
	public Object getContentGenerator() {
		try {
	        Class theClass = bundle.loadClass(className);
	        contentGenerator = (ContentGenerator) theClass.newInstance();
	      }
	      catch (Exception e) {
	        e.printStackTrace();
	      }
		
		return contentGenerator;
	}
	
	public String getNamespace() {
		return namespace;
	}
	
	public String getName() {
		return name;
	}
}

Back to the top