java类javax.xml.bind.annotation.XmlIDREF的实例源码

ElementInfoImpl.java 文件源码 项目:OpenJSharp 阅读 25 收藏 0 点赞 0 评论 0
private ID calcId() {
    // TODO: share code with PropertyInfoImpl
    if(reader().hasMethodAnnotation(XmlID.class,method)) {
        return ID.ID;
    } else
    if(reader().hasMethodAnnotation(XmlIDREF.class,method)) {
        return ID.IDREF;
    } else {
        return ID.NONE;
    }
}
PropertyInfoImpl.java 文件源码 项目:OpenJSharp 阅读 28 收藏 0 点赞 0 评论 0
private ID calcId() {
    if(seed.hasAnnotation(XmlID.class)) {
        // check the type
        if(!nav().isSameType(getIndividualType(), nav().ref(String.class)))
            parent.builder.reportError(new IllegalAnnotationException(
                Messages.ID_MUST_BE_STRING.format(getName()), seed )
            );
        return ID.ID;
    } else
    if(seed.hasAnnotation(XmlIDREF.class)) {
        return ID.IDREF;
    } else {
        return ID.NONE;
    }
}
BeanGenerator.java 文件源码 项目:OpenJSharp 阅读 23 收藏 0 点赞 0 评论 0
/**
 * Generates {@link XmlJavaTypeAdapter} from {@link PropertyInfo} if necessary.
 * Also generates other per-property annotations
 * (such as {@link XmlID}, {@link XmlIDREF}, and {@link XmlMimeType} if necessary.
 */
public final void generateAdapterIfNecessary(CPropertyInfo prop, JAnnotatable field) {
    CAdapter adapter = prop.getAdapter();
    if (adapter != null) {
        if (adapter.getAdapterIfKnown() == SwaRefAdapterMarker.class) {
            field.annotate(XmlAttachmentRef.class);
        } else {
            // [RESULT]
            // @XmlJavaTypeAdapter( Foo.class )
            XmlJavaTypeAdapterWriter xjtw = field.annotate2(XmlJavaTypeAdapterWriter.class);
            xjtw.value(adapter.adapterType.toType(this, EXPOSED));
        }
    }

    switch (prop.id()) {
        case ID:
            field.annotate(XmlID.class);
            break;
        case IDREF:
            field.annotate(XmlIDREF.class);
            break;
    }

    if (prop.getExpectedMimeType() != null) {
        field.annotate2(XmlMimeTypeWriter.class).value(prop.getExpectedMimeType().toString());
    }
}
BeanGenerator.java 文件源码 项目:openjdk-jdk10 阅读 30 收藏 0 点赞 0 评论 0
/**
 * Generates {@link XmlJavaTypeAdapter} from {@link PropertyInfo} if necessary.
 * Also generates other per-property annotations
 * (such as {@link XmlID}, {@link XmlIDREF}, and {@link XmlMimeType} if necessary.
 */
public final void generateAdapterIfNecessary(CPropertyInfo prop, JAnnotatable field) {
    CAdapter adapter = prop.getAdapter();
    if (adapter != null) {
        if (adapter.getAdapterIfKnown() == SwaRefAdapterMarker.class) {
            field.annotate(XmlAttachmentRef.class);
        } else {
            // [RESULT]
            // @XmlJavaTypeAdapter( Foo.class )
            XmlJavaTypeAdapterWriter xjtw = field.annotate2(XmlJavaTypeAdapterWriter.class);
            xjtw.value(adapter.adapterType.toType(this, EXPOSED));
        }
    }

    switch (prop.id()) {
        case ID:
            field.annotate(XmlID.class);
            break;
        case IDREF:
            field.annotate(XmlIDREF.class);
            break;
    }

    if (prop.getExpectedMimeType() != null) {
        field.annotate2(XmlMimeTypeWriter.class).value(prop.getExpectedMimeType().toString());
    }
}
ElementInfoImpl.java 文件源码 项目:openjdk-jdk10 阅读 29 收藏 0 点赞 0 评论 0
private ID calcId() {
    // TODO: share code with PropertyInfoImpl
    if(reader().hasMethodAnnotation(XmlID.class,method)) {
        return ID.ID;
    } else
    if(reader().hasMethodAnnotation(XmlIDREF.class,method)) {
        return ID.IDREF;
    } else {
        return ID.NONE;
    }
}
PropertyInfoImpl.java 文件源码 项目:openjdk-jdk10 阅读 26 收藏 0 点赞 0 评论 0
private ID calcId() {
    if(seed.hasAnnotation(XmlID.class)) {
        // check the type
        if(!nav().isSameType(getIndividualType(), nav().ref(String.class)))
            parent.builder.reportError(new IllegalAnnotationException(
                Messages.ID_MUST_BE_STRING.format(getName()), seed )
            );
        return ID.ID;
    } else
    if(seed.hasAnnotation(XmlIDREF.class)) {
        return ID.IDREF;
    } else {
        return ID.NONE;
    }
}
BeanGenerator.java 文件源码 项目:openjdk9 阅读 22 收藏 0 点赞 0 评论 0
/**
 * Generates {@link XmlJavaTypeAdapter} from {@link PropertyInfo} if necessary.
 * Also generates other per-property annotations
 * (such as {@link XmlID}, {@link XmlIDREF}, and {@link XmlMimeType} if necessary.
 */
public final void generateAdapterIfNecessary(CPropertyInfo prop, JAnnotatable field) {
    CAdapter adapter = prop.getAdapter();
    if (adapter != null) {
        if (adapter.getAdapterIfKnown() == SwaRefAdapterMarker.class) {
            field.annotate(XmlAttachmentRef.class);
        } else {
            // [RESULT]
            // @XmlJavaTypeAdapter( Foo.class )
            XmlJavaTypeAdapterWriter xjtw = field.annotate2(XmlJavaTypeAdapterWriter.class);
            xjtw.value(adapter.adapterType.toType(this, EXPOSED));
        }
    }

    switch (prop.id()) {
        case ID:
            field.annotate(XmlID.class);
            break;
        case IDREF:
            field.annotate(XmlIDREF.class);
            break;
    }

    if (prop.getExpectedMimeType() != null) {
        field.annotate2(XmlMimeTypeWriter.class).value(prop.getExpectedMimeType().toString());
    }
}
ElementInfoImpl.java 文件源码 项目:openjdk9 阅读 32 收藏 0 点赞 0 评论 0
private ID calcId() {
    // TODO: share code with PropertyInfoImpl
    if(reader().hasMethodAnnotation(XmlID.class,method)) {
        return ID.ID;
    } else
    if(reader().hasMethodAnnotation(XmlIDREF.class,method)) {
        return ID.IDREF;
    } else {
        return ID.NONE;
    }
}
PropertyInfoImpl.java 文件源码 项目:openjdk9 阅读 23 收藏 0 点赞 0 评论 0
private ID calcId() {
    if(seed.hasAnnotation(XmlID.class)) {
        // check the type
        if(!nav().isSameType(getIndividualType(), nav().ref(String.class)))
            parent.builder.reportError(new IllegalAnnotationException(
                Messages.ID_MUST_BE_STRING.format(getName()), seed )
            );
        return ID.ID;
    } else
    if(seed.hasAnnotation(XmlIDREF.class)) {
        return ID.IDREF;
    } else {
        return ID.NONE;
    }
}
ElementInfoImpl.java 文件源码 项目:lookaside_java-1.8.0-openjdk 阅读 28 收藏 0 点赞 0 评论 0
private ID calcId() {
    // TODO: share code with PropertyInfoImpl
    if(reader().hasMethodAnnotation(XmlID.class,method)) {
        return ID.ID;
    } else
    if(reader().hasMethodAnnotation(XmlIDREF.class,method)) {
        return ID.IDREF;
    } else {
        return ID.NONE;
    }
}
PropertyInfoImpl.java 文件源码 项目:lookaside_java-1.8.0-openjdk 阅读 23 收藏 0 点赞 0 评论 0
private ID calcId() {
    if(seed.hasAnnotation(XmlID.class)) {
        // check the type
        if(!nav().isSameType(getIndividualType(), nav().ref(String.class)))
            parent.builder.reportError(new IllegalAnnotationException(
                Messages.ID_MUST_BE_STRING.format(getName()), seed )
            );
        return ID.ID;
    } else
    if(seed.hasAnnotation(XmlIDREF.class)) {
        return ID.IDREF;
    } else {
        return ID.NONE;
    }
}
BeanGenerator.java 文件源码 项目:lookaside_java-1.8.0-openjdk 阅读 30 收藏 0 点赞 0 评论 0
/**
 * Generates {@link XmlJavaTypeAdapter} from {@link PropertyInfo} if necessary.
 * Also generates other per-property annotations
 * (such as {@link XmlID}, {@link XmlIDREF}, and {@link XmlMimeType} if necessary.
 */
public final void generateAdapterIfNecessary(CPropertyInfo prop, JAnnotatable field) {
    CAdapter adapter = prop.getAdapter();
    if (adapter != null) {
        if (adapter.getAdapterIfKnown() == SwaRefAdapterMarker.class) {
            field.annotate(XmlAttachmentRef.class);
        } else {
            // [RESULT]
            // @XmlJavaTypeAdapter( Foo.class )
            XmlJavaTypeAdapterWriter xjtw = field.annotate2(XmlJavaTypeAdapterWriter.class);
            xjtw.value(adapter.adapterType.toType(this, EXPOSED));
        }
    }

    switch (prop.id()) {
        case ID:
            field.annotate(XmlID.class);
            break;
        case IDREF:
            field.annotate(XmlIDREF.class);
            break;
    }

    if (prop.getExpectedMimeType() != null) {
        field.annotate2(XmlMimeTypeWriter.class).value(prop.getExpectedMimeType().toString());
    }
}
ElementInfoImpl.java 文件源码 项目:infobip-open-jdk-8 阅读 27 收藏 0 点赞 0 评论 0
private ID calcId() {
    // TODO: share code with PropertyInfoImpl
    if(reader().hasMethodAnnotation(XmlID.class,method)) {
        return ID.ID;
    } else
    if(reader().hasMethodAnnotation(XmlIDREF.class,method)) {
        return ID.IDREF;
    } else {
        return ID.NONE;
    }
}
PropertyInfoImpl.java 文件源码 项目:infobip-open-jdk-8 阅读 26 收藏 0 点赞 0 评论 0
private ID calcId() {
    if(seed.hasAnnotation(XmlID.class)) {
        // check the type
        if(!nav().isSameType(getIndividualType(), nav().ref(String.class)))
            parent.builder.reportError(new IllegalAnnotationException(
                Messages.ID_MUST_BE_STRING.format(getName()), seed )
            );
        return ID.ID;
    } else
    if(seed.hasAnnotation(XmlIDREF.class)) {
        return ID.IDREF;
    } else {
        return ID.NONE;
    }
}
BeanGenerator.java 文件源码 项目:infobip-open-jdk-8 阅读 23 收藏 0 点赞 0 评论 0
/**
 * Generates {@link XmlJavaTypeAdapter} from {@link PropertyInfo} if necessary.
 * Also generates other per-property annotations
 * (such as {@link XmlID}, {@link XmlIDREF}, and {@link XmlMimeType} if necessary.
 */
public final void generateAdapterIfNecessary(CPropertyInfo prop, JAnnotatable field) {
    CAdapter adapter = prop.getAdapter();
    if (adapter != null) {
        if (adapter.getAdapterIfKnown() == SwaRefAdapterMarker.class) {
            field.annotate(XmlAttachmentRef.class);
        } else {
            // [RESULT]
            // @XmlJavaTypeAdapter( Foo.class )
            XmlJavaTypeAdapterWriter xjtw = field.annotate2(XmlJavaTypeAdapterWriter.class);
            xjtw.value(adapter.adapterType.toType(this, EXPOSED));
        }
    }

    switch (prop.id()) {
        case ID:
            field.annotate(XmlID.class);
            break;
        case IDREF:
            field.annotate(XmlIDREF.class);
            break;
    }

    if (prop.getExpectedMimeType() != null) {
        field.annotate2(XmlMimeTypeWriter.class).value(prop.getExpectedMimeType().toString());
    }
}
Room.java 文件源码 项目:HomeAutomation 阅读 27 收藏 0 点赞 0 评论 0
@XmlIDREF
public List<Light> getLights() {
    if (lights==null) {
        lights=new ArrayList<Light>();
    }

    return lights;
}
ElementInfoImpl.java 文件源码 项目:cxf-plus 阅读 25 收藏 0 点赞 0 评论 0
private ID calcId() {
    // TODO: share code with PropertyInfoImpl
    if(reader().hasMethodAnnotation(XmlID.class,method)) {
        return ID.ID;
    } else
    if(reader().hasMethodAnnotation(XmlIDREF.class,method)) {
        return ID.IDREF;
    } else {
        return ID.NONE;
    }
}
PropertyInfoImpl.java 文件源码 项目:cxf-plus 阅读 30 收藏 0 点赞 0 评论 0
private ID calcId() {
    if (seed.hasAnnotation(XmlID.class)) {
        // check the type
        if (!getIndividualType().equals(nav().ref(String.class)))
            parent.builder.reportError(new IllegalAnnotationException(Messages.ID_MUST_BE_STRING.format(getName()), seed));
        return ID.ID;
    } else if (seed.hasAnnotation(XmlIDREF.class)) {
        return ID.IDREF;
    } else {
        return ID.NONE;
    }
}
ElementInfoImpl.java 文件源码 项目:OLD-OpenJDK8 阅读 30 收藏 0 点赞 0 评论 0
private ID calcId() {
    // TODO: share code with PropertyInfoImpl
    if(reader().hasMethodAnnotation(XmlID.class,method)) {
        return ID.ID;
    } else
    if(reader().hasMethodAnnotation(XmlIDREF.class,method)) {
        return ID.IDREF;
    } else {
        return ID.NONE;
    }
}
PropertyInfoImpl.java 文件源码 项目:OLD-OpenJDK8 阅读 30 收藏 0 点赞 0 评论 0
private ID calcId() {
    if(seed.hasAnnotation(XmlID.class)) {
        // check the type
        if(!nav().isSameType(getIndividualType(), nav().ref(String.class)))
            parent.builder.reportError(new IllegalAnnotationException(
                Messages.ID_MUST_BE_STRING.format(getName()), seed )
            );
        return ID.ID;
    } else
    if(seed.hasAnnotation(XmlIDREF.class)) {
        return ID.IDREF;
    } else {
        return ID.NONE;
    }
}
BeanGenerator.java 文件源码 项目:OLD-OpenJDK8 阅读 42 收藏 0 点赞 0 评论 0
/**
 * Generates {@link XmlJavaTypeAdapter} from {@link PropertyInfo} if necessary.
 * Also generates other per-property annotations
 * (such as {@link XmlID}, {@link XmlIDREF}, and {@link XmlMimeType} if necessary.
 */
public final void generateAdapterIfNecessary(CPropertyInfo prop, JAnnotatable field) {
    CAdapter adapter = prop.getAdapter();
    if (adapter != null) {
        if (adapter.getAdapterIfKnown() == SwaRefAdapterMarker.class) {
            field.annotate(XmlAttachmentRef.class);
        } else {
            // [RESULT]
            // @XmlJavaTypeAdapter( Foo.class )
            XmlJavaTypeAdapterWriter xjtw = field.annotate2(XmlJavaTypeAdapterWriter.class);
            xjtw.value(adapter.adapterType.toType(this, EXPOSED));
        }
    }

    switch (prop.id()) {
        case ID:
            field.annotate(XmlID.class);
            break;
        case IDREF:
            field.annotate(XmlIDREF.class);
            break;
    }

    if (prop.getExpectedMimeType() != null) {
        field.annotate2(XmlMimeTypeWriter.class).value(prop.getExpectedMimeType().toString());
    }
}
OnmsStpInterface.java 文件源码 项目:opennmszh 阅读 30 收藏 0 点赞 0 评论 0
@ManyToOne(optional=false, fetch=FetchType.LAZY)
@JoinColumn(name="nodeId")
@XmlElement(name="nodeId")
@XmlIDREF
public OnmsNode getNode() {
    return m_node;
}
OnmsIpInterface.java 文件源码 项目:opennmszh 阅读 29 收藏 0 点赞 0 评论 0
/**
 * <p>getNode</p>
 *
 * @return a {@link org.opennms.netmgt.model.OnmsNode} object.
 */
@ManyToOne(optional=false, fetch=FetchType.LAZY)
@JoinColumn(name="nodeId")
@XmlElement(name="nodeId")
@XmlIDREF
public OnmsNode getNode() {
    return m_node;
}
OnmsSnmpInterface.java 文件源码 项目:opennmszh 阅读 29 收藏 0 点赞 0 评论 0
/**
 * <p>getNode</p>
 *
 * @return a {@link org.opennms.netmgt.model.OnmsNode} object.
 */
@XmlIDREF
@ManyToOne(optional = false, fetch = FetchType.LAZY)
@JoinColumn(name = "nodeId")
@XmlElement(name="nodeId")
public OnmsNode getNode() {
    return m_node;
}
OnmsEvent.java 文件源码 项目:opennmszh 阅读 28 收藏 0 点赞 0 评论 0
/**
 * <p>getNode</p>
 *
 * @return a {@link org.opennms.netmgt.model.OnmsNode} object.
 */
@XmlIDREF
@XmlElement(name="nodeId")
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="nodeId")
public OnmsNode getNode() {
    return m_node;
}
OnmsLinkState.java 文件源码 项目:opennmszh 阅读 22 收藏 0 点赞 0 评论 0
/**
 * <p>getDataLinkInterface</p>
 *
 * @return a {@link org.opennms.netmgt.model.DataLinkInterface} object.
 */
@XmlIDREF
@OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="datalinkinterfaceid")
public DataLinkInterface getDataLinkInterface() {
    return m_dataLinkInterface;
}
OnmsIpRouteInterface.java 文件源码 项目:opennmszh 阅读 27 收藏 0 点赞 0 评论 0
@ManyToOne(optional=false, fetch=FetchType.LAZY)
@JoinColumn(name="nodeId")
@XmlElement(name="nodeId")
@XmlIDREF
public OnmsNode getNode() {
    return m_node;
}
OnmsStpNode.java 文件源码 项目:opennmszh 阅读 26 收藏 0 点赞 0 评论 0
@ManyToOne(optional=false, fetch=FetchType.LAZY)
@JoinColumn(name="nodeId")
@XmlElement(name="nodeId")
@XmlIDREF
public OnmsNode getNode() {
    return m_node;
}
OnmsAtInterface.java 文件源码 项目:opennmszh 阅读 26 收藏 0 点赞 0 评论 0
@ManyToOne(optional=false, fetch=FetchType.LAZY)
@JoinColumn(name="nodeId")
@XmlElement(name="nodeId")
@XmlIDREF
public OnmsNode getNode() {
    return m_node;
}
OnmsMonitoredService.java 文件源码 项目:opennmszh 阅读 22 收藏 0 点赞 0 评论 0
/**
 * <p>getIpInterface</p>
 *
 * @return a {@link org.opennms.netmgt.model.OnmsIpInterface} object.
 */
@XmlIDREF
@XmlElement(name="ipInterfaceId")
@ManyToOne(optional=false, fetch=FetchType.LAZY)
@JoinColumn(name="ipInterfaceId")
public OnmsIpInterface getIpInterface() {
    return m_ipInterface;
}


问题


面经


文章

微信
公众号

扫码关注公众号