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


Java CElementPropertyInfo.getAdapter方法代码示例

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


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

示例1: calcDrilldown

import com.sun.tools.internal.xjc.model.CElementPropertyInfo; //导入方法依赖的package包/类
public final List<Property> calcDrilldown() {
    CElementPropertyInfo p = clazz.getProperty();

    if(p.getAdapter()!=null)
        return null;    // if adapted, avoid drill down

    if(p.isCollection())
    // things like <xs:element name="foo" type="xs:NMTOKENS" /> is not eligible.
        return null;

    CTypeInfo typeClass = p.ref().get(0);

    if(!(typeClass instanceof CClassInfo))
        // things like <xs:element name="foo" type="xs:string" /> is not eligible.
        return null;

    CClassInfo ci = (CClassInfo)typeClass;

    // if the type is abstract we can't use it.
    if(ci.isAbstract())
        return null;

    // the 'all' compositor doesn't qualify
    if(!ci.isOrdered())
        return null;

    return buildDrilldown(ci);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:ElementMappingImpl.java

示例2: canBeType

import com.sun.tools.internal.xjc.model.CElementPropertyInfo; //导入方法依赖的package包/类
protected RawTypeSet.Mode canBeType(RawTypeSet parent) {
    // if element substitution can occur, no way it can be mapped to a list of types
    if(decl.getSubstitutables().size()>1)
        return RawTypeSet.Mode.MUST_BE_REFERENCE;
    // BIXSubstitutable also simulates this effect. Useful for separate compilation
    BIXSubstitutable subst = builder.getBindInfo(decl).get(BIXSubstitutable.class);
    if(subst!=null) {
        subst.markAsAcknowledged();
        return RawTypeSet.Mode.MUST_BE_REFERENCE;
    }

    // we have no place to put an adater if this thing maps to a type
    CElementPropertyInfo p = target.getProperty();
    // if we have an adapter or IDness, which requires special
    // annotation, and there's more than one element,
    // we have no place to put the special annotation, so we need JAXBElement.
    if((parent.refs.size()>1 || !parent.mul.isAtMostOnce()) && p.id()!=ID.NONE)
        return RawTypeSet.Mode.MUST_BE_REFERENCE;
    if(parent.refs.size() > 1 && p.getAdapter() != null)
        return RawTypeSet.Mode.MUST_BE_REFERENCE;

    if(target.hasClass())
        // if the CElementInfo was explicitly bound to a class (which happen if and only if
        // the user requested so, then map that to reference property so that the user sees a class
        return RawTypeSet.Mode.CAN_BE_TYPEREF;
    else
        return RawTypeSet.Mode.SHOULD_BE_TYPEREF;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:RawTypeSetBuilder.java


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