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


Java XmlElement類代碼示例

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


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

示例1: getStoreValue

import javax.xml.bind.annotation.XmlElement; //導入依賴的package包/類
/**
 * Converts the object to its string representation.
 *
 * @return String representation of the object.
 */
@XmlElement(name = "Value")
public String getStoreValue() {
    byte[] value = this.getRawValue();
    if (value != null) {
        StringBuilder sb = new StringBuilder();
        int i = 0;
        sb.append("0x");
        for (byte b : value) {
            sb.append(String.format("%02x", b));
        }
        return sb.toString();
    }
    else {
        return null;
    }
}
 
開發者ID:Microsoft,項目名稱:elastic-db-tools-for-java,代碼行數:22,代碼來源:ShardKey.java

示例2: dealXmlElementAnnotation

import javax.xml.bind.annotation.XmlElement; //導入依賴的package包/類
/**
 * 處理@{@link XmlElement}注解
 */
@SuppressWarnings("unchecked")
protected void dealXmlElementAnnotation(Element rootElement, Field field, Object entity) {
  XmlElement xmlElementAnnotation = field.getAnnotation(XmlElement.class);
  Element element = rootElement.element(xmlElementAnnotation.name());
  if (Objects.nonNull(element)) {
    Optional<Object> valueOptional = super
        .elementValue(rootElement, field.getType(), xmlElementAnnotation.name());
    valueOptional.ifPresent(value -> {
      try {
        field.set(entity, value);
      } catch (IllegalAccessException e) {
        e.printStackTrace();
      }
    });
  }
}
 
開發者ID:minlia-projects,項目名稱:minlia-iot,代碼行數:20,代碼來源:XmlApiDeserializer.java

示例3: getStatus

import javax.xml.bind.annotation.XmlElement; //導入依賴的package包/類
@XmlElement(name = "status")
@Schema(
    name = "status",
    title = "pet status in the store"//,
    //_enum = {"available", "pending", "sold"}
)
public String getStatus() {
    return status;
}
 
開發者ID:eclipse,項目名稱:microprofile-open-api,代碼行數:10,代碼來源:Pet.java

示例4: getSqueezedName

import javax.xml.bind.annotation.XmlElement; //導入依賴的package包/類
/**
 * Returns the "squeezed name" of this element.
 *
 * @see CClassInfo#getSqueezedName()
 */
@XmlElement
public String getSqueezedName() {
    if(squeezedName!=null)  return squeezedName;

    StringBuilder b = new StringBuilder();
    CClassInfo s = getScope();
    if(s!=null)
        b.append(s.getSqueezedName());
    if(className!=null)
        b.append(className);
    else
        b.append( model.getNameConverter().toClassName(tagName.getLocalPart()));
    return b.toString();
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:20,代碼來源:CElementInfo.java

示例5: getSpecialties

import javax.xml.bind.annotation.XmlElement; //導入依賴的package包/類
@XmlElement
public List<Specialty> getSpecialties() {
    List<Specialty> sortedSpecs = new ArrayList<>(getSpecialtiesInternal());
    PropertyComparator.sort(sortedSpecs,
            new MutableSortDefinition("name", true, true));
    return Collections.unmodifiableList(sortedSpecs);
}
 
開發者ID:awslabs,項目名稱:amazon-ecs-java-microservices,代碼行數:8,代碼來源:Vet.java

示例6: getActive

import javax.xml.bind.annotation.XmlElement; //導入依賴的package包/類
@XmlElement
public int getActive() {
    return active;
}
 
開發者ID:eclipse,項目名稱:microprofile-sandbox,代碼行數:5,代碼來源:TransactionStatisticsElement.java

示例7: getVetList

import javax.xml.bind.annotation.XmlElement; //導入依賴的package包/類
@XmlElement
public List<Vet> getVetList() {
    if (vets == null) {
        vets = new ArrayList<>();
    }
    return vets;
}
 
開發者ID:awslabs,項目名稱:amazon-ecs-java-microservices,代碼行數:8,代碼來源:Vets.java

示例8: getParameterQName

import javax.xml.bind.annotation.XmlElement; //導入依賴的package包/類
private static QName getParameterQName(Method method, WebParam webParam, XmlElement xmlElem, String paramDefault) {
    String webParamName = null;
    if (webParam != null && webParam.name().length() > 0) {
        webParamName = webParam.name();
    }
    String xmlElemName = null;
    if (xmlElem != null && !xmlElem.name().equals("##default")) {
        xmlElemName = xmlElem.name();
    }
    if (xmlElemName != null && webParamName != null && !xmlElemName.equals(webParamName)) {
        throw new RuntimeModelerException("@XmlElement(name)="+xmlElemName+" and @WebParam(name)="+webParamName+" are different for method " +method);
    }
    String localPart = paramDefault;
    if (webParamName != null) {
        localPart = webParamName;
    } else if (xmlElemName != null) {
        localPart =  xmlElemName;
    }

    String webParamNS = null;
    if (webParam != null && webParam.targetNamespace().length() > 0) {
        webParamNS = webParam.targetNamespace();
    }
    String xmlElemNS = null;
    if (xmlElem != null && !xmlElem.namespace().equals("##default")) {
        xmlElemNS = xmlElem.namespace();
    }
    if (xmlElemNS != null && webParamNS != null && !xmlElemNS.equals(webParamNS)) {
        throw new RuntimeModelerException("@XmlElement(namespace)="+xmlElemNS+" and @WebParam(targetNamespace)="+webParamNS+" are different for method " +method);
    }
    String ns = "";
    if (webParamNS != null) {
        ns = webParamNS;
    } else if (xmlElemNS != null) {
        ns =  xmlElemNS;
    }

    return new QName(ns, localPart);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:40,代碼來源:RuntimeModeler.java

示例9: getReturnQName

import javax.xml.bind.annotation.XmlElement; //導入依賴的package包/類
private static QName getReturnQName(Method method, WebResult webResult, XmlElement xmlElem) {
    String webResultName = null;
    if (webResult != null && webResult.name().length() > 0) {
        webResultName = webResult.name();
    }
    String xmlElemName = null;
    if (xmlElem != null && !xmlElem.name().equals("##default")) {
        xmlElemName = xmlElem.name();
    }
    if (xmlElemName != null && webResultName != null && !xmlElemName.equals(webResultName)) {
        throw new RuntimeModelerException("@XmlElement(name)="+xmlElemName+" and @WebResult(name)="+webResultName+" are different for method " +method);
    }
    String localPart = RETURN;
    if (webResultName != null) {
        localPart = webResultName;
    } else if (xmlElemName != null) {
        localPart =  xmlElemName;
    }

    String webResultNS = null;
    if (webResult != null && webResult.targetNamespace().length() > 0) {
        webResultNS = webResult.targetNamespace();
    }
    String xmlElemNS = null;
    if (xmlElem != null && !xmlElem.namespace().equals("##default")) {
        xmlElemNS = xmlElem.namespace();
    }
    if (xmlElemNS != null && webResultNS != null && !xmlElemNS.equals(webResultNS)) {
        throw new RuntimeModelerException("@XmlElement(namespace)="+xmlElemNS+" and @WebResult(targetNamespace)="+webResultNS+" are different for method " +method);
    }
    String ns = "";
    if (webResultNS != null) {
        ns = webResultNS;
    } else if (xmlElemNS != null) {
        ns =  xmlElemNS;
    }

    return new QName(ns, localPart);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:40,代碼來源:RuntimeModeler.java

示例10: getOwner

import javax.xml.bind.annotation.XmlElement; //導入依賴的package包/類
@XmlElement(namespace = "http://www.itunes.com/dtds/podcast-1.0.dtd")
public Owner getOwner() {
    return owner;
}
 
開發者ID:openaudible,項目名稱:openaudible,代碼行數:5,代碼來源:Channel.java

示例11: getCommonPrefixes

import javax.xml.bind.annotation.XmlElement; //導入依賴的package包/類
/**
 * @return the commonPrefixes
 */
@XmlElement(name = "CommonPrefixes")
public String getCommonPrefixes() {
  return commonPrefixes;
}
 
開發者ID:adobe,項目名稱:S3Mock,代碼行數:8,代碼來源:ListBucketResult.java

示例12: getId

import javax.xml.bind.annotation.XmlElement; //導入依賴的package包/類
@XmlElement
public Integer getId() {
	return id;
}
 
開發者ID:PacktPublishing,項目名稱:Spring-5.0-Cookbook,代碼行數:5,代碼來源:Department.java

示例13: getSapId

import javax.xml.bind.annotation.XmlElement; //導入依賴的package包/類
@XmlElement(name="sapId", namespace="http://mdw.centurylink.com/serviceTypes")
public String getSapId() { return sapId; }
 
開發者ID:CenturyLinkCloud,項目名稱:mdw-demo,代碼行數:3,代碼來源:Employee.java

示例14: getAtomLink

import javax.xml.bind.annotation.XmlElement; //導入依賴的package包/類
@XmlElement(namespace = "http://www.w3.org/2005/Atom", name = "link")
public AtomLink getAtomLink() {
    return atomLink;
}
 
開發者ID:openaudible,項目名稱:openaudible,代碼行數:5,代碼來源:Channel.java

示例15: setSize2

import javax.xml.bind.annotation.XmlElement; //導入依賴的package包/類
@XmlElement
public void setSize2(double size2)
{
	this.size2 = size2;
}
 
開發者ID:fossasia,項目名稱:zooracle,代碼行數:6,代碼來源:ToadData.java


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