当前位置: 首页>>代码示例>>Java>>正文


Java SAXException.getMessage方法代码示例

本文整理汇总了Java中org.xml.sax.SAXException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java SAXException.getMessage方法的具体用法?Java SAXException.getMessage怎么用?Java SAXException.getMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.xml.sax.SAXException的用法示例。


在下文中一共展示了SAXException.getMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFeature

import org.xml.sax.SAXException; //导入方法依赖的package包/类
public boolean getFeature(String name)
    throws ParserConfigurationException {
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return fSecureProcess;
    }
    // See if it's in the features Hashtable
    if (features != null) {
        Object val = features.get(name);
        if (val != null) {
            return ((Boolean) val).booleanValue();
        }
    }
    try {
        DOMParser domParser = new DocumentBuilderImpl(this, attributes, features).getDOMParser();
        return domParser.getFeature(name);
    }
    catch (SAXException e) {
        throw new ParserConfigurationException(e.getMessage());
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:DocumentBuilderFactoryImpl.java

示例2: readDriverFromFile

import org.xml.sax.SAXException; //导入方法依赖的package包/类
private static JDBCDriver readDriverFromFile(FileObject fo) throws IOException, MalformedURLException {
    Handler handler = new Handler();
    
    // parse the XM file
    try {
        XMLReader reader = XMLUtil.createXMLReader();
        InputSource is = new InputSource(fo.getInputStream());
        is.setSystemId(fo.toURL().toExternalForm());
        reader.setContentHandler(handler);
        reader.setErrorHandler(handler);
        reader.setEntityResolver(EntityCatalog.getDefault());

        reader.parse(is);
    } catch (SAXException ex) {
        throw new IOException(ex.getMessage());
    }
    
    // read the driver from the handler
    URL[] urls = new URL[handler.urls.size()];
    int j = 0;
    for (Iterator i = handler.urls.iterator(); i.hasNext(); j++) {
        urls[j] = new URL((String)i.next());
    }
    if (checkClassPathDrivers(handler.clazz, urls) == false) {
        return null;
    }
    
    if (handler.displayName == null) {
        handler.displayName = handler.name;
    }
    return JDBCDriver.create(handler.name, handler.displayName, handler.clazz, urls);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:33,代码来源:JDBCDriverConvertor.java

示例3: newDocumentBuilder

import org.xml.sax.SAXException; //导入方法依赖的package包/类
/**
 * Creates a new instance of a {@link javax.xml.parsers.DocumentBuilder}
 * using the currently configured parameters.
 */
public DocumentBuilder newDocumentBuilder()
    throws ParserConfigurationException
{
    /** Check that if a Schema has been specified that neither of the schema properties have been set. */
    if (grammar != null && attributes != null) {
        if (attributes.containsKey(JAXPConstants.JAXP_SCHEMA_LANGUAGE)) {
            throw new ParserConfigurationException(
                    SAXMessageFormatter.formatMessage(null,
                    "schema-already-specified", new Object[] {JAXPConstants.JAXP_SCHEMA_LANGUAGE}));
        }
        else if (attributes.containsKey(JAXPConstants.JAXP_SCHEMA_SOURCE)) {
            throw new ParserConfigurationException(
                    SAXMessageFormatter.formatMessage(null,
                    "schema-already-specified", new Object[] {JAXPConstants.JAXP_SCHEMA_SOURCE}));
        }
    }

    try {
        return new DocumentBuilderImpl(this, attributes, features, fSecureProcess);
    } catch (SAXException se) {
        // Handles both SAXNotSupportedException, SAXNotRecognizedException
        throw new ParserConfigurationException(se.getMessage());
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:29,代码来源:DocumentBuilderFactoryImpl.java

示例4: load

import org.xml.sax.SAXException; //导入方法依赖的package包/类
protected WorkflowDescriptor load(final WorkflowLocation workflowLocation, boolean validate) throws WorkflowLoaderException {

        WorkflowDescriptor workflowDescriptor = null;
        InputStream inputStream = null;
        
        try {
            inputStream = fetchProcessDefinition(workflowLocation);
            workflowDescriptor = WorkflowXMLParser.load(inputStream, validate);
        } catch (SAXException saxException) {
            throw new WorkflowLoaderException("XML parsing error loading workflow: " + saxException.getMessage(), saxException);
        } catch (Exception exception) {
            throw new WorkflowLoaderException("Error loading workflow: " + exception.getMessage(), exception);
        } finally {
            try {
                if(inputStream != null)
                    inputStream.close();
            } catch(IOException ioException) {}
        }

        return workflowDescriptor;
    }
 
开发者ID:will-gilbert,项目名称:OSWf-OSWorkflow-fork,代码行数:22,代码来源:AbstractWorkflowLoader.java

示例5: getFeature

import org.xml.sax.SAXException; //导入方法依赖的package包/类
public boolean getFeature(String name)
    throws ParserConfigurationException {
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return fSecureProcess;
    }
    // See if it's in the features map
    if (features != null) {
        Boolean val = features.get(name);
        if (val != null) {
            return val;
        }
    }
    try {
        DOMParser domParser = new DocumentBuilderImpl(this, attributes, features).getDOMParser();
        return domParser.getFeature(name);
    }
    catch (SAXException e) {
        throw new ParserConfigurationException(e.getMessage());
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:DocumentBuilderFactoryImpl.java

示例6: isValidating

import org.xml.sax.SAXException; //导入方法依赖的package包/类
public boolean isValidating() {
    try {
        return xmlReader.getFeature(VALIDATION_FEATURE);
    }
    catch (SAXException x) {
        throw new IllegalStateException(x.getMessage());
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:SAXParserImpl.java

示例7: main

import org.xml.sax.SAXException; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    try{
        SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
        Schema schema = schemaFactory.newSchema(new File(System.getProperty("test.src", "."), XSDFILE));
    } catch (SAXException e) {
        throw new RuntimeException(e.getMessage());
    }


}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:XPathWhiteSpaceTest.java

示例8: getAttribute

import org.xml.sax.SAXException; //导入方法依赖的package包/类
/**
 * Allows the user to retrieve specific attributes on the underlying
 * implementation.
 */
public Object getAttribute(String name)
    throws IllegalArgumentException
{
    // See if it's in the attributes Hashtable
    if (attributes != null) {
        Object val = attributes.get(name);
        if (val != null) {
            return val;
        }
    }

    DOMParser domParser = null;
    try {
        // We create a dummy DocumentBuilderImpl in case the attribute
        // name is not one that is in the attributes hashtable.
        domParser =
            new DocumentBuilderImpl(this, attributes, features).getDOMParser();
        return domParser.getProperty(name);
    } catch (SAXException se1) {
        // assert(name is not recognized or not supported), try feature
        try {
            boolean result = domParser.getFeature(name);
            // Must have been a feature
            return result ? Boolean.TRUE : Boolean.FALSE;
        } catch (SAXException se2) {
            // Not a property or a feature
            throw new IllegalArgumentException(se1.getMessage());
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:35,代码来源:DocumentBuilderFactoryImpl.java

示例9: addDocumentStart

import org.xml.sax.SAXException; //导入方法依赖的package包/类
protected void addDocumentStart() {
    try {
        h.startDocument();
    } catch (SAXException ex) {
        throw new RuntimeException(ex.getMessage(), ex.getException());
    }
}
 
开发者ID:ItzSomebody,项目名称:DirectLeaks-AntiReleak-Remover,代码行数:8,代码来源:SAXAdapter.java

示例10: visitOp

import org.xml.sax.SAXException; //导入方法依赖的package包/类
@Override
public void visitOp(FSEditLogOp op) throws IOException {
  try {
    op.outputToXml(contentHandler);
  }
  catch (SAXException e) {
    throw new IOException("SAX error: " + e.getMessage());
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:XmlEditsVisitor.java

示例11: addEnd

import org.xml.sax.SAXException; //导入方法依赖的package包/类
protected final void addEnd(final String name) {
    try {
        h.endElement("", name, name);
    } catch (SAXException ex) {
        throw new RuntimeException(ex.getMessage(), ex.getException());
    }
}
 
开发者ID:acmerli,项目名称:fastAOP,代码行数:8,代码来源:SAXAdapter.java

示例12: getText

import org.xml.sax.SAXException; //导入方法依赖的package包/类
private String getText(SAXException e) {
    if (e instanceof SAXParseException) {
        return ((SAXParseException) e).getLineNumber() + ": "
                + e.getLocalizedMessage();
    } else {
        return e.getMessage();
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:9,代码来源:TechnicalProductImportParser.java

示例13: newSAXParser

import org.xml.sax.SAXException; //导入方法依赖的package包/类
/**
 * Creates a new instance of <code>SAXParser</code> using the currently
 * configured factory parameters.
 * @return javax.xml.parsers.SAXParser
 */
public SAXParser newSAXParser()
    throws ParserConfigurationException
{
    SAXParser saxParserImpl;
    try {
        saxParserImpl = new SAXParserImpl(this, features, fSecureProcess);
    } catch (SAXException se) {
        // Translate to ParserConfigurationException
        throw new ParserConfigurationException(se.getMessage());
    }
    return saxParserImpl;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:SAXParserFactoryImpl.java

示例14: isNamespaceAware

import org.xml.sax.SAXException; //导入方法依赖的package包/类
public boolean isNamespaceAware() {
    try {
        return xmlReader.getFeature(NAMESPACES_FEATURE);
    }
    catch (SAXException x) {
        throw new IllegalStateException(x.getMessage());
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:SAXParserImpl.java

示例15: isValidating

import org.xml.sax.SAXException; //导入方法依赖的package包/类
public boolean isValidating() {
    try {
        return domParser.getFeature(VALIDATION_FEATURE);
    }
    catch (SAXException x) {
        throw new IllegalStateException(x.getMessage());
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:DocumentBuilderImpl.java


注:本文中的org.xml.sax.SAXException.getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。