com.sun.tools.internal.xjc.Plugin Java Examples

The following examples show how to use com.sun.tools.internal.xjc.Plugin. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractExtensionBindingChecker.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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();
        }
    }
}
 
Example #2
Source File: AbstractExtensionBindingChecker.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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();
        }
    }
}
 
Example #3
Source File: AbstractExtensionBindingChecker.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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();
        }
    }
}
 
Example #4
Source File: AbstractExtensionBindingChecker.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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();
        }
    }
}
 
Example #5
Source File: AbstractExtensionBindingChecker.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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();
        }
    }
}
 
Example #6
Source File: AbstractExtensionBindingChecker.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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();
        }
    }
}
 
Example #7
Source File: AbstractExtensionBindingChecker.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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();
        }
    }
}
 
Example #8
Source File: AbstractExtensionBindingChecker.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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();
        }
    }
}
 
Example #9
Source File: AbstractExtensionBindingChecker.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Verify that the given URI is indeed a valid extension namespace URI,
 * and if so enable it.
 * <p>
 * This method does all the error handling.
 */
protected final void checkAndEnable(String uri) throws SAXException {
    if( !isRecognizableExtension(uri) ) {
        String nearest = EditDistance.findNearest(uri, recognizableExtensions);
        // not the namespace URI we know of
        error( Messages.ERR_UNSUPPORTED_EXTENSION.format(uri,nearest) );
    } else
    if( !isSupportedExtension(uri) ) {
        // recognizable but not not supported, meaning
        // the plug-in isn't enabled

        // look for plug-in that handles this URI
        Plugin owner = null;
        for( Plugin p : options.getAllPlugins() ) {
            if(p.getCustomizationURIs().contains(uri)) {
                owner = p;
                break;
            }
        }
        if(owner!=null)
            // we know the plug-in that supports this namespace, but it's not enabled
            error( Messages.ERR_PLUGIN_NOT_ENABLED.format(owner.getOptionName(),uri));
        else {
            // this shouldn't happen, but be defensive...
            error( Messages.ERR_UNSUPPORTED_EXTENSION.format(uri) );
        }
    }

    // as an error recovery enable this namespace URI anyway.
    enabledExtensions.add(uri);
}
 
Example #10
Source File: AbstractExtensionBindingChecker.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Verify that the given URI is indeed a valid extension namespace URI,
 * and if so enable it.
 * <p>
 * This method does all the error handling.
 */
protected final void checkAndEnable(String uri) throws SAXException {
    if( !isRecognizableExtension(uri) ) {
        String nearest = EditDistance.findNearest(uri, recognizableExtensions);
        // not the namespace URI we know of
        error( Messages.ERR_UNSUPPORTED_EXTENSION.format(uri,nearest) );
    } else
    if( !isSupportedExtension(uri) ) {
        // recognizable but not not supported, meaning
        // the plug-in isn't enabled

        // look for plug-in that handles this URI
        Plugin owner = null;
        for( Plugin p : options.getAllPlugins() ) {
            if(p.getCustomizationURIs().contains(uri)) {
                owner = p;
                break;
            }
        }
        if(owner!=null)
            // we know the plug-in that supports this namespace, but it's not enabled
            error( Messages.ERR_PLUGIN_NOT_ENABLED.format(owner.getOptionName(),uri));
        else {
            // this shouldn't happen, but be defensive...
            error( Messages.ERR_UNSUPPORTED_EXTENSION.format(uri) );
        }
    }

    // as an error recovery enable this namespace URI anyway.
    enabledExtensions.add(uri);
}
 
Example #11
Source File: BGMBuilder.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void _build() {
    // do the binding
    buildContents();
    getClassSelector().executeTasks();

    // additional error check
    // Reports unused customizations to the user as errors.
    Ring.get(UnusedCustomizationChecker.class).run();

    Ring.get(ModelChecker.class).check();

    for( Plugin ma : activePlugins )
        ma.postProcessModel(model, Ring.get(ErrorReceiver.class));

}
 
Example #12
Source File: AbstractExtensionBindingChecker.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @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);
}
 
Example #13
Source File: BGMBuilder.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected BGMBuilder(String defaultPackage1, String defaultPackage2,
        boolean _inExtensionMode, FieldRendererFactory fieldRendererFactory,
        List<Plugin> activePlugins) {
    this.inExtensionMode = _inExtensionMode;
    this.defaultPackage1 = defaultPackage1;
    this.defaultPackage2 = defaultPackage2;
    this.fieldRendererFactory = fieldRendererFactory;
    this.activePlugins = activePlugins;
    promoteGlobalBindings();
}
 
Example #14
Source File: AbstractExtensionBindingChecker.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @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);
}
 
Example #15
Source File: AbstractExtensionBindingChecker.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Verify that the given URI is indeed a valid extension namespace URI,
 * and if so enable it.
 * <p>
 * This method does all the error handling.
 */
protected final void checkAndEnable(String uri) throws SAXException {
    if( !isRecognizableExtension(uri) ) {
        String nearest = EditDistance.findNearest(uri, recognizableExtensions);
        // not the namespace URI we know of
        error( Messages.ERR_UNSUPPORTED_EXTENSION.format(uri,nearest) );
    } else
    if( !isSupportedExtension(uri) ) {
        // recognizable but not not supported, meaning
        // the plug-in isn't enabled

        // look for plug-in that handles this URI
        Plugin owner = null;
        for( Plugin p : options.getAllPlugins() ) {
            if(p.getCustomizationURIs().contains(uri)) {
                owner = p;
                break;
            }
        }
        if(owner!=null)
            // we know the plug-in that supports this namespace, but it's not enabled
            error( Messages.ERR_PLUGIN_NOT_ENABLED.format(owner.getOptionName(),uri));
        else {
            // this shouldn't happen, but be defensive...
            error( Messages.ERR_UNSUPPORTED_EXTENSION.format(uri) );
        }
    }

    // as an error recovery enable this namespace URI anyway.
    enabledExtensions.add(uri);
}
 
Example #16
Source File: AbstractExtensionBindingChecker.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Verify that the given URI is indeed a valid extension namespace URI,
 * and if so enable it.
 * <p>
 * This method does all the error handling.
 */
protected final void checkAndEnable(String uri) throws SAXException {
    if( !isRecognizableExtension(uri) ) {
        String nearest = EditDistance.findNearest(uri, recognizableExtensions);
        // not the namespace URI we know of
        error( Messages.ERR_UNSUPPORTED_EXTENSION.format(uri,nearest) );
    } else
    if( !isSupportedExtension(uri) ) {
        // recognizable but not not supported, meaning
        // the plug-in isn't enabled

        // look for plug-in that handles this URI
        Plugin owner = null;
        for( Plugin p : options.getAllPlugins() ) {
            if(p.getCustomizationURIs().contains(uri)) {
                owner = p;
                break;
            }
        }
        if(owner!=null)
            // we know the plug-in that supports this namespace, but it's not enabled
            error( Messages.ERR_PLUGIN_NOT_ENABLED.format(owner.getOptionName(),uri));
        else {
            // this shouldn't happen, but be defensive...
            error( Messages.ERR_UNSUPPORTED_EXTENSION.format(uri) );
        }
    }

    // as an error recovery enable this namespace URI anyway.
    enabledExtensions.add(uri);
}
 
Example #17
Source File: BGMBuilder.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
protected BGMBuilder(String defaultPackage1, String defaultPackage2,
        boolean _inExtensionMode, FieldRendererFactory fieldRendererFactory,
        List<Plugin> activePlugins) {
    this.inExtensionMode = _inExtensionMode;
    this.defaultPackage1 = defaultPackage1;
    this.defaultPackage2 = defaultPackage2;
    this.fieldRendererFactory = fieldRendererFactory;
    this.activePlugins = activePlugins;
    promoteGlobalBindings();
}
 
Example #18
Source File: AbstractExtensionBindingChecker.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @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);
}
 
Example #19
Source File: BGMBuilder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected BGMBuilder(String defaultPackage1, String defaultPackage2,
        boolean _inExtensionMode, FieldRendererFactory fieldRendererFactory,
        List<Plugin> activePlugins) {
    this.inExtensionMode = _inExtensionMode;
    this.defaultPackage1 = defaultPackage1;
    this.defaultPackage2 = defaultPackage2;
    this.fieldRendererFactory = fieldRendererFactory;
    this.activePlugins = activePlugins;
    promoteGlobalBindings();
}
 
Example #20
Source File: BGMBuilder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void _build() {
    // do the binding
    buildContents();
    getClassSelector().executeTasks();

    // additional error check
    // Reports unused customizations to the user as errors.
    Ring.get(UnusedCustomizationChecker.class).run();

    Ring.get(ModelChecker.class).check();

    for( Plugin ma : activePlugins )
        ma.postProcessModel(model, Ring.get(ErrorReceiver.class));

}
 
Example #21
Source File: AbstractExtensionBindingChecker.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @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);
}
 
Example #22
Source File: AbstractExtensionBindingChecker.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Verify that the given URI is indeed a valid extension namespace URI,
 * and if so enable it.
 * <p>
 * This method does all the error handling.
 */
protected final void checkAndEnable(String uri) throws SAXException {
    if( !isRecognizableExtension(uri) ) {
        String nearest = EditDistance.findNearest(uri, recognizableExtensions);
        // not the namespace URI we know of
        error( Messages.ERR_UNSUPPORTED_EXTENSION.format(uri,nearest) );
    } else
    if( !isSupportedExtension(uri) ) {
        // recognizable but not not supported, meaning
        // the plug-in isn't enabled

        // look for plug-in that handles this URI
        Plugin owner = null;
        for( Plugin p : options.getAllPlugins() ) {
            if(p.getCustomizationURIs().contains(uri)) {
                owner = p;
                break;
            }
        }
        if(owner!=null)
            // we know the plug-in that supports this namespace, but it's not enabled
            error( Messages.ERR_PLUGIN_NOT_ENABLED.format(owner.getOptionName(),uri));
        else {
            // this shouldn't happen, but be defensive...
            error( Messages.ERR_UNSUPPORTED_EXTENSION.format(uri) );
        }
    }

    // as an error recovery enable this namespace URI anyway.
    enabledExtensions.add(uri);
}
 
Example #23
Source File: AbstractExtensionBindingChecker.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @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);
}
 
Example #24
Source File: BGMBuilder.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private void _build() {
    // do the binding
    buildContents();
    getClassSelector().executeTasks();

    // additional error check
    // Reports unused customizations to the user as errors.
    Ring.get(UnusedCustomizationChecker.class).run();

    Ring.get(ModelChecker.class).check();

    for( Plugin ma : activePlugins )
        ma.postProcessModel(model, Ring.get(ErrorReceiver.class));

}
 
Example #25
Source File: BGMBuilder.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected BGMBuilder(String defaultPackage1, String defaultPackage2,
        boolean _inExtensionMode, FieldRendererFactory fieldRendererFactory,
        List<Plugin> activePlugins) {
    this.inExtensionMode = _inExtensionMode;
    this.defaultPackage1 = defaultPackage1;
    this.defaultPackage2 = defaultPackage2;
    this.fieldRendererFactory = fieldRendererFactory;
    this.activePlugins = activePlugins;
    promoteGlobalBindings();
}
 
Example #26
Source File: BGMBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected BGMBuilder(String defaultPackage1, String defaultPackage2,
        boolean _inExtensionMode, FieldRendererFactory fieldRendererFactory,
        List<Plugin> activePlugins) {
    this.inExtensionMode = _inExtensionMode;
    this.defaultPackage1 = defaultPackage1;
    this.defaultPackage2 = defaultPackage2;
    this.fieldRendererFactory = fieldRendererFactory;
    this.activePlugins = activePlugins;
    promoteGlobalBindings();
}
 
Example #27
Source File: BGMBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private void _build() {
    // do the binding
    buildContents();
    getClassSelector().executeTasks();

    // additional error check
    // Reports unused customizations to the user as errors.
    Ring.get(UnusedCustomizationChecker.class).run();

    Ring.get(ModelChecker.class).check();

    for( Plugin ma : activePlugins )
        ma.postProcessModel(model, Ring.get(ErrorReceiver.class));

}
 
Example #28
Source File: AbstractExtensionBindingChecker.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @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);
}
 
Example #29
Source File: AbstractExtensionBindingChecker.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Verify that the given URI is indeed a valid extension namespace URI,
 * and if so enable it.
 * <p>
 * This method does all the error handling.
 */
protected final void checkAndEnable(String uri) throws SAXException {
    if( !isRecognizableExtension(uri) ) {
        String nearest = EditDistance.findNearest(uri, recognizableExtensions);
        // not the namespace URI we know of
        error( Messages.ERR_UNSUPPORTED_EXTENSION.format(uri,nearest) );
    } else
    if( !isSupportedExtension(uri) ) {
        // recognizable but not not supported, meaning
        // the plug-in isn't enabled

        // look for plug-in that handles this URI
        Plugin owner = null;
        for( Plugin p : options.getAllPlugins() ) {
            if(p.getCustomizationURIs().contains(uri)) {
                owner = p;
                break;
            }
        }
        if(owner!=null)
            // we know the plug-in that supports this namespace, but it's not enabled
            error( Messages.ERR_PLUGIN_NOT_ENABLED.format(owner.getOptionName(),uri));
        else {
            // this shouldn't happen, but be defensive...
            error( Messages.ERR_UNSUPPORTED_EXTENSION.format(uri) );
        }
    }

    // as an error recovery enable this namespace URI anyway.
    enabledExtensions.add(uri);
}
 
Example #30
Source File: BGMBuilder.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected BGMBuilder(String defaultPackage1, String defaultPackage2,
        boolean _inExtensionMode, FieldRendererFactory fieldRendererFactory,
        List<Plugin> activePlugins) {
    this.inExtensionMode = _inExtensionMode;
    this.defaultPackage1 = defaultPackage1;
    this.defaultPackage2 = defaultPackage2;
    this.fieldRendererFactory = fieldRendererFactory;
    this.activePlugins = activePlugins;
    promoteGlobalBindings();
}