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


Java XmlID类代码示例

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


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

示例1: calcId

import javax.xml.bind.annotation.XmlID; //导入依赖的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.XmlID; //导入依赖的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.XmlID; //导入依赖的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: getIDXML

import javax.xml.bind.annotation.XmlID; //导入依赖的package包/类
@XmlID
@XmlAttribute(name = "id")
public String getIDXML() {
    if (this.id.isEmpty()) {
        this.id = Integer.toHexString(nextID++);
    }
    return this.id;
}
 
开发者ID:psyriccio,项目名称:v8fs,代码行数:9,代码来源:ChainIndexAdapter.java

示例5: createGetAssignedCertPathValidationPoliciesResponseCertPathValidationPolicyID

import javax.xml.bind.annotation.XmlID; //导入依赖的package包/类
/**
 * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
 * 
 */
@XmlElementDecl(namespace = "http://www.onvif.org/ver10/advancedsecurity/wsdl", name = "CertPathValidationPolicyID", scope = GetAssignedCertPathValidationPoliciesResponse.class)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
@XmlID
public JAXBElement<String> createGetAssignedCertPathValidationPoliciesResponseCertPathValidationPolicyID(String value) {
    return new JAXBElement<String>(_GetAssignedCertPathValidationPoliciesResponseCertPathValidationPolicyID_QNAME, String.class, GetAssignedCertPathValidationPoliciesResponse.class, value);
}
 
开发者ID:fpompermaier,项目名称:onvif,代码行数:11,代码来源:ObjectFactory.java

示例6: calcId

import javax.xml.bind.annotation.XmlID; //导入依赖的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

示例7: getInterfaceId

import javax.xml.bind.annotation.XmlID; //导入依赖的package包/类
/**
 * <p>getInterfaceId</p>
 *
 * @return a {@link java.lang.String} object.
 */
@XmlID
@XmlAttribute(name="id")
@Transient
public String getInterfaceId() {
    return getId().toString();
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:12,代码来源:OnmsIpInterface.java

示例8: getDataLinkInterfaceId

import javax.xml.bind.annotation.XmlID; //导入依赖的package包/类
/**
 * Get the ID as a string.  This exists only for XML serialization.
 */
@XmlID
@XmlAttribute(name="id")
@Transient
public String getDataLinkInterfaceId() {
    return getId().toString();
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:10,代码来源:DataLinkInterface.java

示例9: getNodeId

import javax.xml.bind.annotation.XmlID; //导入依赖的package包/类
/**
 * <p>getNodeId</p>
 *
 * @return a {@link java.lang.String} object.
 */
@XmlID
@XmlAttribute(name="id", required=true)
@Transient
public String getNodeId() {
	if (getId() != null) {
		return getId().toString();
	}
	return null;
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:15,代码来源:OnmsNode.java

示例10: calcId

import javax.xml.bind.annotation.XmlID; //导入依赖的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

示例11: generateAdapterIfNecessary

import javax.xml.bind.annotation.XmlID; //导入依赖的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

示例12: getXmlID

import javax.xml.bind.annotation.XmlID; //导入依赖的package包/类
@XmlID
public String getXmlID() {
	if (xmlID == null) {
		xmlID = Integer.toString(personId);
	}
	return xmlID;
}
 
开发者ID:CodeSphere,项目名称:termitaria,代码行数:8,代码来源:Person.java

示例13: getXmlID

import javax.xml.bind.annotation.XmlID; //导入依赖的package包/类
@XmlID
public String getXmlID() {
	if (xmlID == null) {
		xmlID = Integer.toString(organisationId);
	}
	return xmlID;
}
 
开发者ID:CodeSphere,项目名称:termitaria,代码行数:8,代码来源:Organisation.java

示例14: getXmlID

import javax.xml.bind.annotation.XmlID; //导入依赖的package包/类
@XmlID
public String getXmlID() {
	if (xmlID == null) {
		xmlID = this.getClass().getName().concat(Integer.toString(departmentId));
	}
	return xmlID;
}
 
开发者ID:CodeSphere,项目名称:termitaria,代码行数:8,代码来源:Department.java

示例15: getId

import javax.xml.bind.annotation.XmlID; //导入依赖的package包/类
/**
 * Generates an unique id which is used to reference to this computer part.
 * 
 * @return An unique id which is used to reference to this computer part.
 */
@XmlID
@XmlAttribute
public String getId() {

    return host.getId() + "-" + host.getParts().indexOf(this);
}
 
开发者ID:QuarterCode,项目名称:Disconnected,代码行数:12,代码来源:HostedComputerPart.java


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