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


Java XSComponent.apply方法代码示例

本文整理汇总了Java中com.sun.xml.internal.xsom.XSComponent.apply方法的典型用法代码示例。如果您正苦于以下问题:Java XSComponent.apply方法的具体用法?Java XSComponent.apply怎么用?Java XSComponent.apply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.xml.internal.xsom.XSComponent的用法示例。


在下文中一共展示了XSComponent.apply方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ying

import com.sun.xml.internal.xsom.XSComponent; //导入方法依赖的package包/类
/**
 * If the component maps to a property, forwards to purple, otherwise to green.
 *
 * If the component is mapped to a type, this method needs to return true.
 * See the chart at the class javadoc.
 */
public void ying( XSComponent sc, @Nullable XSComponent referer ) {
    if(sc.apply(toPurple)==true || getClassSelector().bindToType(sc,referer)!=null)
        sc.visit(purple);
    else
        sc.visit(green);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:BGMBuilder.java

示例2: getDefault

import com.sun.xml.internal.xsom.XSComponent; //导入方法依赖的package包/类
private static BIProperty getDefault( BGMBuilder builder, XSComponent c ) {
    while(c!=null) {
        c = c.apply(defaultCustomizationFinder);
        if(c!=null) {
            BIProperty prop = builder.getBindInfo(c).get(BIProperty.class);
            if(prop!=null)  return prop;
        }
    }

    // default to the global one
    return builder.getGlobalBinding().getDefaultProperty();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:BIProperty.java

示例3: addSchemaFragmentJavadoc

import com.sun.xml.internal.xsom.XSComponent; //导入方法依赖的package包/类
/**
 * Copies a schema fragment into the javadoc of the generated class.
 */
private void addSchemaFragmentJavadoc( CClassInfo bean, XSComponent sc ) {

    // first, pick it up from <documentation> if any.
    String doc = builder.getBindInfo(sc).getDocumentation();
    if(doc!=null)
        append(bean, doc);

    // then the description of where this component came from
    Locator loc = sc.getLocator();
    String fileName = null;
    if(loc!=null) {
        fileName = loc.getPublicId();
        if(fileName==null)
            fileName = loc.getSystemId();
    }
    if(fileName==null)  fileName="";

    String lineNumber=Messages.format( Messages.JAVADOC_LINE_UNKNOWN);
    if(loc!=null && loc.getLineNumber()!=-1)
        lineNumber = String.valueOf(loc.getLineNumber());

    String componentName = sc.apply( new ComponentNameFunction() );
    String jdoc = Messages.format( Messages.JAVADOC_HEADING, componentName, fileName, lineNumber );
    append(bean,jdoc);

    // then schema fragment
    StringWriter out = new StringWriter();
    out.write("<pre>\n");
    SchemaWriter sw = new SchemaWriter(new JavadocEscapeWriter(out));
    sc.visit(sw);
    out.write("</pre>");
    append(bean,out.toString());
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:37,代码来源:ClassSelector.java

示例4: find

import com.sun.xml.internal.xsom.XSComponent; //导入方法依赖的package包/类
/**
 * Invokes this object as a visitor with the specified component.
 */
public final boolean find( XSComponent c ) {
    return c.apply(this);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:XSFinder.java

示例5: iterator

import com.sun.xml.internal.xsom.XSComponent; //导入方法依赖的package包/类
public Iterator<T> iterator(XSComponent contextNode) {
    return contextNode.apply(this);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:AbstractAxisImpl.java

示例6: _bindToClass

import com.sun.xml.internal.xsom.XSComponent; //导入方法依赖的package包/类
/**
 * The real meat of the "bindToType" code.
 *
 * @param cannotBeDelayed
 *      if the binding of the body of the class cannot be defered
 *      and needs to be done immediately. If the flag is false,
 *      the binding of the body will be done later, to avoid
 *      cyclic binding problem.
 * @param referer
 *      The component that refers to <tt>sc</tt>. This can be null,
 *      if figuring out the referer is too hard, in which case
 *      the error message might be less user friendly.
 */
// TODO: consider getting rid of "cannotBeDelayed"
CTypeInfo _bindToClass( @NotNull XSComponent sc, XSComponent referer, boolean cannotBeDelayed ) {
    // check if this class is already built.
    if(!bindMap.containsKey(sc)) {
        // craete a bind task

        // if this is a global declaration, make sure they will be generated
        // under a package.
        boolean isGlobal = false;
        if( sc instanceof XSDeclaration ) {
            isGlobal = ((XSDeclaration)sc).isGlobal();
            if( isGlobal )
                pushClassScope( new CClassInfoParent.Package(
                    getPackage(((XSDeclaration)sc).getTargetNamespace())) );
        }

        // otherwise check if this component should become a class.
        CElement bean = sc.apply(classBinder);

        if( isGlobal )
            popClassScope();

        if(bean==null)
            return null;

        // can this namespace generate a class?
        if (bean instanceof CClassInfo) {
            XSSchema os = sc.getOwnerSchema();
            BISchemaBinding sb = builder.getBindInfo(os).get(BISchemaBinding.class);
            if(sb!=null && !sb.map) {
                // nope
                getErrorReporter().error(sc.getLocator(),
                    Messages.ERR_REFERENCE_TO_NONEXPORTED_CLASS, sc.apply( new ComponentNameFunction() ) );
                getErrorReporter().error(sb.getLocation(),
                    Messages.ERR_REFERENCE_TO_NONEXPORTED_CLASS_MAP_FALSE, os.getTargetNamespace() );
                if(referer!=null)
                    getErrorReporter().error(referer.getLocator(),
                        Messages.ERR_REFERENCE_TO_NONEXPORTED_CLASS_REFERER, referer.apply( new ComponentNameFunction() ) );
            }
        }


        queueBuild( sc, bean );
    }

    Binding bind = bindMap.get(sc);
    if( cannotBeDelayed )
        bind.build();

    return bind.bean;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:65,代码来源:ClassSelector.java

示例7: _bindToClass

import com.sun.xml.internal.xsom.XSComponent; //导入方法依赖的package包/类
/**
 * The real meat of the "bindToType" code.
 *
 * @param cannotBeDelayed
 *      if the binding of the body of the class cannot be defered
 *      and needs to be done immediately. If the flag is false,
 *      the binding of the body will be done later, to avoid
 *      cyclic binding problem.
 * @param referer
 *      The component that refers to {@code sc}. This can be null,
 *      if figuring out the referer is too hard, in which case
 *      the error message might be less user friendly.
 */
// TODO: consider getting rid of "cannotBeDelayed"
CTypeInfo _bindToClass( @NotNull XSComponent sc, XSComponent referer, boolean cannotBeDelayed ) {
    // check if this class is already built.
    if(!bindMap.containsKey(sc)) {
        // craete a bind task

        // if this is a global declaration, make sure they will be generated
        // under a package.
        boolean isGlobal = false;
        if( sc instanceof XSDeclaration ) {
            isGlobal = ((XSDeclaration)sc).isGlobal();
            if( isGlobal )
                pushClassScope( new CClassInfoParent.Package(
                    getPackage(((XSDeclaration)sc).getTargetNamespace())) );
        }

        // otherwise check if this component should become a class.
        CElement bean = sc.apply(classBinder);

        if( isGlobal )
            popClassScope();

        if(bean==null)
            return null;

        // can this namespace generate a class?
        if (bean instanceof CClassInfo) {
            XSSchema os = sc.getOwnerSchema();
            BISchemaBinding sb = builder.getBindInfo(os).get(BISchemaBinding.class);
            if(sb!=null && !sb.map) {
                // nope
                getErrorReporter().error(sc.getLocator(),
                    Messages.ERR_REFERENCE_TO_NONEXPORTED_CLASS, sc.apply( new ComponentNameFunction() ) );
                getErrorReporter().error(sb.getLocation(),
                    Messages.ERR_REFERENCE_TO_NONEXPORTED_CLASS_MAP_FALSE, os.getTargetNamespace() );
                if(referer!=null)
                    getErrorReporter().error(referer.getLocator(),
                        Messages.ERR_REFERENCE_TO_NONEXPORTED_CLASS_REFERER, referer.apply( new ComponentNameFunction() ) );
            }
        }


        queueBuild( sc, bean );
    }

    Binding bind = bindMap.get(sc);
    if( cannotBeDelayed )
        bind.build();

    return bind.bean;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:65,代码来源:ClassSelector.java

示例8: get

import com.sun.xml.internal.xsom.XSComponent; //导入方法依赖的package包/类
/**
 * Gets the name of the specified component in the default locale.
 * This method is just a wrapper.
 */
public static String get( XSComponent comp ) {
    return (String)comp.apply(theInstance);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:NameGetter.java


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