Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/resources/ResourceIdentifier.java')
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/resources/ResourceIdentifier.java112
1 files changed, 0 insertions, 112 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/resources/ResourceIdentifier.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/resources/ResourceIdentifier.java
deleted file mode 100644
index 19f86efa9..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/resources/ResourceIdentifier.java
+++ /dev/null
@@ -1,112 +0,0 @@
-package org.eclipse.jst.jsf.designtime.internal.resources;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-
-/**
- * Encapsulates the concept of a JSF (2.0+) resource identifier per 2.6.1 of the
- * specification. The class does not ensure validity of the identifier.
- *
- * You can call validate to determine if the contents are correct.
- *
- * @author cbateman
- *
- */
-public class ResourceIdentifier extends ResourceFragmentIdentifier
-{
- /**
- * Resource name is not optional on identifiers.
- */
- public static final int RESOURCE_NAME_MUST_NOT_BE_EMPTY = 0;
- /**
- * The namespace for validation diagnositics created by validate.
- */
- public static final String ResourceIdentifierValidationNamespace = JSFCorePlugin.PLUGIN_ID
- + "_JSFResourceIdentifier"; //$NON-NLS-1$
- private final String _resName;
-
- /**
- * @param resName
- */
- public ResourceIdentifier(String resName)
- {
- super();
- _resName = resName;
- }
-
- /**
- * Allow fragments to be
- */
- protected ResourceIdentifier()
- {
- super();
- _resName = null;
- }
- /**
- * @return the resource name or null if none.
- */
- @Override
- public String getResourceName()
- {
- return _resName;
- }
-
- /**
- * @return a status object multi-value that contains the results of
- * validating this resoure identifier.
- */
- @Override
- public IStatus validate()
- {
- final String id = ResourceIdentifierValidationNamespace;
- final MultiStatus status = new MultiStatus(id, 0,
- "Resource identifier problems", null); //$NON-NLS-1$
-
- if (getResourceName() == null)
- {
- status.add(new Status(IStatus.ERROR, id,
- RESOURCE_NAME_MUST_NOT_BE_EMPTY,
- Messages.ResourceIdentifier_0, null));
- }
-
- return status;
- }
-
- @Override
- public String toString()
- {
- if (!validate().isOK())
- {
- throw new IllegalStateException();
- }
- String idString = getResourceName();
- if (getResourceVersion() != null)
- {
- idString = String.format("%s/%s", getResourceVersion(), idString); //$NON-NLS-1$
- }
- if (getLibraryName() != null)
- {
- idString = String.format("%s/%s", getLibraryName(), idString); //$NON-NLS-1$
- }
-
- if (getLocalePrefix() != null)
- {
- idString = String.format("%s/%s", getLocalePrefix(), idString); //$NON-NLS-1$
- }
-
- if (getResourceVersion() != null)
- {
- idString += "/" + getResourceVersion(); //$NON-NLS-1$
- }
- return idString;
- }
-
- @Override
- public final boolean isFragment()
- {
- return false;
- }
-
-}

Back to the top