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


Java XmlAnyElement類代碼示例

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


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

示例1: ReferencePropertyInfoImpl

import javax.xml.bind.annotation.XmlAnyElement; //導入依賴的package包/類
public ReferencePropertyInfoImpl(
    ClassInfoImpl<T,C,F,M> classInfo,
    PropertySeed<T,C,F,M> seed) {

    super(classInfo, seed);

    isMixed = seed.readAnnotation(XmlMixed.class) != null;

    XmlAnyElement xae = seed.readAnnotation(XmlAnyElement.class);
    if(xae==null) {
        wildcard = null;
        domHandler = null;
    } else {
        wildcard = xae.lax()?WildcardMode.LAX:WildcardMode.SKIP;
        domHandler = nav().asDecl(reader().getClassValue(xae,"value"));
    }
}
 
開發者ID:campolake,項目名稱:openjdk9,代碼行數:18,代碼來源:ReferencePropertyInfoImpl.java

示例2: setValueFromAnnotationSub

import javax.xml.bind.annotation.XmlAnyElement; //導入依賴的package包/類
@Test
public void setValueFromAnnotationSub() {
   SubSub4EyesController co = new SubSub4EyesController();
   AnnotationUtil.setValueToAnnotatedFieldOrSetter(co, XmlValue.class, 5);
   Assert.assertTrue(co.getDummy1() == 5);

   AnnotationUtil.setValueToAnnotatedFieldOrSetter(co, XmlElement.class, 33);
   Assert.assertTrue(co.getDummy1() == 33);

   try {
      AnnotationUtil.setValueToAnnotatedFieldOrSetter(co, XmlValue.class, null);
      Assert.fail();
   } catch (IllegalArgumentException e) {
      // okay
   }

   AnnotationUtil.setValueToAnnotatedFieldOrSetter(co, XmlTransient.class, true);
   Assert.assertTrue(co.isDummy2() == true);
   AnnotationUtil.setValueToAnnotatedFieldOrSetter(co, XmlTransient.class, false);
   Assert.assertTrue(co.isDummy2() == false);

   AnnotationUtil.setValueToAnnotatedFieldOrSetter(co, XmlAnyElement.class, 55);
   Assert.assertTrue(co.getDummy1() == 55);
}
 
開發者ID:Wolfgang-Winter,項目名稱:cibet,代碼行數:25,代碼來源:AnnotationUtilTest.java

示例3: getAnyField

import javax.xml.bind.annotation.XmlAnyElement; //導入依賴的package包/類
private static <T> Field getAnyField(Class<T> clazz) {
	for (Field field: clazz.getDeclaredFields()) {
		XmlAnyElement xmlAnyElementAnnotation = field.getAnnotation(XmlAnyElement.class);
		if (xmlAnyElementAnnotation != null) {
			return field;
		}
	}
	return null;
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:10,代碼來源:PrismForJAXBUtil.java

示例4: lookForXsdAnyElementMethod

import javax.xml.bind.annotation.XmlAnyElement; //導入依賴的package包/類
private static Method lookForXsdAnyElementMethod(Object jaxbObject) {
	Class<? extends Object> jaxbClass = jaxbObject.getClass();
	for (Method method: jaxbClass.getMethods()) {
		for (Annotation annotation: method.getAnnotations()) {
			if (annotation.annotationType().isAssignableFrom(XmlAnyElement.class)) {
				return method;
			}
		}
	}
	return null;
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:12,代碼來源:JAXBUtil.java

示例5: setItem

import javax.xml.bind.annotation.XmlAnyElement; //導入依賴的package包/類
@XmlElementRefs({
        @XmlElementRef(name = "OffeneLeistung", type = VertecOffeneLeistung.class),
        @XmlElementRef(name = "VerrechneteLeistung", type = VertecVerrechneteLeistung.class),
        @XmlElementRef(name = "ProjektBearbeiter", type = VertecProjektBearbeiter.class),
        @XmlElementRef(name = "Projekt", type = VertecProject.class),
        @XmlElementRef(name = "ProjektPhase", type = VertecPhase.class)})
@XmlAnyElement
public void setItem(T item)
{
    this.item = item;
}
 
開發者ID:garaio,項目名稱:jira2vertec-Gateway,代碼行數:12,代碼來源:VertecSoapCreate.java

示例6: renderFutureElementsField

import javax.xml.bind.annotation.XmlAnyElement; //導入依賴的package包/類
private void renderFutureElementsField(JDefinedClass classModel) throws Exception {
	JType collectionType = codeModel.parseType("java.util.Collection<org.w3c.dom.Element>");
	JFieldVar field = classModel.field(JMod.PRIVATE | JMod.FINAL, collectionType, "_futureElements");
	field.init(JExpr._null());
	JAnnotationUse annotation = field.annotate(SuppressWarnings.class);
	annotation.param("value", "unused");
	field.annotate(XmlAnyElement.class);
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:9,代碼來源:ImmutableJaxbGenerator.java

示例7: getParameters

import javax.xml.bind.annotation.XmlAnyElement; //導入依賴的package包/類
@Override
@XmlElementWrapper(name = "parameters")
@XmlAnyElement(lax = true)
public List<Parameter> getParameters() {
	if (getService() != null) {
		for (Parameter parameter : this.parameters) {
			((ParameterImpl) parameter).setService(getService());
		}
	}
	return parameters;
}
 
開發者ID:Mobility-Services-Lab,項目名稱:AutomotiveServiceBus,代碼行數:12,代碼來源:SetParameterImpl.java

示例8: testXmlAnyElementLax

import javax.xml.bind.annotation.XmlAnyElement; //導入依賴的package包/類
public void testXmlAnyElementLax() throws Exception {

		final Field contentField = IssueJIIB10Type.class.getDeclaredField("content");
		final XmlAnyElement xmlAnyElementAnnotation = contentField
				.getAnnotation(XmlAnyElement.class);
		Assert.assertTrue(xmlAnyElementAnnotation.lax());
	}
 
開發者ID:highsource,項目名稱:jaxb2-basics,代碼行數:8,代碼來源:JIIB10Test.java

示例9: getList

import javax.xml.bind.annotation.XmlAnyElement; //導入依賴的package包/類
@XmlAnyElement(lax = true)
public List<T> getList() {
    if (list == null) {
        list = new ArrayList<T>();
    }
    return this.list;
}
 
開發者ID:emcvipr,項目名稱:controller-client-java,代碼行數:8,代碼來源:ApiList.java

示例10: getEffectsXml

import javax.xml.bind.annotation.XmlAnyElement; //導入依賴的package包/類
@XmlAnyElement
public List<JAXBElement<GEffect>> getEffectsXml(){
    List<JAXBElement<GEffect>> res = new LinkedList<JAXBElement<GEffect>>();
    for(GEffect effect : effects){
        res.add(new JAXBElement<GEffect>(new QName(effect.getEventType().toString()),GEffect.class, effect));
    }
    return res;
}
 
開發者ID:relu91,項目名稱:niftyeditor,代碼行數:9,代碼來源:GEffectsNode.java

示例11: getMonths

import javax.xml.bind.annotation.XmlAnyElement; //導入依賴的package包/類
@XmlAnyElement
    public List<JAXBElement<String>> getMonths() {
    List<JAXBElement<String>> elements = new ArrayList<JAXBElement<String>>();
    for (Map.Entry<String, String> month: data.entrySet())
        elements.add(new JAXBElement(new QName(month.getKey()),
                                     String.class, month.getValue()));
    return elements;
}
 
開發者ID:madytyoo,項目名稱:dhtmlx-isis-viewer,代碼行數:9,代碼來源:DataViewItem.java

示例12: getFamily

import javax.xml.bind.annotation.XmlAnyElement; //導入依賴的package包/類
/**
 * <!-- begin-user-doc -->
 * XX 10
 * <!-- end-user-doc -->
 * @generated
 */	 
@XmlAnyElement(lax=true)

public Family getFamily() {
	if (eContainerFeatureID() != ExamplePackage.DAUGHTER__FAMILY) return null;
	return (Family)eInternalContainer();
}
 
開發者ID:SOM-Research,項目名稱:emf-rest,代碼行數:13,代碼來源:DaughterImpl.java

示例13: getFamily

import javax.xml.bind.annotation.XmlAnyElement; //導入依賴的package包/類
/**
 * <!-- begin-user-doc -->
 * XX 10
 * <!-- end-user-doc -->
 * @generated
 */	 
@XmlAnyElement(lax=true)

public Family getFamily() {
	if (eContainerFeatureID() != ExamplePackage.PARENT__FAMILY) return null;
	return (Family)eInternalContainer();
}
 
開發者ID:SOM-Research,項目名稱:emf-rest,代碼行數:13,代碼來源:ParentImpl.java

示例14: getFamily

import javax.xml.bind.annotation.XmlAnyElement; //導入依賴的package包/類
/**
 * <!-- begin-user-doc -->
 * XX 10
 * <!-- end-user-doc -->
 * @generated
 */	 
@XmlAnyElement(lax=true)

public Family getFamily() {
	if (eContainerFeatureID() != ExamplePackage.SON__FAMILY) return null;
	return (Family)eInternalContainer();
}
 
開發者ID:SOM-Research,項目名稱:emf-rest,代碼行數:13,代碼來源:SonImpl.java

示例15: getParents

import javax.xml.bind.annotation.XmlAnyElement; //導入依賴的package包/類
/**
 * <!-- begin-user-doc -->
 * XX 10
 * <!-- end-user-doc -->
 * @generated
 */ 
@XmlElementWrapper(name =  "parents")	 
@XmlAnyElement(lax=true)

public EList<Parent> getParents() {
	if (parents == null) {
		parents = new EObjectContainmentWithInverseEList<Parent>(Parent.class, this, ExamplePackage.FAMILY__PARENTS, ExamplePackage.PARENT__FAMILY);
	}
	return parents;
}
 
開發者ID:SOM-Research,項目名稱:emf-rest,代碼行數:16,代碼來源:FamilyImpl.java


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