Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: f690471396d62da00df1a5be495bad69f6867cf8 (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
/****************************************************************************
 * Copyright (c) 2006, 2007 Remy Suen, Composent Inc., 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:
 *    Remy Suen <remy.suen@gmail.com> - initial API and implementation
 *****************************************************************************/
package org.eclipse.ecf.internal.provider.msn;

import org.eclipse.core.runtime.Assert;
import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.identity.IDCreateException;
import org.eclipse.ecf.core.identity.Namespace;

public class MSNNamespace extends Namespace {

	private static final long serialVersionUID = 7302784914405195380L;
	private static final String SCHEME_IDENTIFIER = "msn"; //$NON-NLS-1$

	public ID createInstance(Object[] parameters) throws IDCreateException {
		Assert.isNotNull(parameters, Messages.MSNNamespace_ParameterIsNull);
		if (parameters.length == 1 && parameters[0] instanceof String) {
			return new MSNID(this, (String) parameters[0]);
		} else {
			throw new IDCreateException(
					Messages.MSNNamespace_ParameterIsInvalid);
		}
	}

	public String getScheme() {
		return SCHEME_IDENTIFIER;
	}

	public Class[][] getSupportedParameterTypes() {
		return new Class[][] { { String.class } };
	}

}

Back to the top