类javax.xml.bind.annotation.XmlAnyElement源码实例Demo

下面列出了怎么用javax.xml.bind.annotation.XmlAnyElement的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: TencentKona-8   文件: ReferencePropertyInfoImpl.java
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"));
    }
}
 
源代码2 项目: jdk8u60   文件: ReferencePropertyInfoImpl.java
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"));
    }
}
 
源代码3 项目: openjdk-jdk8u   文件: ReferencePropertyInfoImpl.java
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"));
    }
}
 
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"));
    }
}
 
源代码5 项目: openjdk-jdk9   文件: ReferencePropertyInfoImpl.java
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"));
    }
}
 
源代码6 项目: hottub   文件: ReferencePropertyInfoImpl.java
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"));
    }
}
 
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"));
    }
}
 
源代码8 项目: openjdk-8   文件: ReferencePropertyInfoImpl.java
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"));
    }
}
 
源代码9 项目: sis   文件: GO_CharacterString.java
/**
 * Returns the code list wrapped in a JAXB element, or {@code null} if the {@link #text} is not a wrapper for
 * a code list. Only one of {@link #getValue()} and {@code getCodeList()} should return a non-null value.
 *
 * <div class="note"><b>Note:</b>
 * we have to rely on a somewhat complicated mechanism because the code lists implementations in GeoAPI
 * do not have JAXB annotations. If those annotations are added in a future GeoAPI implementation, then
 * we could replace this mechanism by a simple property annotated with {@code XmlElementRef}.</div>
 *
 * @since 0.7
 */
@XmlAnyElement
@Workaround(library = "GeoAPI", version = "3.0")
private Object getCodeList() {
    if (type != ENUM) {
        return null;
    }
    final CodeList<?> code = Types.forCodeTitle(text);
    final String name = Types.getListName(code);
    /*
     * The namespace has have various value like CIT, SRV, MDQ, MRI, MSR, LAN, etc.
     * The real namespace is declared in the @XmlElement annotation of the getElement
     * method in the JAXB adapter. We could use reflection, but we do not in order to
     * avoid potential class loading issue and also because not all CodeList are in the
     * same package.
     */
    String namespace = Namespaces.guessForType(name);
    if (namespace == null) {
        namespace = XMLConstants.NULL_NS_URI;
    }
    return new JAXBElement<>(new QName(namespace, name), CodeListUID.class,
            new CodeListUID(Context.current(), code));
}
 
源代码10 项目: steady   文件: SecurityTokenServiceProvider.java
private void walkDom(String pfx, Element element, Binder<Node> binder, Object parent) {
    try {
        Object o = binder.getJAXBNode(element);
        if (o instanceof JAXBElement) {
            o = ((JAXBElement<?>)o).getValue();
        }
        //System.out.println(pfx + DOMUtils.getElementQName(element) + " ->  " 
        //    + (o == null ? "null" : o.getClass()));
        if (o == null && parent != null) {
            // if it's not able to bind to an object, it's possibly an xsd:any
            // we'll check the parent for the standard "any" and replace with 
            // the original element.
            Field f = parent.getClass().getDeclaredField("any");
            if (f.getAnnotation(XmlAnyElement.class) != null) {
                Object old = ReflectionUtil.setAccessible(f).get(parent);
                if (old instanceof Element
                    && DOMUtils.getElementQName(element).equals(DOMUtils.getElementQName((Element)old))) {
                    ReflectionUtil.setAccessible(f).set(parent, element);
                }
            }
        }
        if (o == null) {
            return;
        }
        Node nd = element.getFirstChild();
        while (nd != null) {
            if (nd instanceof Element) {
                walkDom(pfx + "  ", (Element)nd, binder, o);
            }
            nd = nd.getNextSibling();
        }
    } catch (Throwable t) {
        //ignore -this is a complete hack anyway
    }
}
 
源代码11 项目: steady   文件: SecurityTokenServiceProvider.java
private void walkDom(String pfx, Element element, Binder<Node> binder, Object parent) {
    try {
        Object o = binder.getJAXBNode(element);
        if (o instanceof JAXBElement) {
            o = ((JAXBElement<?>)o).getValue();
        }
        //System.out.println(pfx + DOMUtils.getElementQName(element) + " ->  " 
        //    + (o == null ? "null" : o.getClass()));
        if (o == null && parent != null) {
            // if it's not able to bind to an object, it's possibly an xsd:any
            // we'll check the parent for the standard "any" and replace with 
            // the original element.
            Field f = parent.getClass().getDeclaredField("any");
            if (f.getAnnotation(XmlAnyElement.class) != null) {
                Object old = ReflectionUtil.setAccessible(f).get(parent);
                if (old instanceof Element
                    && DOMUtils.getElementQName(element).equals(DOMUtils.getElementQName((Element)old))) {
                    ReflectionUtil.setAccessible(f).set(parent, element);
                }
            }
        }
        if (o == null) {
            return;
        }
        Node nd = element.getFirstChild();
        while (nd != null) {
            if (nd instanceof Element) {
                walkDom(pfx + "  ", (Element)nd, binder, o);
            }
            nd = nd.getNextSibling();
        }
    } catch (Throwable t) {
        //ignore -this is a complete hack anyway
    }
}
 
源代码12 项目: steady   文件: SecurityTokenServiceProvider.java
private void walkDom(String pfx, Element element, Binder<Node> binder, Object parent) {
    try {
        Object o = binder.getJAXBNode(element);
        if (o instanceof JAXBElement) {
            o = ((JAXBElement<?>)o).getValue();
        }
        //System.out.println(pfx + DOMUtils.getElementQName(element) + " ->  " 
        //    + (o == null ? "null" : o.getClass()));
        if (o == null && parent != null) {
            // if it's not able to bind to an object, it's possibly an xsd:any
            // we'll check the parent for the standard "any" and replace with 
            // the original element.
            Field f = parent.getClass().getDeclaredField("any");
            if (f.getAnnotation(XmlAnyElement.class) != null) {
                Object old = ReflectionUtil.setAccessible(f).get(parent);
                if (old instanceof Element
                    && DOMUtils.getElementQName(element).equals(DOMUtils.getElementQName((Element)old))) {
                    ReflectionUtil.setAccessible(f).set(parent, element);
                }
            }
        }
        if (o == null) {
            return;
        }
        Node nd = element.getFirstChild();
        while (nd != null) {
            if (nd instanceof Element) {
                walkDom(pfx + "  ", (Element)nd, binder, o);
            }
            nd = nd.getNextSibling();
        }
    } catch (Throwable t) {
        //ignore -this is a complete hack anyway
    }
}
 
源代码13 项目: steady   文件: SecurityTokenServiceProvider.java
private void walkDom(String pfx, Element element, Binder<Node> binder, Object parent) {
    try {
        Object o = binder.getJAXBNode(element);
        if (o instanceof JAXBElement) {
            o = ((JAXBElement<?>)o).getValue();
        }
        //System.out.println(pfx + DOMUtils.getElementQName(element) + " ->  " 
        //    + (o == null ? "null" : o.getClass()));
        if (o == null && parent != null) {
            // if it's not able to bind to an object, it's possibly an xsd:any
            // we'll check the parent for the standard "any" and replace with 
            // the original element.
            Field f = parent.getClass().getDeclaredField("any");
            if (f.getAnnotation(XmlAnyElement.class) != null) {
                Object old = ReflectionUtil.setAccessible(f).get(parent);
                if (old instanceof Element
                    && DOMUtils.getElementQName(element).equals(DOMUtils.getElementQName((Element)old))) {
                    ReflectionUtil.setAccessible(f).set(parent, element);
                }
            }
        }
        if (o == null) {
            return;
        }
        Node nd = element.getFirstChild();
        while (nd != null) {
            if (nd instanceof Element) {
                walkDom(pfx + "  ", (Element)nd, binder, o);
            }
            nd = nd.getNextSibling();
        }
    } catch (Throwable t) {
        //ignore -this is a complete hack anyway
    }
}
 
源代码14 项目: jaxb2-basics   文件: JIIB10Test.java
public void testXmlAnyElementLax() throws Exception {

		final Field contentField = IssueJIIB10Type.class.getDeclaredField("content");
		final XmlAnyElement xmlAnyElementAnnotation = contentField
				.getAnnotation(XmlAnyElement.class);
		Assert.assertTrue(xmlAnyElementAnnotation.lax());
	}
 
源代码15 项目: rice   文件: ImmutableJaxbGenerator.java
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);
}
 
源代码16 项目: cxf   文件: SecurityTokenServiceProvider.java
private void walkDom(String pfx, Element element, Binder<Node> binder, Object parent) {
    try {
        Object o = binder.getJAXBNode(element);
        if (o instanceof JAXBElement) {
            o = ((JAXBElement<?>)o).getValue();
        }
        //System.out.println(pfx + DOMUtils.getElementQName(element) + " ->  "
        //    + (o == null ? "null" : o.getClass()));
        if (o == null && parent != null) {
            // if it's not able to bind to an object, it's possibly an xsd:any
            // we'll check the parent for the standard "any" and replace with
            // the original element.
            Field f = parent.getClass().getDeclaredField("any");
            if (f.getAnnotation(XmlAnyElement.class) != null) {
                Object old = ReflectionUtil.setAccessible(f).get(parent);
                if (old instanceof Element
                    && DOMUtils.getElementQName(element).equals(DOMUtils.getElementQName((Element)old))) {
                    ReflectionUtil.setAccessible(f).set(parent, element);
                }
            }
        }
        if (o == null) {
            return;
        }
        Node nd = element.getFirstChild();
        while (nd != null) {
            if (nd instanceof Element) {
                walkDom(pfx + "  ", (Element)nd, binder, o);
            }
            nd = nd.getNextSibling();
        }
    } catch (Throwable t) {
        //ignore -this is a complete hack anyway
    }
}
 
源代码17 项目: niftyeditor   文件: GEffectsNode.java
@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;
}
 
源代码18 项目: OpenLabeler   文件: ModelUtil.java
@XmlAnyElement
public List<JAXBElement<Integer>> getElements() {
   return list;
}
 
源代码19 项目: micro-integrator   文件: DataSourceMetaInfo.java
@XmlAnyElement
public Object getDsXMLConfiguration() {
	return dsXMLConfiguration;
}
 
@XmlAnyElement(value = FormatHandler.class,
               lax = true)
public void setPayload(String payload) {
    this.payload = payload;
}
 
源代码21 项目: jstarcraft-core   文件: XmlUtility.java
@XmlAnyElement(lax = true)
public List<T> getInstances() {
    return instances;
}
 
源代码22 项目: sailfish-core   文件: DisabledServiceSettings.java
@XmlAnyElement
public List<Element> getEntries() {
    return entries;
}
 
源代码23 项目: trellis   文件: DavProp.java
/**
 * Get the the prop element from a propstat response.
 * @return the property element
 */
@XmlAnyElement
public List<Element> getNodes() {
    return nodes;
}
 
源代码24 项目: documentum-rest-client-java   文件: JaxbProperty.java
@XmlElementWrapper(name="value-assist")
@XmlAnyElement
public List<Element> getValueAssistElement() {
    return valueAssistElement;
}
 
源代码25 项目: documentum-rest-client-java   文件: JaxbObject.java
@XmlAnyElement
public List<Element> getElements() {
    return elements;
}
 
@XmlAnyElement
public List<Element> getElements() {
    return elements;
}
 
源代码27 项目: documentum-rest-client-java   文件: JaxbEntry.java
@XmlAnyElement
public Element getElement() {
    return element;
}
 
@XmlElementWrapper(name="value-assist")
@XmlAnyElement
public List<Element> getValueAssistElement() {
    return valueAssistElement;
}
 
@XmlAnyElement
public Element getAttributeRulesElement() {
    return attributeRulesElement;
}
 
@XmlAnyElement
public List<Element> getElements() {
    return elements;
}
 
 类方法
 同包方法