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


Java RawTypeSet类代码示例

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


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

示例1: canBeType

import com.sun.tools.internal.xjc.reader.RawTypeSet; //导入依赖的package包/类
protected RawTypeSet.Mode canBeType(RawTypeSet parent) {
    // 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()) && target.idUse()!=ID.NONE)
        return RawTypeSet.Mode.MUST_BE_REFERENCE;
    if(parent.refs.size() > 1 && target.getAdapterUse() != null)
        return RawTypeSet.Mode.MUST_BE_REFERENCE;

    // nillable and optional at the same time. needs an element wrapper to distinguish those
    // two states. But this is not a hard requirement.
    if(decl.isNillable() && parent.mul.isOptional())
        return RawTypeSet.Mode.CAN_BE_TYPEREF;

    return RawTypeSet.Mode.SHOULD_BE_TYPEREF;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:RawTypeSetBuilder.java

示例2: build

import com.sun.tools.internal.xjc.reader.RawTypeSet; //导入依赖的package包/类
public void build(XSComplexType ct) {
    XSContentType contentType = ct.getContentType();

    builder.recordBindingMode(ct, FALLBACK_CONTENT);
    BIProperty prop = BIProperty.getCustomization(ct);

    CPropertyInfo p;

    if(contentType.asEmpty()!=null) {
        p = prop.createValueProperty("Content",false,ct,CBuiltinLeafInfo.STRING,null);
    } else {
        RawTypeSet ts = RawTypeSetBuilder.build(contentType.asParticle(),false);
        p = prop.createReferenceProperty("Content", false, ct, ts, true, false, true, false);
    }

    selector.getCurrentBean().addProperty(p);

    // adds attributes and we are through.
    green.attContainer(ct);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:MultiWildcardComplexTypeBuilder.java

示例3: createElementProperty

import com.sun.tools.internal.xjc.reader.RawTypeSet; //导入依赖的package包/类
/**
 *
 *
 * @param defaultName
 *      If the name is not customized, this name will be used
 *      as the default. Note that the name conversion <b>MUST</b>
 *      be applied before this method is called if necessary.
 * @param source
 *      Source schema component from which a field is built.
 */
public CElementPropertyInfo createElementProperty(String defaultName, boolean forConstant, XSParticle source,
                                                  RawTypeSet types) {

    if(!types.refs.isEmpty())
        // if this property is empty, don't acknowleedge the customization
        // this allows pointless property customization to be reported as an error
        markAsAcknowledged();
    constantPropertyErrorCheck();

    String name = getPropertyName(forConstant);
    if(name==null)
        name = defaultName;

    CElementPropertyInfo prop = wrapUp(
        new CElementPropertyInfo(
            name, types.getCollectionMode(),
            types.id(),
            types.getExpectedMimeType(),
            source, getCustomizations(source),
            source.getLocator(), types.isRequired()),
        source);

    types.addTo(prop);

    BIInlineBinaryData.handle(source.getTerm(), prop);
    return prop;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:38,代码来源:BIProperty.java

示例4: createDummyExtendedMixedReferenceProperty

import com.sun.tools.internal.xjc.reader.RawTypeSet; //导入依赖的package包/类
public CReferencePropertyInfo createDummyExtendedMixedReferenceProperty(
        String defaultName, XSComponent source, RawTypeSet types) {
        return createReferenceProperty(
                defaultName,
                false,
                source,
                types,
                true,
                true,
                false,
                true);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:BIProperty.java

示例5: createContentExtendedMixedReferenceProperty

import com.sun.tools.internal.xjc.reader.RawTypeSet; //导入依赖的package包/类
public CReferencePropertyInfo createContentExtendedMixedReferenceProperty(
        String defaultName, XSComponent source, RawTypeSet types) {
        return createReferenceProperty(
                defaultName,
                false,
                source,
                types,
                true,
                false,
                true,
                true);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:BIProperty.java

示例6: createReferenceProperty

import com.sun.tools.internal.xjc.reader.RawTypeSet; //导入依赖的package包/类
public CReferencePropertyInfo createReferenceProperty(
        String defaultName, boolean forConstant, XSComponent source,
        RawTypeSet types, boolean isMixed, boolean dummy, boolean content, boolean isMixedExtended) {

    if (types == null) {    // this is a special case where we need to generate content because potential subtypes would need to be able to override what's store inside
        content = true;
    } else {
        if(!types.refs.isEmpty())
            // if this property is empty, don't acknowleedge the customization
            // this allows pointless property customization to be reported as an error
            markAsAcknowledged();
    }
    constantPropertyErrorCheck();

    String name = getPropertyName(forConstant);
    if(name==null)
        name = defaultName;

    CReferencePropertyInfo prop = wrapUp(
                                        new CReferencePropertyInfo(
                                            name,
                                            (types == null) ? true : types.getCollectionMode().isRepeated()||isMixed,
                                            (types == null) ? false : types.isRequired(),
                                            isMixed,
                                            source,
                                            getCustomizations(source), source.getLocator(), dummy, content, isMixedExtended),
                                    source);
    if (types != null) {
        types.addTo(prop);
    }

    BIInlineBinaryData.handle(source, prop);
    return prop;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:35,代码来源:BIProperty.java

示例7: createElementOrReferenceProperty

import com.sun.tools.internal.xjc.reader.RawTypeSet; //导入依赖的package包/类
public CPropertyInfo createElementOrReferenceProperty(
        String defaultName, boolean forConstant, XSParticle source,
        RawTypeSet types) {

    boolean generateRef;

    switch(types.canBeTypeRefs) {
    case CAN_BE_TYPEREF:
    case SHOULD_BE_TYPEREF:
        // it's up to the use
        Boolean b = generateElementProperty();
        if(b==null) // follow XJC recommendation
            generateRef = types.canBeTypeRefs== RawTypeSet.Mode.CAN_BE_TYPEREF;
        else // use the value user gave us
            generateRef = b;
        break;
    case MUST_BE_REFERENCE:
        generateRef = true;
        break;
    default:
        throw new AssertionError();
    }

    if(generateRef) {
        return createReferenceProperty(defaultName,forConstant,source,types, false, false, false, false);
    } else {
        return createElementProperty(defaultName,forConstant,source,types);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:BIProperty.java

示例8: build

import com.sun.tools.internal.xjc.reader.RawTypeSet; //导入依赖的package包/类
/**
 * @param optional
 *      if this whole property is optional due to the
 *      occurrence constraints on ancestors, set this to true.
 *      this will prevent the primitive types to be generated.
 */
public static RawTypeSet build( XSParticle p, boolean optional ) {
    RawTypeSetBuilder rtsb = new RawTypeSetBuilder();
    rtsb.particle(p);
    Multiplicity mul = MultiplicityCounter.theInstance.particle(p);

    if(optional)
        mul = mul.makeOptional();

    return new RawTypeSet(rtsb.refs,mul);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:RawTypeSetBuilder.java


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