Java Code Examples for com.sun.tools.internal.xjc.reader.RawTypeSet#Mode

The following examples show how to use com.sun.tools.internal.xjc.reader.RawTypeSet#Mode . 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: RawTypeSetBuilder.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
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;
}
 
Example 2
Source File: RawTypeSetBuilder.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
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;
}
 
Example 3
Source File: RawTypeSetBuilder.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
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;
}
 
Example 4
Source File: RawTypeSetBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
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;
}
 
Example 5
Source File: RawTypeSetBuilder.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
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;

    return RawTypeSet.Mode.SHOULD_BE_TYPEREF;
}
 
Example 6
Source File: RawTypeSetBuilder.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
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;

    return RawTypeSet.Mode.SHOULD_BE_TYPEREF;
}
 
Example 7
Source File: RawTypeSetBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
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;

    return RawTypeSet.Mode.SHOULD_BE_TYPEREF;
}
 
Example 8
Source File: RawTypeSetBuilder.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
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;

    return RawTypeSet.Mode.SHOULD_BE_TYPEREF;
}
 
Example 9
Source File: RawTypeSetBuilder.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 10
Source File: RawTypeSetBuilder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 11
Source File: RawTypeSetBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 12
Source File: RawTypeSetBuilder.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 13
Source File: RawTypeSetBuilder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
protected RawTypeSet.Mode canBeType(RawTypeSet parent) {
    return RawTypeSet.Mode.SHOULD_BE_TYPEREF;
}
 
Example 14
Source File: RawTypeSetBuilder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
protected RawTypeSet.Mode canBeType(RawTypeSet parent) {
    return RawTypeSet.Mode.MUST_BE_REFERENCE;
}
 
Example 15
Source File: RawTypeSetBuilder.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
protected RawTypeSet.Mode canBeType(RawTypeSet parent) {
    return RawTypeSet.Mode.SHOULD_BE_TYPEREF;
}
 
Example 16
Source File: RawTypeSetBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
protected RawTypeSet.Mode canBeType(RawTypeSet parent) {
    return RawTypeSet.Mode.MUST_BE_REFERENCE;
}
 
Example 17
Source File: RawTypeSetBuilder.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
protected RawTypeSet.Mode canBeType(RawTypeSet parent) {
    return RawTypeSet.Mode.MUST_BE_REFERENCE;
}
 
Example 18
Source File: RawTypeSetBuilder.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
protected RawTypeSet.Mode canBeType(RawTypeSet parent) {
    return RawTypeSet.Mode.MUST_BE_REFERENCE;
}
 
Example 19
Source File: RawTypeSetBuilder.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
protected RawTypeSet.Mode canBeType(RawTypeSet parent) {
    return RawTypeSet.Mode.SHOULD_BE_TYPEREF;
}
 
Example 20
Source File: RawTypeSetBuilder.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
protected RawTypeSet.Mode canBeType(RawTypeSet parent) {
    return RawTypeSet.Mode.MUST_BE_REFERENCE;
}