Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornitind2005-11-10 05:32:16 +0000
committernitind2005-11-10 05:32:16 +0000
commit95409d0577e96fa246baac5f5c0bc7af89af1194 (patch)
tree4521eaee348518157c514ca78d9f3573d156baf5 /bundles/org.eclipse.wst.xml.core
parent42a860f09fb65e04a029218da7e4c26ace0b5e64 (diff)
downloadwebtools.sourceediting-95409d0577e96fa246baac5f5c0bc7af89af1194.tar.gz
webtools.sourceediting-95409d0577e96fa246baac5f5c0bc7af89af1194.tar.xz
webtools.sourceediting-95409d0577e96fa246baac5f5c0bc7af89af1194.zip
[115727] externalize strings that need them or mark them as non-nls
Diffstat (limited to 'bundles/org.eclipse.wst.xml.core')
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/Catalog.java16
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogContributorRegistryReader.java20
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogElement.java2
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogReader.java46
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogSet.java2
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogWriter.java16
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/OASISCatalogConstants.java48
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/XMLCatalogURIResolverExtension.java2
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogEntry.java2
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMContentBuilderImpl.java2
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ValidatorHelper.java35
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationMessages.java35
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java47
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/Helper.java11
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/LazyURLInputStream.java12
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationInfo.java15
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationMessage.java2
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/LoggerFactory.java4
18 files changed, 169 insertions, 148 deletions
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/Catalog.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/Catalog.java
index 1c8c0bbe57..a946840037 100644
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/Catalog.java
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/Catalog.java
@@ -124,7 +124,7 @@ public class Catalog implements ICatalog
// TODO CS : do we really want to resolve these here?
// I'm guessing we should return the 'platform:' form of the URI
// to the caller.
- if (uri.startsWith("platform:"))
+ if (uri.startsWith("platform:")) //$NON-NLS-1$
{
URL entryURL = new URL(entry.getAbsolutePath(uri));
uri = Platform.resolve(entryURL).toString();
@@ -132,10 +132,10 @@ public class Catalog implements ICatalog
// we need to ensure URI's are of form "file:///D:/XXX" and NOT
// "file:D:/XXX". Otherwise the EMF URI class gets confused
// (see bug 103607)
- String FILE_SCHEME = "file:";
- if (uri.startsWith(FILE_SCHEME) && !uri.startsWith(FILE_SCHEME + "/"))
+ String FILE_SCHEME = "file:"; //$NON-NLS-1$
+ if (uri.startsWith(FILE_SCHEME) && !uri.startsWith(FILE_SCHEME + "/")) //$NON-NLS-1$
{
- uri = FILE_SCHEME + "///" + uri.substring(FILE_SCHEME.length());
+ uri = FILE_SCHEME + "///" + uri.substring(FILE_SCHEME.length()); //$NON-NLS-1$
}
}
return uri;
@@ -243,11 +243,11 @@ public class Catalog implements ICatalog
}
}
- public static final String DEFAULT_CATALOG_FILE = "default_catalog.xml";
+ public static final String DEFAULT_CATALOG_FILE = "default_catalog.xml"; //$NON-NLS-1$
- public static final String SYSTEM_CATALOG_FILE = "system_catalog.xml";
+ public static final String SYSTEM_CATALOG_FILE = "system_catalog.xml"; //$NON-NLS-1$
- public static final String USER_CATALOG_FILE = "user_catalog.xml";
+ public static final String USER_CATALOG_FILE = "user_catalog.xml"; //$NON-NLS-1$
protected String base;
@@ -308,7 +308,7 @@ public class Catalog implements ICatalog
}
} else
{
- Logger.log(Logger.ERROR, "argument was null in Catalog.addEntriesFromCatalog");
+ Logger.log(Logger.ERROR, "argument was null in Catalog.addEntriesFromCatalog"); //$NON-NLS-1$
}
} finally
{
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogContributorRegistryReader.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogContributorRegistryReader.java
index 29613891cf..13c6d257be 100644
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogContributorRegistryReader.java
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogContributorRegistryReader.java
@@ -31,8 +31,8 @@ import org.osgi.framework.Bundle;
public class CatalogContributorRegistryReader
{
- protected static final String EXTENSION_POINT_ID = "catalogContributions";
- protected static final String TAG_CONTRIBUTION = "catalogContribution";
+ protected static final String EXTENSION_POINT_ID = "catalogContributions"; //$NON-NLS-1$
+ protected static final String TAG_CONTRIBUTION = "catalogContribution"; //$NON-NLS-1$
/*
* this is a sample exptension
* <extension point="org.eclipse.wst.xml.core.catalogContributions">
@@ -77,7 +77,7 @@ public class CatalogContributorRegistryReader
public static String resolvePath(URL platformURL, String path)
{
- if (path.startsWith("platform:/plugin"))
+ if (path.startsWith("platform:/plugin")) //$NON-NLS-1$
{
// this is the speclial case, where the resource is located relative
// to another plugin (not the one that declares the extension point)
@@ -109,7 +109,7 @@ public class CatalogContributorRegistryReader
Bundle bundle = Platform.getBundle(pluginId);
if (bundle != null)
{
- URL bundleEntry = bundle.getEntry("/");
+ URL bundleEntry = bundle.getEntry("/"); //$NON-NLS-1$
if(bundleEntry != null){
try
@@ -184,13 +184,13 @@ public class CatalogContributorRegistryReader
processNextCatalogElements(new IConfigurationElement[]{childElement});
continue;
}
- if (key == null || key.equals(""))
+ if (key == null || key.equals("")) //$NON-NLS-1$
{
Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_entry_key_not_set);
continue;
}
String entryURI = childElement.getAttribute(OASISCatalogConstants.ATTR_URI); // mandatory
- if (entryURI == null || entryURI.equals(""))
+ if (entryURI == null || entryURI.equals("")) //$NON-NLS-1$
{
Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_entry_uri_not_set);
continue;
@@ -203,7 +203,7 @@ public class CatalogContributorRegistryReader
String resolvedPath = resolvePath(entryURI);
entry.setURI(resolvedPath);
String id = childElement.getAttribute(OASISCatalogConstants.ATTR_ID); // optional
- if (id != null && !id.equals(""))
+ if (id != null && !id.equals("")) //$NON-NLS-1$
{
entry.setId(id);
}
@@ -217,7 +217,7 @@ public class CatalogContributorRegistryReader
&& !attrName.equals(OASISCatalogConstants.ATTR_BASE))
{
String attrValue = childElement.getAttribute(attrName);
- if (attrValue != null && !attrValue.equals(""))
+ if (attrValue != null && !attrValue.equals("")) //$NON-NLS-1$
{
catalogElement.setAttributeValue(attrName, attrValue);
}
@@ -235,7 +235,7 @@ public class CatalogContributorRegistryReader
{
IConfigurationElement childElement = childElementList[i];
String location = childElement.getAttribute(OASISCatalogConstants.ATTR_CATALOG); // mandatory
- if (location == null || location.equals(""))
+ if (location == null || location.equals("")) //$NON-NLS-1$
{
Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_next_catalog_location_uri_not_set);
continue;
@@ -244,7 +244,7 @@ public class CatalogContributorRegistryReader
String resolvedPath = resolvePath(location);
nextCatalog.setCatalogLocation(resolvedPath);
String id = childElement.getAttribute(OASISCatalogConstants.ATTR_ID);
- if (id != null && !id.equals(""))
+ if (id != null && !id.equals("")) //$NON-NLS-1$
{
nextCatalog.setId(id);
}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogElement.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogElement.java
index 2c2bb7c1ae..61e6631bb3 100644
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogElement.java
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogElement.java
@@ -110,7 +110,7 @@ public class CatalogElement implements ICatalogElement
if (catalog != null)
{
String base = catalog.getBase();
- if (base == null || base.equals(""))
+ if (base == null || base.equals("")) //$NON-NLS-1$
{
base = catalog.getLocation();
}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogReader.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogReader.java
index b875041b36..2bd4837077 100644
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogReader.java
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogReader.java
@@ -55,8 +55,8 @@ public final class CatalogReader
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
{
// set base
- String base = attributes.getValue("", OASISCatalogConstants.ATTR_BASE);
- if (base != null && !base.equals(""))
+ String base = attributes.getValue("", OASISCatalogConstants.ATTR_BASE); //$NON-NLS-1$
+ if (base != null && !base.equals("")) //$NON-NLS-1$
{
baseURIStack.push(base);
}
@@ -65,10 +65,10 @@ public final class CatalogReader
if (localName.equals(CompatabilityConstants.TAG_USER_ENTRY))
{
int type = ICatalogEntry.ENTRY_TYPE_PUBLIC;
- String typeName = attributes.getValue("", CompatabilityConstants.ATT_TYPE);
+ String typeName = attributes.getValue("", CompatabilityConstants.ATT_TYPE); //$NON-NLS-1$
if (typeName != null)
{
- if (typeName.compareToIgnoreCase("SYSTEM") == 0)
+ if (typeName.compareToIgnoreCase("SYSTEM") == 0) //$NON-NLS-1$
{
type = ICatalogEntry.ENTRY_TYPE_SYSTEM;
}
@@ -77,11 +77,11 @@ public final class CatalogReader
if (catalogElement instanceof CatalogEntry)
{
CatalogEntry catalogEntry = (CatalogEntry) catalogElement;
- String key = attributes.getValue("", CompatabilityConstants.ATT_ID);
+ String key = attributes.getValue("", CompatabilityConstants.ATT_ID); //$NON-NLS-1$
catalogEntry.setKey(key);
- String entryUri = attributes.getValue("", CompatabilityConstants.ATT_URI);
+ String entryUri = attributes.getValue("", CompatabilityConstants.ATT_URI); //$NON-NLS-1$
catalogEntry.setURI(entryUri);
- String webURL = attributes.getValue("", CompatabilityConstants.ATT_WEB_URL);
+ String webURL = attributes.getValue("", CompatabilityConstants.ATT_WEB_URL); //$NON-NLS-1$
if (webURL != null)
{
catalogEntry.setAttributeValue(
@@ -98,23 +98,23 @@ public final class CatalogReader
//dw String catalogId = attributes.getValue("", OASISCatalogConstants.ATTR_ID);
if (OASISCatalogConstants.TAG_PUBLIC.equals(localName))
{
- key = attributes.getValue("", OASISCatalogConstants.ATTR_PUBLIC_ID);
+ key = attributes.getValue("", OASISCatalogConstants.ATTR_PUBLIC_ID); //$NON-NLS-1$
}
else if (OASISCatalogConstants.TAG_SYSTEM.equals(localName))
{
- key = attributes.getValue("", OASISCatalogConstants.ATTR_SYSTEM_ID);
+ key = attributes.getValue("", OASISCatalogConstants.ATTR_SYSTEM_ID); //$NON-NLS-1$
type = ICatalogEntry.ENTRY_TYPE_SYSTEM;
}
else if (OASISCatalogConstants.TAG_URI.equals(localName))
{
- key = attributes.getValue("", OASISCatalogConstants.ATTR_NAME);
+ key = attributes.getValue("", OASISCatalogConstants.ATTR_NAME); //$NON-NLS-1$
type = ICatalogEntry.ENTRY_TYPE_URI;
}
else if (OASISCatalogConstants.TAG_NEXT_CATALOG.equals(localName))
{
- String nextCatalogId = attributes.getValue("", OASISCatalogConstants.ATTR_ID);
+ String nextCatalogId = attributes.getValue("", OASISCatalogConstants.ATTR_ID); //$NON-NLS-1$
- String location = attributes.getValue("", OASISCatalogConstants.ATTR_CATALOG);
+ String location = attributes.getValue("", OASISCatalogConstants.ATTR_CATALOG); //$NON-NLS-1$
NextCatalog delegate = new NextCatalog();
delegate.setCatalogLocation(location);
delegate.setId(nextCatalogId);
@@ -125,13 +125,13 @@ public final class CatalogReader
// do not handle other entries
return;
}
- if (key == null || key.equals(""))
+ if (key == null || key.equals("")) //$NON-NLS-1$
{
Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_entry_key_not_set);
return;
}
- String entryURI = attributes.getValue("", OASISCatalogConstants.ATTR_URI); // mandatory
- if (entryURI == null || entryURI.equals(""))
+ String entryURI = attributes.getValue("", OASISCatalogConstants.ATTR_URI); // mandatory //$NON-NLS-1$
+ if (entryURI == null || entryURI.equals("")) //$NON-NLS-1$
{
Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_entry_uri_not_set);
return;
@@ -153,7 +153,7 @@ public final class CatalogReader
&& !attrName.equals(OASISCatalogConstants.ATTR_BASE))
{
String attrValue = attributes.getValue(attrName);
- if (attrValue != null && !attrValue.equals(""))
+ if (attrValue != null && !attrValue.equals("")) //$NON-NLS-1$
{
catalogElement.setAttributeValue(attrName, attrValue);
}
@@ -176,12 +176,12 @@ public final class CatalogReader
// for backward compatability
interface CompatabilityConstants{
- public static final String TAG_ID_XML_CATALOG_SETTINGS = "XMLCatalogSettings";
- public static final String TAG_ID_USER_ENTRIES = "UserEntries";
- public static final String TAG_USER_ENTRY = "UserEntry";
- public static final String ATT_TYPE = "TYPE";
- public static final String ATT_ID = "ID";
- public static final String ATT_URI = "URI";
- public static final String ATT_WEB_URL = "WEB_URL";
+ public static final String TAG_ID_XML_CATALOG_SETTINGS = "XMLCatalogSettings"; //$NON-NLS-1$
+ public static final String TAG_ID_USER_ENTRIES = "UserEntries"; //$NON-NLS-1$
+ public static final String TAG_USER_ENTRY = "UserEntry"; //$NON-NLS-1$
+ public static final String ATT_TYPE = "TYPE"; //$NON-NLS-1$
+ public static final String ATT_ID = "ID"; //$NON-NLS-1$
+ public static final String ATT_URI = "URI"; //$NON-NLS-1$
+ public static final String ATT_WEB_URL = "WEB_URL"; //$NON-NLS-1$
}
}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogSet.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogSet.java
index f0587dfa25..58f943b2ba 100644
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogSet.java
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogSet.java
@@ -31,7 +31,7 @@ public class CatalogSet {
ok = false;
// we catch and log all exceptions, to disallow
// one bad extension interfering with others
- Logger.logException("error loading catalog: " + id + " " + uri, e);
+ Logger.logException("error loading catalog: " + id + " " + uri, e); //$NON-NLS-1$ //$NON-NLS-2$
}
if (ok) {
uriResourceMap.put(uri, catalog);
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogWriter.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogWriter.java
index bfeef8227f..e4776280a9 100644
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogWriter.java
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogWriter.java
@@ -105,7 +105,7 @@ public final class CatalogWriter
default :
break;
}
- if(childElement != null && id != null && !id.equals("")){
+ if(childElement != null && id != null && !id.equals("")){ //$NON-NLS-1$
childElement.setAttribute(OASISCatalogConstants.ATTR_ID, id);
}
@@ -113,7 +113,7 @@ public final class CatalogWriter
for (int j = 0; j < attributes.length; j++)
{
String attrName = attributes[j];
- if (attrName != null && !attrName.equals(""))
+ if (attrName != null && !attrName.equals("")) //$NON-NLS-1$
{
String attrValue = entry.getAttributeValue(attrName);
if (childElement != null && attrValue != null)
@@ -164,16 +164,16 @@ public final class CatalogWriter
{
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
- transformer.setOutputProperty(OutputKeys.INDENT, "yes");
- transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
+ transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
// Unless a width is set, there will be only line breaks but no
// indentation.
// The IBM JDK and the Sun JDK don't agree on the property name,
// so we set them both.
//
- transformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", "2");
- transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
- String encoding = "UTF-8"; // TBD
+ transformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", "2"); //$NON-NLS-1$ //$NON-NLS-2$
+ transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); //$NON-NLS-1$ //$NON-NLS-2$
+ String encoding = "UTF-8"; // TBD //$NON-NLS-1$
if (encoding != null)
{
transformer.setOutputProperty(OutputKeys.ENCODING, encoding);
@@ -214,7 +214,7 @@ public final class CatalogWriter
protected static String removeProtocol(String uri)
{
String result = uri;
- String protocol_pattenrn = ":";
+ String protocol_pattenrn = ":"; //$NON-NLS-1$
if (uri != null)
{
int index = uri.indexOf(protocol_pattenrn);
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/OASISCatalogConstants.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/OASISCatalogConstants.java
index d2ad8f33d3..06e894160e 100644
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/OASISCatalogConstants.java
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/OASISCatalogConstants.java
@@ -2,70 +2,70 @@ package org.eclipse.wst.xml.core.internal.catalog;
public interface OASISCatalogConstants
{
- public static final String namespaceName = "urn:oasis:names:tc:entity:xmlns:xml:catalog";
+ public static final String namespaceName = "urn:oasis:names:tc:entity:xmlns:xml:catalog"; //$NON-NLS-1$
/** Types of the catalog entries */
/** The CATALOG element name. */
- public static final String TAG_CATALOG = "catalog";
+ public static final String TAG_CATALOG = "catalog"; //$NON-NLS-1$
/** The GROUP catalog entry. */
- public static final String TAG_GROUP = "group";
+ public static final String TAG_GROUP = "group"; //$NON-NLS-1$
/** The PUBLIC catalog entry. */
- public static final String TAG_PUBLIC = "public";
+ public static final String TAG_PUBLIC = "public"; //$NON-NLS-1$
/** The SYSTEM catalog etnry. */
- public static final String TAG_SYSTEM = "system";
+ public static final String TAG_SYSTEM = "system"; //$NON-NLS-1$
/** The URI catalog entry. */
- public static final String TAG_URI = "uri";
+ public static final String TAG_URI = "uri"; //$NON-NLS-1$
/** The REWRITE_SYSTEM catalog entry. */
- public static final String TAG_REWRITE_SYSTEM = "rewriteSystem";
+ public static final String TAG_REWRITE_SYSTEM = "rewriteSystem"; //$NON-NLS-1$
/** The REWRITE_URI catalog entry. */
- public static final String TAG_REWRITE_URI = "rewritePublic";
+ public static final String TAG_REWRITE_URI = "rewritePublic"; //$NON-NLS-1$
/** The DELEGATE_PUBLIC catalog entry. */
- public static final String TAG_DELEGATE_PUBLIC = "delegatePublic";
+ public static final String TAG_DELEGATE_PUBLIC = "delegatePublic"; //$NON-NLS-1$
/** The DELEGATE_SYSTEM catalog entry. */
- public static final String TAG_DELEGATE_SYSTEM = "delegateSystem";
+ public static final String TAG_DELEGATE_SYSTEM = "delegateSystem"; //$NON-NLS-1$
/** The DELEGATE_URI catalog entry. */
- public static final String TAG_DELEGATE_URI = "delegateUri";
+ public static final String TAG_DELEGATE_URI = "delegateUri"; //$NON-NLS-1$
/** The NEXT_CATALOG catalog entry. */
- public static final String TAG_NEXT_CATALOG = "nextCatalog";
+ public static final String TAG_NEXT_CATALOG = "nextCatalog"; //$NON-NLS-1$
/** Attributes */
/** Attribute id used in all catalog entries */
- public static final String ATTR_ID = "id";
+ public static final String ATTR_ID = "id"; //$NON-NLS-1$
/** Attribute id base in all catalog entries */
- public static final String ATTR_BASE = "xml:base";
+ public static final String ATTR_BASE = "xml:base"; //$NON-NLS-1$
/** Attribute id prefere in catalog entries: CATALOG, GROUP */
- public static final String ATTR_PREFERE = "prefere";
+ public static final String ATTR_PREFERE = "prefere"; //$NON-NLS-1$
/** Attribute used in catalog entries of type: PUBLIC */
- public static final String ATTR_PUBLIC_ID = "publicId";
+ public static final String ATTR_PUBLIC_ID = "publicId"; //$NON-NLS-1$
/**
* Attribute used in catalog entries of type: SYSTEM
*/
- public static final String ATTR_SYSTEM_ID = "systemId";
+ public static final String ATTR_SYSTEM_ID = "systemId"; //$NON-NLS-1$
/**
* Attribute used in catalog entries of type: URI
*/
- public static final String ATTR_NAME = "name";
+ public static final String ATTR_NAME = "name"; //$NON-NLS-1$
/**
* Attribute used in catalog entries of type: PUBLIC, URI
*/
- public static final String ATTR_URI = "uri";
+ public static final String ATTR_URI = "uri"; //$NON-NLS-1$
/**
* Attribute used in catalog entries of type: REWRITE_SYSTEM, DELEGATE_SYSTEM
*/
- public static final String ATTR_SYSTEM_ID_START_STRING = "systemIdStartString";
+ public static final String ATTR_SYSTEM_ID_START_STRING = "systemIdStartString"; //$NON-NLS-1$
/**
* Attribute used in catalog entries of type: REWRITE_SYSTEM, REWRITE_URI
*/
- public static final String ATTR_REWRITE_PREFIX = "rewritePrefix";
+ public static final String ATTR_REWRITE_PREFIX = "rewritePrefix"; //$NON-NLS-1$
/**
* Attribute used in catalog entries of type: DELEGATE_PUBLIC
*/
- public static final String ATTR_PUBLIC_ID_START_STRING = "publicIdStartString";
+ public static final String ATTR_PUBLIC_ID_START_STRING = "publicIdStartString"; //$NON-NLS-1$
/**
* Attribute used in catalog entries of type: DELEGATE_PUBLIC,
* DELEGATE_SYSTEM, DELEGATE_URI, NEXT_CATALOG
*/
- public static final String ATTR_CATALOG = "catalog";
+ public static final String ATTR_CATALOG = "catalog"; //$NON-NLS-1$
/**
* Attribute used in catalog entries of type: REWRITE_URI, DELEGATE_URI
*/
- public static final String ATTR_URI_START_STRING = "uriStartString";
+ public static final String ATTR_URI_START_STRING = "uriStartString"; //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/XMLCatalogURIResolverExtension.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/XMLCatalogURIResolverExtension.java
index 0bc4555fda..268a8f7459 100644
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/XMLCatalogURIResolverExtension.java
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/XMLCatalogURIResolverExtension.java
@@ -74,7 +74,7 @@ public class XMLCatalogURIResolverExtension implements URIResolverExtension
// TODO (bug 103243) remove this lame test once we move to the new URIResolver API
// since the new API is explicit about namespace and publicId
//
- if (!(systemId != null && systemId.endsWith(".xsd")))
+ if (!(systemId != null && systemId.endsWith(".xsd"))) //$NON-NLS-1$
{
try
{
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogEntry.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogEntry.java
index 80e220adac..3e90cb8904 100644
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogEntry.java
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogEntry.java
@@ -19,7 +19,7 @@ public interface ICatalogEntry extends ICatalogElement
public static final int ENTRY_TYPE_URI = 4;
/** Attribute name for Web address of catalog entry */
- public static final String ATTR_WEB_URL = "webURL";
+ public static final String ATTR_WEB_URL = "webURL"; //$NON-NLS-1$
/**
*
diff --git a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMContentBuilderImpl.java b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMContentBuilderImpl.java
index 599439bdc0..f07e8ddc77 100644
--- a/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMContentBuilderImpl.java
+++ b/bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMContentBuilderImpl.java
@@ -167,7 +167,7 @@ public class DOMContentBuilderImpl extends CMVisitor implements DOMContentBuilde
// for now I'm setting the encoding to UTF-8 just incase this code path is used somewhere
//
String piValue = "version=\"1.0\""; //$NON-NLS-1$
- String encoding = "UTF-8";
+ String encoding = "UTF-8"; //$NON-NLS-1$
piValue += " encoding=\"" + encoding + "\""; //$NON-NLS-1$ //$NON-NLS-2$
ProcessingInstruction pi = document.createProcessingInstruction("xml", piValue); //$NON-NLS-1$
document.appendChild(pi);
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ValidatorHelper.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ValidatorHelper.java
index 37febb0673..d7c0b7a380 100644
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ValidatorHelper.java
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ValidatorHelper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * Copyright (c) 2001, 2005 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
@@ -35,15 +35,14 @@ import org.xml.sax.ext.LexicalHandler;
*/
public class ValidatorHelper
{
- public static final String copyright = "(c) Copyright IBM Corporation 2002.";
public List namespaceURIList = new Vector();
public boolean isGrammarEncountered = false;
public boolean isDTDEncountered = false;
public boolean isNamespaceEncountered = false;
- public String schemaLocationString = "";
+ public String schemaLocationString = ""; //$NON-NLS-1$
public int numDTDElements = 0;
- public static final boolean IS_LINUX = java.io.File.separator.equals("/");
+ public static final boolean IS_LINUX = java.io.File.separator.equals("/"); //$NON-NLS-1$
/**
* Constructor.
@@ -64,10 +63,10 @@ public class ValidatorHelper
reader = new org.apache.xerces.parsers.SAXParser();
- reader.setFeature("http://apache.org/xml/features/continue-after-fatal-error", false);
- reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
- reader.setFeature("http://xml.org/sax/features/namespaces", false);
- reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
+ reader.setFeature("http://apache.org/xml/features/continue-after-fatal-error", false); //$NON-NLS-1$
+ reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); //$NON-NLS-1$
+ reader.setFeature("http://xml.org/sax/features/namespaces", false); //$NON-NLS-1$
+ reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); //$NON-NLS-1$
reader.setContentHandler(new MyContentHandler());
reader.setErrorHandler(new InternalErrorHandler());
@@ -103,7 +102,7 @@ public class ValidatorHelper
{
}
};
- reader.setProperty("http://xml.org/sax/properties/lexical-handler", lexicalHandler);
+ reader.setProperty("http://xml.org/sax/properties/lexical-handler", lexicalHandler); //$NON-NLS-1$
return reader;
}
@@ -178,7 +177,7 @@ public class ValidatorHelper
public String getPrefix(String name)
{
String prefix = null;
- int index = name.indexOf(":");
+ int index = name.indexOf(":"); //$NON-NLS-1$
if (index != -1)
{
prefix = name.substring(0, index);
@@ -188,7 +187,7 @@ public class ValidatorHelper
public String getUnprefixedName(String name)
{
- int index = name.indexOf(":");
+ int index = name.indexOf(":"); //$NON-NLS-1$
if (index != -1)
{
name = name.substring(index + 1);
@@ -198,7 +197,7 @@ public class ValidatorHelper
public String getPrefixedName(String prefix, String localName)
{
- return prefix != null && prefix.length() > 0 ? prefix + ":" + localName : localName;
+ return prefix != null && prefix.length() > 0 ? prefix + ":" + localName : localName; //$NON-NLS-1$
}
public void startElement(String namespaceURI, String localName, String rawName, Attributes atts)
@@ -213,19 +212,19 @@ public class ValidatorHelper
for (int i =0; i < nAtts; i++)
{
String attributeName = atts.getQName(i);
- if (attributeName.equals("xmlns") || attributeName.startsWith("xmlns:"))
+ if (attributeName.equals("xmlns") || attributeName.startsWith("xmlns:")) //$NON-NLS-1$ //$NON-NLS-2$
{
isNamespaceEncountered = true;
String value = atts.getValue(i);
- if (value.startsWith("http://www.w3.org/") && value.endsWith("/XMLSchema-instance"))
+ if (value.startsWith("http://www.w3.org/") && value.endsWith("/XMLSchema-instance")) //$NON-NLS-1$ //$NON-NLS-2$
{
- schemaInstancePrefix = attributeName.equals("xmlns") ? "" : getUnprefixedName(attributeName);
+ schemaInstancePrefix = attributeName.equals("xmlns") ? "" : getUnprefixedName(attributeName); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
String prefix = getPrefix(rawName);
- String rootElementNamespaceDeclarationName = (prefix != null && prefix.length() > 0) ? "xmlns:" + prefix : "xmlns";
+ String rootElementNamespaceDeclarationName = (prefix != null && prefix.length() > 0) ? "xmlns:" + prefix : "xmlns"; //$NON-NLS-1$ //$NON-NLS-2$
String rootElementNamespace = rootElementNamespaceDeclarationName != null ? atts.getValue(rootElementNamespaceDeclarationName) : null;
String location = null;
@@ -234,10 +233,10 @@ public class ValidatorHelper
// to determine a location
if (schemaInstancePrefix != null)
{
- location = atts.getValue(getPrefixedName(schemaInstancePrefix, "noNamespaceSchemaLocation"));
+ location = atts.getValue(getPrefixedName(schemaInstancePrefix, "noNamespaceSchemaLocation")); //$NON-NLS-1$
if (location == null)
{
- String schemaLoc = atts.getValue(getPrefixedName(schemaInstancePrefix, "schemaLocation"));
+ String schemaLoc = atts.getValue(getPrefixedName(schemaInstancePrefix, "schemaLocation")); //$NON-NLS-1$
StringTokenizer st = new StringTokenizer(schemaLoc);
while(st.hasMoreTokens())
{
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationMessages.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationMessages.java
new file mode 100644
index 0000000000..77c6683aa4
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationMessages.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2005 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/cpl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ */
+package org.eclipse.wst.xml.core.internal.validation;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Strings used by XML Validation
+ */
+public class XMLValidationMessages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.wst.xml.core.internal.validation.xmlvalidation";//$NON-NLS-1$
+
+ public static String _UI_PROBLEMS_VALIDATING_UNKNOWN_HOST;
+ public static String _UI_PROBLEMS_VALIDATING_FILE_NOT_FOUND;
+ public static String _UI_PROBLEMS_CONNECTION_REFUSED;
+ public static String _UI_REF_FILE_ERROR_MESSAGE;
+
+ static {
+ // load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, XMLValidationMessages.class);
+ }
+
+ private XMLValidationMessages() {
+ // cannot create new instance
+ }
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java
index 90ee2b69a5..a8bc2617a0 100644
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * Copyright (c) 2001, 2005 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
@@ -20,11 +20,9 @@ import java.io.Reader;
import java.io.StringReader;
import java.net.ConnectException;
import java.net.UnknownHostException;
-import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
-import java.util.ResourceBundle;
import org.apache.xerces.impl.XMLErrorReporter;
import org.apache.xerces.parsers.StandardParserConfiguration;
@@ -34,6 +32,7 @@ import org.apache.xerces.xni.XMLResourceIdentifier;
import org.apache.xerces.xni.XNIException;
import org.apache.xerces.xni.parser.XMLEntityResolver;
import org.apache.xerces.xni.parser.XMLInputSource;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
import org.eclipse.wst.xml.core.internal.validation.core.LazyURLInputStream;
import org.eclipse.wst.xml.core.internal.validation.core.logging.LoggerFactory;
@@ -51,31 +50,23 @@ import org.xml.sax.ext.DeclHandler;
*/
public class XMLValidator
{
- public static final String copyright = "(c) Copyright IBM Corporation 2002.";
protected URIResolver uriResolver = null;
//protected MyEntityResolver entityResolver = null;
protected Hashtable ingoredErrorKeyTable = new Hashtable();
-
- protected ResourceBundle resourceBundle;
- protected static final String IGNORE_ALWAYS = "IGNORE_ALWAYS";
- protected static final String IGNORE_IF_DTD_WITHOUT_ELEMENT_DECL = "IGNORE_IF_DTD_WITHOUT_ELEMENT_DECL";
- protected static final String PREMATURE_EOF = "PrematureEOF";
- protected static final String ROOT_ELEMENT_TYPE_MUST_MATCH_DOCTYPEDECL = "RootElementTypeMustMatchDoctypedecl";
- protected static final String MSG_ELEMENT_NOT_DECLARED = "MSG_ELEMENT_NOT_DECLARED";
-
- private static final String _UI_PROBLEMS_VALIDATING_FILE_NOT_FOUND = "_UI_PROBLEMS_VALIDATING_FILE_NOT_FOUND";
- private static final String _UI_PROBLEMS_VALIDATING_UNKNOWN_HOST = "_UI_PROBLEMS_VALIDATING_UNKNOWN_HOST";
- private static final String _UI_PROBLEMS_CONNECTION_REFUSED = "_UI_PROBLEMS_CONNECTION_REFUSED";
+ protected static final String IGNORE_ALWAYS = "IGNORE_ALWAYS"; //$NON-NLS-1$
+ protected static final String IGNORE_IF_DTD_WITHOUT_ELEMENT_DECL = "IGNORE_IF_DTD_WITHOUT_ELEMENT_DECL"; //$NON-NLS-1$
+ protected static final String PREMATURE_EOF = "PrematureEOF"; //$NON-NLS-1$
+ protected static final String ROOT_ELEMENT_TYPE_MUST_MATCH_DOCTYPEDECL = "RootElementTypeMustMatchDoctypedecl"; //$NON-NLS-1$
+ protected static final String MSG_ELEMENT_NOT_DECLARED = "MSG_ELEMENT_NOT_DECLARED"; //$NON-NLS-1$
- private static final String FILE_NOT_FOUND_KEY = "FILE_NOT_FOUND";
+ private static final String FILE_NOT_FOUND_KEY = "FILE_NOT_FOUND"; //$NON-NLS-1$
/**
* Constructor.
*/
public XMLValidator()
{
- resourceBundle = ResourceBundle.getBundle("org.eclipse.wst.xml.core.internal.validation.xmlvalidation");
// Here we add some error keys that we need to filter out when we're validation
// against a DTD without any element declarations.
ingoredErrorKeyTable.put(PREMATURE_EOF, IGNORE_ALWAYS);
@@ -119,18 +110,18 @@ public class XMLValidator
}
};
- reader.setFeature("http://apache.org/xml/features/continue-after-fatal-error", false);
- reader.setFeature("http://xml.org/sax/features/namespace-prefixes", valinfo.isNamespaceEncountered());
- reader.setFeature("http://xml.org/sax/features/namespaces", valinfo.isNamespaceEncountered());
- reader.setFeature("http://xml.org/sax/features/validation", valinfo.isGrammarEncountered());
- reader.setFeature("http://apache.org/xml/features/validation/schema", valinfo.isGrammarEncountered());
+ reader.setFeature("http://apache.org/xml/features/continue-after-fatal-error", false); //$NON-NLS-1$
+ reader.setFeature("http://xml.org/sax/features/namespace-prefixes", valinfo.isNamespaceEncountered()); //$NON-NLS-1$
+ reader.setFeature("http://xml.org/sax/features/namespaces", valinfo.isNamespaceEncountered()); //$NON-NLS-1$
+ reader.setFeature("http://xml.org/sax/features/validation", valinfo.isGrammarEncountered()); //$NON-NLS-1$
+ reader.setFeature("http://apache.org/xml/features/validation/schema", valinfo.isGrammarEncountered()); //$NON-NLS-1$
// MH make sure validation works even when a customer entityResolver is note set (i.e. via setURIResolver())
if (entityResolver != null)
{
- reader.setProperty("http://apache.org/xml/properties/internal/entity-resolver", entityResolver);
+ reader.setProperty("http://apache.org/xml/properties/internal/entity-resolver", entityResolver); //$NON-NLS-1$
}
- reader.setProperty("http://xml.org/sax/properties/declaration-handler", new MyDeclHandler());
+ reader.setProperty("http://xml.org/sax/properties/declaration-handler", new MyDeclHandler()); //$NON-NLS-1$
}
catch(Exception e)
{
@@ -257,15 +248,15 @@ public class XMLValidator
{
if (cause instanceof FileNotFoundException)
{
- validationMessageStr = MessageFormat.format(resourceBundle.getString(_UI_PROBLEMS_VALIDATING_FILE_NOT_FOUND), new Object [] { validationMessageStr });
+ validationMessageStr = NLS.bind(XMLValidationMessages._UI_PROBLEMS_VALIDATING_FILE_NOT_FOUND, new Object [] { validationMessageStr });
}
else if (cause instanceof UnknownHostException)
{
- validationMessageStr = MessageFormat.format(resourceBundle.getString(_UI_PROBLEMS_VALIDATING_UNKNOWN_HOST), new Object [] { validationMessageStr });
+ validationMessageStr = NLS.bind(XMLValidationMessages._UI_PROBLEMS_VALIDATING_UNKNOWN_HOST, new Object [] { validationMessageStr });
}
else if(cause instanceof ConnectException)
{
- validationMessageStr = resourceBundle.getString(_UI_PROBLEMS_CONNECTION_REFUSED);
+ validationMessageStr = XMLValidationMessages._UI_PROBLEMS_CONNECTION_REFUSED;
}
}
@@ -517,7 +508,7 @@ public class XMLValidator
reportError = false;
}
}
- if ("schema_reference.4".equals(key) && arguments.length > 0)
+ if ("schema_reference.4".equals(key) && arguments.length > 0) //$NON-NLS-1$
{
Object location = arguments[0];
if (location != null)
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/Helper.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/Helper.java
index 29bd9195b6..d9497af689 100644
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/Helper.java
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/Helper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * Copyright (c) 2001, 2005 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
@@ -37,12 +37,11 @@ import org.eclipse.wst.validation.internal.provisional.core.IMessage;
*/
public class Helper extends WorkbenchContext
{
- public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";
- public static final String GET_PROJECT_FILES = "getAllFiles";
- public static final String GET_FILE = "getFile";
+ public static final String GET_PROJECT_FILES = "getAllFiles"; //$NON-NLS-1$
+ public static final String GET_FILE = "getFile"; //$NON-NLS-1$
//dw private static final IContainer[] NO_CONTAINERS = new IContainer[0];
- public static final String VALIDATION_MARKER = "org.eclipse.wst.validation.problemmarker";
- public static final String VALIDATION_MARKER_OWNER = "owner";
+ public static final String VALIDATION_MARKER = "org.eclipse.wst.validation.problemmarker"; //$NON-NLS-1$
+ public static final String VALIDATION_MARKER_OWNER = "owner"; //$NON-NLS-1$
/**
* Constructor.
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/LazyURLInputStream.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/LazyURLInputStream.java
index cb5dbf5c37..834cb0b23a 100644
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/LazyURLInputStream.java
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/LazyURLInputStream.java
@@ -69,7 +69,7 @@ public class LazyURLInputStream extends InputStream
{
if (pretendFileIsStillOpen) return 0;
createInnerStreamIfRequired();
- if (inner == null) throw new IOException("Stream not available");
+ if (inner == null) throw new IOException("Stream not available"); //$NON-NLS-1$
return inner.available();
}
@@ -117,7 +117,7 @@ public class LazyURLInputStream extends InputStream
{
if (pretendFileIsStillOpen) return -1;
createInnerStreamIfRequired();
- if (inner == null) throw new IOException("Stream not available");
+ if (inner == null) throw new IOException("Stream not available"); //$NON-NLS-1$
int bytesRead = inner.read();
if (bytesRead == -1 && !hasMarks) closeStream();
return bytesRead;
@@ -127,7 +127,7 @@ public class LazyURLInputStream extends InputStream
public int read(byte[] b) throws IOException {
if (pretendFileIsStillOpen) return -1;
createInnerStreamIfRequired();
- if (inner == null) throw new IOException("Stream not available");
+ if (inner == null) throw new IOException("Stream not available"); //$NON-NLS-1$
int bytesRead = inner.read(b);
if (bytesRead == -1 && !hasMarks) closeStream();
return bytesRead;
@@ -137,7 +137,7 @@ public class LazyURLInputStream extends InputStream
{
if (pretendFileIsStillOpen) return -1;
createInnerStreamIfRequired();
- if (inner == null) throw new IOException("Stream not available");
+ if (inner == null) throw new IOException("Stream not available"); //$NON-NLS-1$
int bytesRead = inner.read(b, off, len);
if (bytesRead == -1 && !hasMarks) closeStream();
return bytesRead;
@@ -147,7 +147,7 @@ public class LazyURLInputStream extends InputStream
{
if (pretendFileIsStillOpen) return;
createInnerStreamIfRequired();
- if (inner == null) throw new IOException("Stream not available");
+ if (inner == null) throw new IOException("Stream not available"); //$NON-NLS-1$
inner.reset();
}
@@ -155,7 +155,7 @@ public class LazyURLInputStream extends InputStream
{
if (pretendFileIsStillOpen) return 0;
createInnerStreamIfRequired();
- if (inner == null) throw new IOException("Stream not available");
+ if (inner == null) throw new IOException("Stream not available"); //$NON-NLS-1$
return inner.skip(n);
}
}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationInfo.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationInfo.java
index 378dbf2cc5..fa2e1a597f 100644
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationInfo.java
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationInfo.java
@@ -12,11 +12,12 @@ package org.eclipse.wst.xml.core.internal.validation.core;
import java.net.MalformedURLException;
import java.net.URL;
-import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
-import java.util.ResourceBundle;
+
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.xml.core.internal.validation.XMLValidationMessages;
/**
* This class handles messages from a validator. This class can handle
@@ -29,14 +30,11 @@ public class ValidationInfo implements ValidationReport
public static int SEV_ERROR = 0;
public static int SEV_WARNING = 1;
- private static String _UI_REF_FILE_ERROR_MESSAGE = "_UI_REF_FILE_ERROR_MESSAGE";
private String validating_file_uri = null;
private URL validating_file_url = null;
private boolean valid = true;
private List messages = new ArrayList();
private HashMap nestedMessages = new HashMap();
-
- protected ResourceBundle resourceBundle;
/**
* Constructor.
@@ -46,7 +44,6 @@ public class ValidationInfo implements ValidationReport
*/
public ValidationInfo(String uri)
{
- resourceBundle = ResourceBundle.getBundle("org.eclipse.wst.xml.core.internal.validation.xmlvalidation");
if(uri != null)
{
this.validating_file_uri = uri;
@@ -200,7 +197,7 @@ public class ValidationInfo implements ValidationReport
ValidationMessage container = (ValidationMessage) nestedMessages.get(nesteduri);
if(container == null)
{
- container = new ValidationMessage(MessageFormat.format(resourceBundle.getString(_UI_REF_FILE_ERROR_MESSAGE), new Object [] { nesteduri }), 1, 0, nesteduri);
+ container = new ValidationMessage(NLS.bind(XMLValidationMessages._UI_REF_FILE_ERROR_MESSAGE, new Object [] { nesteduri }), 1, 0, nesteduri);
// Initially set the nested error to a warning. This will automatically be changed
// to an error if a nested message has a severity of error.
@@ -279,8 +276,8 @@ public class ValidationInfo implements ValidationReport
// {
// }
// }
- uri = uri.replaceAll("%20"," ");
- uri = uri.replaceAll("%5E", "^");
+ uri = uri.replaceAll("%20"," "); //$NON-NLS-1$ //$NON-NLS-2$
+ uri = uri.replaceAll("%5E", "^"); //$NON-NLS-1$ //$NON-NLS-2$
uri = uri.replace('\\','/');
return uri;
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationMessage.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationMessage.java
index eb66b2000b..807ea9aca5 100644
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationMessage.java
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationMessage.java
@@ -24,7 +24,7 @@ import org.eclipse.wst.validation.internal.provisional.core.IMessage;
*/
public class ValidationMessage
{
- public static final QualifiedName ERROR_MESSAGE_MAP_QUALIFIED_NAME = new QualifiedName("org.eclipse.wst.xml.validation", "errorMessageMap");
+ public static final QualifiedName ERROR_MESSAGE_MAP_QUALIFIED_NAME = new QualifiedName("org.eclipse.wst.xml.validation", "errorMessageMap"); //$NON-NLS-1$ //$NON-NLS-2$
protected String message;
protected int lineNumber;
protected int columnNumber;
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/LoggerFactory.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/LoggerFactory.java
index 4d11843030..9a49c5de46 100644
--- a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/LoggerFactory.java
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/LoggerFactory.java
@@ -22,8 +22,8 @@ public class LoggerFactory
private static ILogger logger = null;
private static ClassLoader classloader = null;
private static String loggerClass = null;
- private static final String commandlinelogger = "org.eclipse.wst.xml.validation.internal.core.logging.CommandLineLogger";
- private static final String eclipselogger = "org.eclipse.wst.xml.validation.internal.core.logging.EclipseLogger";
+ private static final String commandlinelogger = "org.eclipse.wst.xml.validation.internal.core.logging.CommandLineLogger"; //$NON-NLS-1$
+ private static final String eclipselogger = "org.eclipse.wst.xml.validation.internal.core.logging.EclipseLogger"; //$NON-NLS-1$
private static String defaultlogger = commandlinelogger;
/**

Back to the top