Java 类org.w3c.dom.ls.LSException 实例源码

项目:javify    文件:DomDocumentBuilder.java   
public Document parse(InputStream in)
  throws SAXException, IOException
{
  LSInput input = ls.createLSInput();
  input.setByteStream(in);
  try
    {
      return parser.parse(input);
    }
  catch (LSException e)
    {
      Throwable e2 = e.getCause();
      if (e2 instanceof IOException)
        throw (IOException) e2;
      else
        throw e;
    }
}
项目:javify    文件:DomDocumentBuilder.java   
public Document parse(InputStream in, String systemId)
  throws SAXException, IOException
{
  LSInput input = ls.createLSInput();
  input.setByteStream(in);
  input.setSystemId(systemId);
  try
    {
      return parser.parse(input);
    }
  catch (LSException e)
    {
      Throwable e2 = e.getCause();
      if (e2 instanceof IOException)
        throw (IOException) e2;
      else
        throw e;
    }
}
项目:javify    文件:DomDocumentBuilder.java   
public Document parse(String systemId)
  throws SAXException, IOException
{
  try
    {
      return parser.parseURI(systemId);
    }
  catch (LSException e)
    {
      Throwable e2 = e.getCause();
      if (e2 instanceof IOException)
        throw (IOException) e2;
      else
        throw e;
    }
}
项目:jvm-stm    文件:DomDocumentBuilder.java   
public Document parse(InputStream in)
  throws SAXException, IOException
{
  LSInput input = ls.createLSInput();
  input.setByteStream(in);
  try
    {
      return parser.parse(input);
    }
  catch (LSException e)
    {
      Throwable e2 = e.getCause();
      if (e2 instanceof IOException)
        throw (IOException) e2;
      else
        throw e;
    }
}
项目:jvm-stm    文件:DomDocumentBuilder.java   
public Document parse(InputStream in, String systemId)
  throws SAXException, IOException
{
  LSInput input = ls.createLSInput();
  input.setByteStream(in);
  input.setSystemId(systemId);
  try
    {
      return parser.parse(input);
    }
  catch (LSException e)
    {
      Throwable e2 = e.getCause();
      if (e2 instanceof IOException)
        throw (IOException) e2;
      else
        throw e;
    }
}
项目:jvm-stm    文件:DomDocumentBuilder.java   
public Document parse(String systemId)
  throws SAXException, IOException
{
  try
    {
      return parser.parseURI(systemId);
    }
  catch (LSException e)
    {
      Throwable e2 = e.getCause();
      if (e2 instanceof IOException)
        throw (IOException) e2;
      else
        throw e;
    }
}
项目:JamVM-PH    文件:DomDocumentBuilder.java   
public Document parse(InputStream in)
  throws SAXException, IOException
{
  LSInput input = ls.createLSInput();
  input.setByteStream(in);
  try
    {
      return parser.parse(input);
    }
  catch (LSException e)
    {
      Throwable e2 = e.getCause();
      if (e2 instanceof IOException)
        throw (IOException) e2;
      else
        throw e;
    }
}
项目:JamVM-PH    文件:DomDocumentBuilder.java   
public Document parse(InputStream in, String systemId)
  throws SAXException, IOException
{
  LSInput input = ls.createLSInput();
  input.setByteStream(in);
  input.setSystemId(systemId);
  try
    {
      return parser.parse(input);
    }
  catch (LSException e)
    {
      Throwable e2 = e.getCause();
      if (e2 instanceof IOException)
        throw (IOException) e2;
      else
        throw e;
    }
}
项目:JamVM-PH    文件:DomDocumentBuilder.java   
public Document parse(String systemId)
  throws SAXException, IOException
{
  try
    {
      return parser.parseURI(systemId);
    }
  catch (LSException e)
    {
      Throwable e2 = e.getCause();
      if (e2 instanceof IOException)
        throw (IOException) e2;
      else
        throw e;
    }
}
项目:lib-swe-common    文件:XMLDocument.java   
protected void serializeDOM_LS(Element elt, OutputStream out, boolean pretty) throws LSException
{
    DOMImplementationLS impl = (DOMImplementationLS)XMLImplFinder.getDOMImplementation(); 

    // init and configure serializer
    LSSerializer serializer = impl.createLSSerializer();
    DOMConfiguration config = serializer.getDomConfig();
    config.setParameter("format-pretty-print", pretty);

    // wrap output stream
    LSOutput output = impl.createLSOutput();
    output.setByteStream(out);

    // launch serialization
    serializer.write(elt, output);
}
项目:classpath    文件:DomDocumentBuilder.java   
public Document parse(InputStream in)
  throws SAXException, IOException
{
  LSInput input = ls.createLSInput();
  input.setByteStream(in);
  try
    {
      return parser.parse(input);
    }
  catch (LSException e)
    {
      Throwable e2 = e.getCause();
      if (e2 instanceof IOException)
        throw (IOException) e2;
      else
        throw e;
    }
}
项目:classpath    文件:DomDocumentBuilder.java   
public Document parse(InputStream in, String systemId)
  throws SAXException, IOException
{
  LSInput input = ls.createLSInput();
  input.setByteStream(in);
  input.setSystemId(systemId);
  try
    {
      return parser.parse(input);
    }
  catch (LSException e)
    {
      Throwable e2 = e.getCause();
      if (e2 instanceof IOException)
        throw (IOException) e2;
      else
        throw e;
    }
}
项目:classpath    文件:DomDocumentBuilder.java   
public Document parse(String systemId)
  throws SAXException, IOException
{
  try
    {
      return parser.parseURI(systemId);
    }
  catch (LSException e)
    {
      Throwable e2 = e.getCause();
      if (e2 instanceof IOException)
        throw (IOException) e2;
      else
        throw e;
    }
}
项目:OpenJSharp    文件:DOMUtil.java   
/**
 * Creates an LSException. On J2SE 1.4 and above the cause for the exception will be set.
 */
public static LSException createLSException(short code, Throwable cause) {
    LSException lse = new LSException(code, cause != null ? cause.getMessage() : null);
    if (cause != null && ThrowableMethods.fgThrowableMethodsAvailable) {
        try {
            ThrowableMethods.fgThrowableInitCauseMethod.invoke(lse, new Object [] {cause});
        }
        // Something went wrong. There's not much we can do about it.
        catch (Exception e) {}
    }
    return lse;
}
项目:lookaside_java-1.8.0-openjdk    文件:DOMUtil.java   
/**
 * Creates an LSException. On J2SE 1.4 and above the cause for the exception will be set.
 */
public static LSException createLSException(short code, Throwable cause) {
    LSException lse = new LSException(code, cause != null ? cause.getMessage() : null);
    if (cause != null && ThrowableMethods.fgThrowableMethodsAvailable) {
        try {
            ThrowableMethods.fgThrowableInitCauseMethod.invoke(lse, new Object [] {cause});
        }
        // Something went wrong. There's not much we can do about it.
        catch (Exception e) {}
    }
    return lse;
}
项目:javify    文件:DomLSParser.java   
public Document parse(LSInput input)
  throws DOMException, LSException
{
  if (async)
    {
      return doParse(input);
    }
  else
    {
      synchronized (this)
        {
          return doParse(input);
        }
    }
}
项目:javify    文件:DomLSParser.java   
public Document parseURI(String uri)
  throws DOMException, LSException
{
  LSInput input = new DomLSInput();
  input.setSystemId(uri);
  return parse(input);
}
项目:javify    文件:DomLSSerializer.java   
public boolean writeToURI(Node node, String uri)
  throws LSException
{
  LSOutput output = new DomLSOutput();
  output.setSystemId(uri);
  return write(node, output);
}
项目:javify    文件:DomLSSerializer.java   
public String writeToString(Node node)
  throws DOMException, LSException
{
  Writer writer = new StringWriter();
  LSOutput output = new DomLSOutput();
  output.setCharacterStream(writer);
  write(node, output);
  return writer.toString();
}
项目:jvm-stm    文件:DomLSParser.java   
public Document parse(LSInput input)
  throws DOMException, LSException
{
  if (async)
    {
      return doParse(input);
    }
  else
    {
      synchronized (this)
        {
          return doParse(input);
        }
    }
}
项目:jvm-stm    文件:DomLSParser.java   
public Document parseURI(String uri)
  throws DOMException, LSException
{
  LSInput input = new DomLSInput();
  input.setSystemId(uri);
  return parse(input);
}
项目:jvm-stm    文件:DomLSSerializer.java   
public boolean writeToURI(Node node, String uri)
  throws LSException
{
  LSOutput output = new DomLSOutput();
  output.setSystemId(uri);
  return write(node, output);
}
项目:jvm-stm    文件:DomLSSerializer.java   
public String writeToString(Node node)
  throws DOMException, LSException
{
  Writer writer = new StringWriter();
  LSOutput output = new DomLSOutput();
  output.setCharacterStream(writer);
  write(node, output);
  return writer.toString();
}
项目:infobip-open-jdk-8    文件:DOMUtil.java   
/**
 * Creates an LSException. On J2SE 1.4 and above the cause for the exception will be set.
 */
public static LSException createLSException(short code, Throwable cause) {
    LSException lse = new LSException(code, cause != null ? cause.getMessage() : null);
    if (cause != null && ThrowableMethods.fgThrowableMethodsAvailable) {
        try {
            ThrowableMethods.fgThrowableInitCauseMethod.invoke(lse, new Object [] {cause});
        }
        // Something went wrong. There's not much we can do about it.
        catch (Exception e) {}
    }
    return lse;
}
项目:In-the-Box-Fork    文件:LSSerializerImpl.java   
/**
 * Creates an LSException. On J2SE 1.4 and above the cause for the exception will be set.
 */
private static LSException createLSException(short code, Throwable cause) {
    LSException lse = new LSException(code, cause != null ? cause.getMessage() : null);
    if (cause != null && ThrowableMethods.fgThrowableMethodsAvailable) {
        try {
            ThrowableMethods.fgThrowableInitCauseMethod.invoke(lse, new Object [] {cause});
        }
        // Something went wrong. There's not much we can do about it.
        catch (Exception e) {}
    }
    return lse;
}
项目:OLD-OpenJDK8    文件:DOMUtil.java   
/**
 * Creates an LSException. On J2SE 1.4 and above the cause for the exception will be set.
 */
public static LSException createLSException(short code, Throwable cause) {
    LSException lse = new LSException(code, cause != null ? cause.getMessage() : null);
    if (cause != null && ThrowableMethods.fgThrowableMethodsAvailable) {
        try {
            ThrowableMethods.fgThrowableInitCauseMethod.invoke(lse, new Object [] {cause});
        }
        // Something went wrong. There's not much we can do about it.
        catch (Exception e) {}
    }
    return lse;
}
项目:juddi    文件:MappingApiToModel.java   
private static String serializeTransformElement(Element xformEl) throws DOMException, LSException {
                Document document = xformEl.getOwnerDocument();
                DOMImplementationLS domImplLS = (DOMImplementationLS) document.getImplementation();
                LSSerializer serializer = domImplLS.createLSSerializer();
//        serializer.getDomConfig().setParameter("namespaces", true);
//        serializer.getDomConfig().setParameter("namespace-declarations", true);
                serializer.getDomConfig().setParameter("canonical-form", false);
                serializer.getDomConfig().setParameter("xml-declaration", false);
                String str = serializer.writeToString(xformEl);
                return str;
        }
项目:JamVM-PH    文件:DomLSParser.java   
public Document parse(LSInput input)
  throws DOMException, LSException
{
  if (async)
    {
      return doParse(input);
    }
  else
    {
      synchronized (this)
        {
          return doParse(input);
        }
    }
}
项目:JamVM-PH    文件:DomLSParser.java   
public Document parseURI(String uri)
  throws DOMException, LSException
{
  LSInput input = new DomLSInput();
  input.setSystemId(uri);
  return parse(input);
}
项目:JamVM-PH    文件:DomLSSerializer.java   
public boolean writeToURI(Node node, String uri)
  throws LSException
{
  LSOutput output = new DomLSOutput();
  output.setSystemId(uri);
  return write(node, output);
}
项目:JamVM-PH    文件:DomLSSerializer.java   
public String writeToString(Node node)
  throws DOMException, LSException
{
  Writer writer = new StringWriter();
  LSOutput output = new DomLSOutput();
  output.setCharacterStream(writer);
  write(node, output);
  return writer.toString();
}
项目:SplitCharater    文件:DOMUtil.java   
/**
 * Creates an LSException. On J2SE 1.4 and above the cause for the exception will be set.
 */
public static LSException createLSException(short code, Throwable cause) {
    LSException lse = new LSException(code, cause != null ? cause.getMessage() : null);
    if (cause != null && ThrowableMethods.fgThrowableMethodsAvailable) {
        try {
            ThrowableMethods.fgThrowableInitCauseMethod.invoke(lse, new Object [] {cause});
        }
        // Something went wrong. There's not much we can do about it.
        catch (Exception e) {}
    }
    return lse;
}
项目:classpath    文件:DomLSParser.java   
public Document parse(LSInput input)
  throws DOMException, LSException
{
  if (async)
    {
      return doParse(input);
    }
  else
    {
      synchronized (this)
        {
          return doParse(input);
        }
    }
}
项目:classpath    文件:DomLSParser.java   
public Document parseURI(String uri)
  throws DOMException, LSException
{
  LSInput input = new DomLSInput();
  input.setSystemId(uri);
  return parse(input);
}
项目:classpath    文件:DomLSSerializer.java   
public boolean writeToURI(Node node, String uri)
  throws LSException
{
  LSOutput output = new DomLSOutput();
  output.setSystemId(uri);
  return write(node, output);
}
项目:classpath    文件:DomLSSerializer.java   
public String writeToString(Node node)
  throws DOMException, LSException
{
  Writer writer = new StringWriter();
  LSOutput output = new DomLSOutput();
  output.setCharacterStream(writer);
  write(node, output);
  return writer.toString();
}
项目:openjdk-icedtea7    文件:DOMUtil.java   
/**
 * Creates an LSException. On J2SE 1.4 and above the cause for the exception will be set.
 */
public static LSException createLSException(short code, Throwable cause) {
    LSException lse = new LSException(code, cause != null ? cause.getMessage() : null);
    if (cause != null && ThrowableMethods.fgThrowableMethodsAvailable) {
        try {
            ThrowableMethods.fgThrowableInitCauseMethod.invoke(lse, new Object [] {cause});
        }
        // Something went wrong. There's not much we can do about it.
        catch (Exception e) {}
    }
    return lse;
}
项目:OpenJSharp    文件:DOMParserImpl.java   
/**
 * Parse an XML document from a location identified by an URI reference.
 * If the URI contains a fragment identifier (see section 4.1 in ), the
 * behavior is not defined by this specification.
 *
 */
public Document parseURI (String uri) throws LSException {

    //If DOMParser insstance is already busy parsing another document when this
    // method is called, then raise INVALID_STATE_ERR according to DOM L3 LS spec
    if ( fBusy ) {
        String msg = DOMMessageFormatter.formatMessage (
        DOMMessageFormatter.DOM_DOMAIN,
        "INVALID_STATE_ERR",null);
        throw new DOMException ( DOMException.INVALID_STATE_ERR,msg);
    }

    XMLInputSource source = new XMLInputSource (null, uri, null);
    try {
        currentThread = Thread.currentThread();
                    fBusy = true;
        parse (source);
        fBusy = false;
        if (abortNow && currentThread.isInterrupted()) {
            //reset interrupt state
            abortNow = false;
            Thread.interrupted();
        }
    } catch (Exception e){
        fBusy = false;
        if (abortNow && currentThread.isInterrupted()) {
            Thread.interrupted();
        }
        if (abortNow) {
            abortNow = false;
            restoreHandlers();
            return null;
        }
        // Consume this exception if the user
        // issued an interrupt or an abort.
        if (e != Abort.INSTANCE) {
            if (!(e instanceof XMLParseException) && fErrorHandler != null) {
                DOMErrorImpl error = new DOMErrorImpl ();
                error.fException = e;
                error.fMessage = e.getMessage ();
                error.fSeverity = DOMError.SEVERITY_FATAL_ERROR;
                fErrorHandler.getErrorHandler ().handleError (error);
            }
            if (DEBUG) {
                e.printStackTrace ();
            }
            throw (LSException) DOMUtil.createLSException(LSException.PARSE_ERR, e).fillInStackTrace();
        }
    }
    Document doc = getDocument();
    dropDocumentReferences();
    return doc;
}
项目:OpenJSharp    文件:DOMParserImpl.java   
/**
 * Parse an XML document from a resource identified by an
 * <code>LSInput</code>.
 *
 */
public Document parse (LSInput is) throws LSException {

    // need to wrap the LSInput with an XMLInputSource
    XMLInputSource xmlInputSource = dom2xmlInputSource (is);
    if ( fBusy ) {
        String msg = DOMMessageFormatter.formatMessage (
        DOMMessageFormatter.DOM_DOMAIN,
        "INVALID_STATE_ERR",null);
        throw new DOMException ( DOMException.INVALID_STATE_ERR,msg);
    }

    try {
        currentThread = Thread.currentThread();
                    fBusy = true;
        parse (xmlInputSource);
        fBusy = false;
        if (abortNow && currentThread.isInterrupted()) {
            //reset interrupt state
            abortNow = false;
            Thread.interrupted();
        }
    } catch (Exception e) {
        fBusy = false;
        if (abortNow && currentThread.isInterrupted()) {
            Thread.interrupted();
        }
        if (abortNow) {
            abortNow = false;
            restoreHandlers();
            return null;
        }
        // Consume this exception if the user
        // issued an interrupt or an abort.
        if (e != Abort.INSTANCE) {
            if (!(e instanceof XMLParseException) && fErrorHandler != null) {
               DOMErrorImpl error = new DOMErrorImpl ();
               error.fException = e;
               error.fMessage = e.getMessage ();
               error.fSeverity = DOMError.SEVERITY_FATAL_ERROR;
               fErrorHandler.getErrorHandler().handleError (error);
            }
            if (DEBUG) {
               e.printStackTrace ();
            }
            throw (LSException) DOMUtil.createLSException(LSException.PARSE_ERR, e).fillInStackTrace();
        }
    }
    Document doc = getDocument();
    dropDocumentReferences();
    return doc;
}
项目:openjdk-jdk10    文件:DOMParserImpl.java   
/**
 * Parse an XML document from a location identified by an URI reference.
 * If the URI contains a fragment identifier (see section 4.1 in ), the
 * behavior is not defined by this specification.
 *
 */
public Document parseURI (String uri) throws LSException {

    //If DOMParser insstance is already busy parsing another document when this
    // method is called, then raise INVALID_STATE_ERR according to DOM L3 LS spec
    if ( fBusy ) {
        String msg = DOMMessageFormatter.formatMessage (
        DOMMessageFormatter.DOM_DOMAIN,
        "INVALID_STATE_ERR",null);
        throw new DOMException ( DOMException.INVALID_STATE_ERR,msg);
    }

    XMLInputSource source = new XMLInputSource (null, uri, null, false);
    try {
        currentThread = Thread.currentThread();
                    fBusy = true;
        parse (source);
        fBusy = false;
        if (abortNow && currentThread.isInterrupted()) {
            //reset interrupt state
            abortNow = false;
            Thread.interrupted();
        }
    } catch (Exception e){
        fBusy = false;
        if (abortNow && currentThread.isInterrupted()) {
            Thread.interrupted();
        }
        if (abortNow) {
            abortNow = false;
            restoreHandlers();
            return null;
        }
        // Consume this exception if the user
        // issued an interrupt or an abort.
        if (e != Abort.INSTANCE) {
            if (!(e instanceof XMLParseException) && fErrorHandler != null) {
                DOMErrorImpl error = new DOMErrorImpl ();
                error.fException = e;
                error.fMessage = e.getMessage ();
                error.fSeverity = DOMError.SEVERITY_FATAL_ERROR;
                fErrorHandler.getErrorHandler ().handleError (error);
            }
            if (DEBUG) {
                e.printStackTrace ();
            }
            throw (LSException) DOMUtil.createLSException(LSException.PARSE_ERR, e).fillInStackTrace();
        }
    }
    Document doc = getDocument();
    dropDocumentReferences();
    return doc;
}