/** * @param loc * can be null if the location is unknown */ public final void error( Locator loc, String msg ) { error( new SAXParseException2(msg,loc) ); }
/** * Returns the human readable string representation of the * {@link org.xml.sax.Locator} part of the specified * {@link SAXParseException}. * * @return non-null valid object. */ protected final String getLocationString( SAXParseException e ) { if(e.getLineNumber()!=-1 || e.getSystemId()!=null) { int line = e.getLineNumber(); return ModelMessages.CONSOLE_ERROR_REPORTER_LINE_X_OF_Y(line==-1?"?":Integer.toString( line ), getShortName( e.getSystemId())); } else { return ""; //for unkown location just return empty string } }
public abstract void debug(SAXParseException exception);
private boolean fail(Locator location) { errReceiver.warning(location, ModelerMessages.WSDLMODELER_INVALID_IGNORING_MEMBER_SUBMISSION_ADDRESSING( AddressingVersion.MEMBER.nsUri, W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME)); return false; }
public void add(MessagePart part) { if (_partsByName.get(part.getName()) != null){ errorReceiver.error(part.getLocator(), WsdlMessages.VALIDATION_DUPLICATE_PART_NAME(getName(), part.getName())); throw new AbortException(); } if(part.getDescriptor() != null && part.getDescriptorKind() != null) { _partsByName.put(part.getName(), part); _parts.add(part); } else errorReceiver.warning(part.getLocator(), WsdlMessages.PARSING_ELEMENT_OR_TYPE_REQUIRED(part.getName())); }
int code = httpConn.getResponseCode(); if (code == 401) { errorReceiver.error(new SAXParseException(WscompileMessages.WSIMPORT_AUTH_INFO_NEEDED(e.getMessage(), systemId, WsimportOptions.defaultAuthfile), null, e)); throw new AbortException(); URL newurl = new URL(url, seeOther.get(0)); if (!newurl.equals(url)) { errorReceiver.info(new SAXParseException(WscompileMessages.WSIMPORT_HTTP_REDIRECT(code, seeOther.get(0)), null)); url = newurl; httpConn.disconnect(); if (redirects >= 5) { errorReceiver.error(new SAXParseException(WscompileMessages.WSIMPORT_MAX_REDIRECT_ATTEMPT(), null)); throw new AbortException();
/** * Returns a {@link org.xml.sax.XMLReader} to parse a document into this DOM forest. * <p/> * This version requires that the DOM object to be created and registered * to the map beforehand. */ private XMLReader createReader(Document dom) throws SAXException, ParserConfigurationException { XMLReader reader = parserFactory.newSAXParser().getXMLReader(); DOMBuilder dombuilder = new DOMBuilder(dom, locatorTable, outerMostBindings); try { reader.setProperty("http://xml.org/sax/properties/lexical-handler", dombuilder); } catch(SAXException e) { errorReceiver.debug(e.getMessage()); } ContentHandler handler = new WhitespaceStripper(dombuilder, errorReceiver, entityResolver); handler = new VersionChecker(handler, errorReceiver, entityResolver); // insert the reference finder so that // included/imported schemas will be also parsed XMLFilterImpl f = logic.createExternalReferenceFinder(this); f.setContentHandler(handler); if (errorReceiver != null) f.setErrorHandler(errorReceiver); f.setEntityResolver(entityResolver); reader.setContentHandler(f); if (errorReceiver != null) reader.setErrorHandler(errorReceiver); reader.setEntityResolver(entityResolver); return reader; }
private boolean fail(Locator location) { errReceiver.warning(location, ModelerMessages.WSDLMODELER_INVALID_IGNORING_MEMBER_SUBMISSION_ADDRESSING( AddressingVersion.MEMBER.nsUri, W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME)); return false; }
public void add(MessagePart part) { if (_partsByName.get(part.getName()) != null){ errorReceiver.error(part.getLocator(), WsdlMessages.VALIDATION_DUPLICATE_PART_NAME(getName(), part.getName())); throw new AbortException(); } if(part.getDescriptor() != null && part.getDescriptorKind() != null) { _partsByName.put(part.getName(), part); _parts.add(part); } else errorReceiver.warning(part.getLocator(), WsdlMessages.PARSING_ELEMENT_OR_TYPE_REQUIRED(part.getName())); }
int code = httpConn.getResponseCode(); if (code == 401) { errorReceiver.error(new SAXParseException(WscompileMessages.WSIMPORT_AUTH_INFO_NEEDED(e.getMessage(), systemId, WsimportOptions.defaultAuthfile), null, e)); throw new AbortException(); URL newurl = new URL(url, seeOther.get(0)); if (!newurl.equals(url)) { errorReceiver.info(new SAXParseException(WscompileMessages.WSIMPORT_HTTP_REDIRECT(code, seeOther.get(0)), null)); url = newurl; httpConn.disconnect(); if (redirects >= 5) { errorReceiver.error(new SAXParseException(WscompileMessages.WSIMPORT_MAX_REDIRECT_ATTEMPT(), null)); throw new AbortException();
/** * Returns a {@link org.xml.sax.XMLReader} to parse a document into this DOM forest. * <p/> * This version requires that the DOM object to be created and registered * to the map beforehand. */ private XMLReader createReader(Document dom) throws SAXException, ParserConfigurationException { XMLReader reader = parserFactory.newSAXParser().getXMLReader(); DOMBuilder dombuilder = new DOMBuilder(dom, locatorTable, outerMostBindings); try { reader.setProperty("http://xml.org/sax/properties/lexical-handler", dombuilder); } catch(SAXException e) { errorReceiver.debug(e.getMessage()); } ContentHandler handler = new WhitespaceStripper(dombuilder, errorReceiver, entityResolver); handler = new VersionChecker(handler, errorReceiver, entityResolver); // insert the reference finder so that // included/imported schemas will be also parsed XMLFilterImpl f = logic.createExternalReferenceFinder(this); f.setContentHandler(handler); if (errorReceiver != null) f.setErrorHandler(errorReceiver); f.setEntityResolver(entityResolver); reader.setContentHandler(f); if (errorReceiver != null) reader.setErrorHandler(errorReceiver); reader.setEntityResolver(entityResolver); return reader; }
/** * @param loc * can be null if the location is unknown */ public final void error( Locator loc, String msg ) { error( new SAXParseException2(msg,loc) ); }
private void warn(Locator location) { errReceiver.warning(location, ModelerMessages.WSDLMODELER_WARNING_MEMBER_SUBMISSION_ADDRESSING_USED( AddressingVersion.MEMBER.nsUri, W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME)); }
public void add(MessagePart part) { if (_partsByName.get(part.getName()) != null){ errorReceiver.error(part.getLocator(), WsdlMessages.VALIDATION_DUPLICATE_PART_NAME(getName(), part.getName())); throw new AbortException(); } if(part.getDescriptor() != null && part.getDescriptorKind() != null) { _partsByName.put(part.getName(), part); _parts.add(part); } else errorReceiver.warning(part.getLocator(), WsdlMessages.PARSING_ELEMENT_OR_TYPE_REQUIRED(part.getName())); }
int code = httpConn.getResponseCode(); if (code == 401) { errorReceiver.error(new SAXParseException(WscompileMessages.WSIMPORT_AUTH_INFO_NEEDED(e.getMessage(), systemId, WsimportOptions.defaultAuthfile), null, e)); throw new AbortException(); URL newurl = new URL(url, seeOther.get(0)); if (!newurl.equals(url)) { errorReceiver.info(new SAXParseException(WscompileMessages.WSIMPORT_HTTP_REDIRECT(code, seeOther.get(0)), null)); url = newurl; httpConn.disconnect(); if (redirects >= 5) { errorReceiver.error(new SAXParseException(WscompileMessages.WSIMPORT_MAX_REDIRECT_ATTEMPT(), null)); throw new AbortException();
/** * Returns the human readable string representation of the * {@link org.xml.sax.Locator} part of the specified * {@link SAXParseException}. * * @return non-null valid object. */ protected final String getLocationString( SAXParseException e ) { if(e.getLineNumber()!=-1 || e.getSystemId()!=null) { int line = e.getLineNumber(); return ModelMessages.CONSOLE_ERROR_REPORTER_LINE_X_OF_Y(line==-1?"?":Integer.toString( line ), getShortName( e.getSystemId())); } else { return ""; //for unkown location just return empty string } }
public abstract void debug(SAXParseException exception);