/** * Reports a warning. */ protected final void warning( String msg ) throws SAXException { SAXParseException spe = new SAXParseException( msg, locator ); getErrorHandler().warning(spe); } }
@Override public void startDocument() throws SAXException { super.startDocument(); count=0; }
if( !isRecognizableExtension(uri) ) { String nearest = EditDistance.findNearest(uri, recognizableExtensions); error( Messages.ERR_UNSUPPORTED_EXTENSION.format(uri,nearest) ); } else if( !isSupportedExtension(uri) ) { error( Messages.ERR_PLUGIN_NOT_ENABLED.format(owner.getOptionName(),uri)); else { error( Messages.ERR_UNSUPPORTED_EXTENSION.format(uri) );
/** * If the tag name belongs to a plugin namespace-wise, check its local name * to make sure it's correct. */ protected final void verifyTagName(String namespaceURI, String localName, String qName) throws SAXException { if(options.pluginURIs.contains(namespaceURI)) { // make sure that this is a valid tag name boolean correct = false; for( Plugin p : options.activePlugins ) { if(p.isCustomizationTagName(namespaceURI,localName)) { correct = true; break; } } if(!correct) { error( Messages.ERR_ILLEGAL_CUSTOMIZATION_TAGNAME.format(qName) ); startCutting(); } } }
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException { if( !isCutting() ) { if(!uri.equals("")) { // "" is the standard namespace checkAndEnable(uri); verifyTagName(uri, localName, qName); if(needsToBePruned(uri)) startCutting(); } } super.startElement(uri, localName, qName, atts); } }
/** * @param handler * This error handler will receive detected errors. */ public AbstractExtensionBindingChecker( String schemaLanguage, Options options, ErrorHandler handler ) { this.schemaLanguage = schemaLanguage; this.allowExtensions = options.compatibilityMode!=Options.STRICT; this.options = options; setErrorHandler(handler); for (Plugin plugin : options.getAllPlugins()) recognizableExtensions.addAll(plugin.getCustomizationURIs()); recognizableExtensions.add(Const.XJC_EXTENSION_URI); }
if( !isRecognizableExtension(uri) ) { String nearest = EditDistance.findNearest(uri, recognizableExtensions); error( Messages.ERR_UNSUPPORTED_EXTENSION.format(uri,nearest) ); } else if( !isSupportedExtension(uri) ) { error( Messages.ERR_PLUGIN_NOT_ENABLED.format(owner.getOptionName(),uri)); else { error( Messages.ERR_UNSUPPORTED_EXTENSION.format(uri) );
/** * If the tag name belongs to a plugin namespace-wise, check its local name * to make sure it's correct. */ protected final void verifyTagName(String namespaceURI, String localName, String qName) throws SAXException { if(options.pluginURIs.contains(namespaceURI)) { // make sure that this is a valid tag name boolean correct = false; for( Plugin p : options.activePlugins ) { if(p.isCustomizationTagName(namespaceURI,localName)) { correct = true; break; } } if(!correct) { error( Messages.ERR_ILLEGAL_CUSTOMIZATION_TAGNAME.format(qName) ); startCutting(); } } }
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException { if( !isCutting() ) { if(!uri.equals("")) { // "" is the standard namespace checkAndEnable(uri); verifyTagName(uri, localName, qName); if(needsToBePruned(uri)) startCutting(); } } super.startElement(uri, localName, qName, atts); } }
/** * @param handler * This error handler will receive detected errors. */ public AbstractExtensionBindingChecker( String schemaLanguage, Options options, ErrorHandler handler ) { this.schemaLanguage = schemaLanguage; this.allowExtensions = options.compatibilityMode!=Options.STRICT; this.options = options; setErrorHandler(handler); for (Plugin plugin : options.getAllPlugins()) recognizableExtensions.addAll(plugin.getCustomizationURIs()); recognizableExtensions.add(Const.XJC_EXTENSION_URI); }
if( !isRecognizableExtension(uri) ) { String nearest = EditDistance.findNearest(uri, recognizableExtensions); error( Messages.ERR_UNSUPPORTED_EXTENSION.format(uri,nearest) ); } else if( !isSupportedExtension(uri) ) { error( Messages.ERR_PLUGIN_NOT_ENABLED.format(owner.getOptionName(),uri)); else { error( Messages.ERR_UNSUPPORTED_EXTENSION.format(uri) );
/** * If the tag name belongs to a plugin namespace-wise, check its local name * to make sure it's correct. */ protected final void verifyTagName(String namespaceURI, String localName, String qName) throws SAXException { if(options.pluginURIs.contains(namespaceURI)) { // make sure that this is a valid tag name boolean correct = false; for( Plugin p : options.activePlugins ) { if(p.isCustomizationTagName(namespaceURI,localName)) { correct = true; break; } } if(!correct) { error( Messages.ERR_ILLEGAL_CUSTOMIZATION_TAGNAME.format(qName) ); startCutting(); } } }
/** * Reports a warning. */ protected final void warning( String msg ) throws SAXException { SAXParseException spe = new SAXParseException( msg, locator ); getErrorHandler().warning(spe); } }
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException { if( !isCutting() ) { if(!uri.equals("")) { // "" is the standard namespace checkAndEnable(uri); verifyTagName(uri, localName, qName); if(needsToBePruned(uri)) startCutting(); } } super.startElement(uri, localName, qName, atts); } }
/** * @param handler * This error handler will receive detected errors. */ public AbstractExtensionBindingChecker( String schemaLanguage, Options options, ErrorHandler handler ) { this.schemaLanguage = schemaLanguage; this.allowExtensions = options.compatibilityMode!=Options.STRICT; this.options = options; setErrorHandler(handler); for (Plugin plugin : options.getAllPlugins()) recognizableExtensions.addAll(plugin.getCustomizationURIs()); recognizableExtensions.add(Const.XJC_EXTENSION_URI); }
@Override public void startDocument() throws SAXException { super.startDocument(); count=0; }
if( !isRecognizableExtension(uri) ) { String nearest = EditDistance.findNearest(uri, recognizableExtensions); error( Messages.ERR_UNSUPPORTED_EXTENSION.format(uri,nearest) ); } else if( !isSupportedExtension(uri) ) { error( Messages.ERR_PLUGIN_NOT_ENABLED.format(owner.getOptionName(),uri)); else { error( Messages.ERR_UNSUPPORTED_EXTENSION.format(uri) );
/** * If the tag name belongs to a plugin namespace-wise, check its local name * to make sure it's correct. */ protected final void verifyTagName(String namespaceURI, String localName, String qName) throws SAXException { if(options.pluginURIs.contains(namespaceURI)) { // make sure that this is a valid tag name boolean correct = false; for( Plugin p : options.activePlugins ) { if(p.isCustomizationTagName(namespaceURI,localName)) { correct = true; break; } } if(!correct) { error( Messages.ERR_ILLEGAL_CUSTOMIZATION_TAGNAME.format(qName) ); startCutting(); } } }
/** * Reports an error and returns the created SAXParseException */ protected final SAXParseException error( String msg ) throws SAXException { SAXParseException spe = new SAXParseException( msg, locator ); getErrorHandler().error(spe); return spe; }
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException { if( !isCutting() ) { if(!uri.equals("")) { // "" is the standard namespace checkAndEnable(uri); verifyTagName(uri, localName, qName); if(needsToBePruned(uri)) startCutting(); } } super.startElement(uri, localName, qName, atts); } }