Author: DartPeng
Date: 2009-12-01 01:19:42 -0500 (Tue, 01 Dec 2009)
New Revision: 18940
Modified:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigFileHandle.java
Log:
JBIDE-5301
Remove the MEDI URI from Smooks config file handle support-namespaces
Modified:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigFileHandle.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigFileHandle.java 2009-12-01
06:13:35 UTC (rev 18939)
+++
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigFileHandle.java 2009-12-01
06:19:42 UTC (rev 18940)
@@ -28,7 +28,6 @@
import org.jboss.tools.smooks.model.javabean.JavabeanPackage;
import org.jboss.tools.smooks.model.jmsrouting.JmsroutingPackage;
import org.jboss.tools.smooks.model.json.JsonPackage;
-import org.jboss.tools.smooks.model.medi.MEdiPackage;
import org.jboss.tools.smooks.model.xsl.XslPackage;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
@@ -40,7 +39,7 @@
/**
* @author Dart dpeng(a)redhat.com
- *
+ *
*/
public class SmooksConfigFileHandle extends DefaultHandler {
private boolean correctContentFile = false;
@@ -50,40 +49,35 @@
private String[] smooksSpportURI = null;
private SAXParserFactory fFactory;
-
- public SmooksConfigFileHandle(){
+
+ public SmooksConfigFileHandle() {
super();
smooksSpportURI = createSupportURI();
}
-
- protected String[] createSupportURI(){
- return new String[]{
+
+ protected String[] createSupportURI() {
+ return new String[] {
org.jboss.tools.smooks.model.smooks.SmooksPackage.eNS_URI,
- EdiPackage.eNS_URI,
- XslPackage.eNS_URI,
- FreemarkerPackage.eNS_URI,
- GroovyPackage.eNS_URI,
- MEdiPackage.eNS_URI,
- CalcPackage.eNS_URI,
- CsvPackage.eNS_URI,
- DatasourcePackage.eNS_URI,
- FileRoutingPackage.eNS_URI,
- IoroutingPackage.eNS_URI,
- JavabeanPackage.eNS_URI,
- JmsroutingPackage.eNS_URI,
- JsonPackage.eNS_URI,
- };
+ EdiPackage.eNS_URI, XslPackage.eNS_URI,
+ FreemarkerPackage.eNS_URI, GroovyPackage.eNS_URI,
+ CalcPackage.eNS_URI, CsvPackage.eNS_URI,
+ DatasourcePackage.eNS_URI, FileRoutingPackage.eNS_URI,
+ IoroutingPackage.eNS_URI, JavabeanPackage.eNS_URI,
+ JmsroutingPackage.eNS_URI, JsonPackage.eNS_URI, };
}
- private final SAXParser createParser(SAXParserFactory parserFactory) throws
ParserConfigurationException,
- SAXException, SAXNotRecognizedException, SAXNotSupportedException {
+ private final SAXParser createParser(SAXParserFactory parserFactory)
+ throws ParserConfigurationException, SAXException,
+ SAXNotRecognizedException, SAXNotSupportedException {
// Initialize the parser.
final SAXParser parser = parserFactory.newSAXParser();
final XMLReader reader = parser.getXMLReader();
// disable DTD validation
try {
reader.setFeature("http://xml.org/sax/features/validation", false);
//$NON-NLS-1$
-
reader.setFeature("http://apache.org/xml/features/nonvalidating/load...;,
false); //$NON-NLS-1$
+ reader
+ .setFeature(
+ "http://apache.org/xml/features/nonvalidating/load-external-dtd",
false); //$NON-NLS-1$
} catch (SAXNotRecognizedException e) {
} catch (SAXNotSupportedException e) {
}
@@ -101,7 +95,8 @@
return fFactory;
}
- public boolean parseContents(InputSource contents) throws ParserConfigurationException,
IOException {
+ public boolean parseContents(InputSource contents)
+ throws ParserConfigurationException, IOException {
try {
fFactory = getFactory();
if (fFactory == null) {
@@ -117,21 +112,21 @@
}
/*
- * Resolve external entity definitions to an empty string. This is to
- * speed up processing of files with external DTDs. Not resolving the
- * contents of the DTD is ok, as only the System ID of the DTD
- * declaration is used.
+ * Resolve external entity definitions to an empty string. This is to speed
+ * up processing of files with external DTDs. Not resolving the contents of
+ * the DTD is ok, as only the System ID of the DTD declaration is used.
*
- * @see
- * org.xml.sax.helpers.DefaultHandler#resolveEntity(java.lang.String,
+ * @see org.xml.sax.helpers.DefaultHandler#resolveEntity(java.lang.String,
* java.lang.String)
*/
- public InputSource resolveEntity(String publicId, String systemId) throws SAXException
{
+ public InputSource resolveEntity(String publicId, String systemId)
+ throws SAXException {
return new InputSource(new StringReader("")); //$NON-NLS-1$
}
@Override
- public void startPrefixMapping(String prefix, String uri) throws SAXException {
+ public void startPrefixMapping(String prefix, String uri)
+ throws SAXException {
super.startPrefixMapping(prefix, uri);
if (containtSmooksURI(uri)) {
setCorrectContentFile(true);
@@ -156,8 +151,9 @@
* @see org.xml.sax.ContentHandler#startElement(java.lang.String,
* java.lang.String, java.lang.String, org.xml.sax.Attributes)
*/
- public final void startElement(final String uri, final String elementName, final String
qualifiedName,
- final Attributes attributes) throws SAXException {
+ public final void startElement(final String uri, final String elementName,
+ final String qualifiedName, final Attributes attributes)
+ throws SAXException {
if (isCorrectContentFile()) {
throw new SAXException(Messages.SmooksConfigFileHandle_exception);
}