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


Java Plugin类代码示例

本文整理汇总了Java中com.sun.tools.internal.xjc.Plugin的典型用法代码示例。如果您正苦于以下问题:Java Plugin类的具体用法?Java Plugin怎么用?Java Plugin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Plugin类属于com.sun.tools.internal.xjc包,在下文中一共展示了Plugin类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: verifyTagName

import com.sun.tools.internal.xjc.Plugin; //导入依赖的package包/类
/**
 * 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();
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:AbstractExtensionBindingChecker.java

示例2: BGMBuilder

import com.sun.tools.internal.xjc.Plugin; //导入依赖的package包/类
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();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:BGMBuilder.java

示例3: _build

import com.sun.tools.internal.xjc.Plugin; //导入依赖的package包/类
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));

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:BGMBuilder.java

示例4: AbstractExtensionBindingChecker

import com.sun.tools.internal.xjc.Plugin; //导入依赖的package包/类
/**
 * @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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:AbstractExtensionBindingChecker.java

示例5: checkAndEnable

import com.sun.tools.internal.xjc.Plugin; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:37,代码来源:AbstractExtensionBindingChecker.java

示例6: generateCode

import com.sun.tools.internal.xjc.Plugin; //导入依赖的package包/类
public JCodeModel generateCode(Plugin[] extensions,ErrorListener errorListener) {
    // we no longer do any code generation
    return outline.getCodeModel();
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:5,代码来源:JAXBModelImpl.java

示例7: generateCode

import com.sun.tools.internal.xjc.Plugin; //导入依赖的package包/类
/**
     * Fully-generate the source code into the given model.
     *
     * @return
     *      null if there was any errors. Otherwise it returns a valid
     *      {@link Outline} object, which captures how the model objects
     *      are mapped to the generated source code.
     *      <p>
     *      Add-ons can use those information to further augment the generated
     *      source code.
     */
    public Outline generateCode(Options opt,ErrorReceiver receiver) {
        ErrorReceiverFilter ehf = new ErrorReceiverFilter(receiver);

        // run extensions // moved to BGMBuilder._build() - issue with hyperjaxb3
//        for( Plugin ma : opt.activePlugins )
//            ma.postProcessModel(this,ehf);

        Outline o = BeanGenerator.generate(this, ehf);

        try {// run extensions
            for( Plugin ma : opt.activePlugins )
                ma.run(o,opt,ehf);
        } catch (SAXException e) {
            // fatal error. error should have been reported
            return null;
        }

        // check for unused plug-in customizations.
        // these can be only checked after the plug-ins run, so it's here.
        // the JAXB bindings are checked by XMLSchema's builder.
        Set<CCustomizations> check = new HashSet<CCustomizations>();
        for( CCustomizations c=customizations; c!=null; c=c.next ) {
            if(!check.add(c)) {
                throw new AssertionError(); // detect a loop
            }
            for (CPluginCustomization p : c) {
                if(!p.isAcknowledged()) {
                    ehf.error(
                        p.locator,
                        Messages.format(
                            Messages.ERR_UNACKNOWLEDGED_CUSTOMIZATION,
                            p.element.getNodeName()
                        ));
                    ehf.error(
                        c.getOwner().getLocator(),
                        Messages.format(
                            Messages.ERR_UNACKNOWLEDGED_CUSTOMIZATION_LOCATION));
                }
            }
        }

        if(ehf.hadError())
            o = null;
        return o;
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:57,代码来源:Model.java


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