當前位置: 首頁>>代碼示例>>Java>>正文


Java XmlIDREF類代碼示例

本文整理匯總了Java中javax.xml.bind.annotation.XmlIDREF的典型用法代碼示例。如果您正苦於以下問題:Java XmlIDREF類的具體用法?Java XmlIDREF怎麽用?Java XmlIDREF使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


XmlIDREF類屬於javax.xml.bind.annotation包,在下文中一共展示了XmlIDREF類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: calcId

import javax.xml.bind.annotation.XmlIDREF; //導入依賴的package包/類
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;
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:12,代碼來源:ElementInfoImpl.java

示例2: calcId

import javax.xml.bind.annotation.XmlIDREF; //導入依賴的package包/類
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;
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:16,代碼來源:PropertyInfoImpl.java

示例3: generateAdapterIfNecessary

import javax.xml.bind.annotation.XmlIDREF; //導入依賴的package包/類
/**
 * 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());
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:32,代碼來源:BeanGenerator.java

示例4: getLights

import javax.xml.bind.annotation.XmlIDREF; //導入依賴的package包/類
@XmlIDREF
public List<Light> getLights() {
	if (lights==null) {
		lights=new ArrayList<Light>();
	}
	
	return lights;
}
 
開發者ID:comdata,項目名稱:HomeAutomation,代碼行數:9,代碼來源:Room.java

示例5: calcId

import javax.xml.bind.annotation.XmlIDREF; //導入依賴的package包/類
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;
	}
}
 
開發者ID:GeeQuery,項目名稱:cxf-plus,代碼行數:13,代碼來源:PropertyInfoImpl.java

示例6: getNode

import javax.xml.bind.annotation.XmlIDREF; //導入依賴的package包/類
@ManyToOne(optional=false, fetch=FetchType.LAZY)
@JoinColumn(name="nodeId")
@XmlElement(name="nodeId")
@XmlIDREF
public OnmsNode getNode() {
    return m_node;
}
 
開發者ID:qoswork,項目名稱:opennmszh,代碼行數:8,代碼來源:OnmsStpInterface.java

示例7: getNode

import javax.xml.bind.annotation.XmlIDREF; //導入依賴的package包/類
/**
 * <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;
}
 
開發者ID:qoswork,項目名稱:opennmszh,代碼行數:13,代碼來源:OnmsIpInterface.java

示例8: getNode

import javax.xml.bind.annotation.XmlIDREF; //導入依賴的package包/類
/**
 * <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;
}
 
開發者ID:qoswork,項目名稱:opennmszh,代碼行數:13,代碼來源:OnmsSnmpInterface.java

示例9: getNode

import javax.xml.bind.annotation.XmlIDREF; //導入依賴的package包/類
/**
 * <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;
}
 
開發者ID:qoswork,項目名稱:opennmszh,代碼行數:13,代碼來源:OnmsEvent.java

示例10: getDataLinkInterface

import javax.xml.bind.annotation.XmlIDREF; //導入依賴的package包/類
/**
 * <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;
}
 
開發者ID:qoswork,項目名稱:opennmszh,代碼行數:12,代碼來源:OnmsLinkState.java

示例11: getIpInterface

import javax.xml.bind.annotation.XmlIDREF; //導入依賴的package包/類
/**
 * <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;
}
 
開發者ID:qoswork,項目名稱:opennmszh,代碼行數:13,代碼來源:OnmsMonitoredService.java

示例12: getNode

import javax.xml.bind.annotation.XmlIDREF; //導入依賴的package包/類
/**
 * The node this asset information belongs to.
 *
 * @return a {@link org.opennms.netmgt.model.OnmsNode} object.
 */
@XmlIDREF
@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "nodeId")
public OnmsNode getNode() {
    return m_node;
}
 
開發者ID:qoswork,項目名稱:opennmszh,代碼行數:12,代碼來源:OnmsAssetRecord.java

示例13: getMap

import javax.xml.bind.annotation.XmlIDREF; //導入依賴的package包/類
/**
 * <p>Getter for the field <code>map</code>.</p>
 *
 * @return a {@link org.opennms.netmgt.model.OnmsMap} object.
 */
@ManyToOne(optional=false, fetch=FetchType.LAZY)
@JoinColumn(name="mapId")
@XmlIDREF
public OnmsMap getMap() {
    return map;
}
 
開發者ID:qoswork,項目名稱:opennmszh,代碼行數:12,代碼來源:OnmsMapElement.java

示例14: calcId

import javax.xml.bind.annotation.XmlIDREF; //導入依賴的package包/類
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;
    }
}
 
開發者ID:alexkasko,項目名稱:openjdk-icedtea7,代碼行數:16,代碼來源:PropertyInfoImpl.java

示例15: generateAdapterIfNecessary

import javax.xml.bind.annotation.XmlIDREF; //導入依賴的package包/類
/**
 * 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() == SwaRefAdapter.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());
    }
}
 
開發者ID:alexkasko,項目名稱:openjdk-icedtea7,代碼行數:32,代碼來源:BeanGenerator.java


注:本文中的javax.xml.bind.annotation.XmlIDREF類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。