Here you can find the source of unmarshallJAXBElement(JAXBElement extends BoundType> v)
public static <BoundType> BoundType unmarshallJAXBElement(JAXBElement<? extends BoundType> v)
//package com.java2s; //License from project: Open Source License import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.adapters.XmlAdapter; public class Main { public static <ValueType, BoundType> ValueType unmarshallJAXBElement( Class<? extends XmlAdapter<BoundType, ValueType>> xmlAdapterClass, JAXBElement<? extends BoundType> v) { try {/*ww w. j a v a 2s. c o m*/ if (v == null) { return null; } else { final XmlAdapter<BoundType, ValueType> xmlAdapter = getXmlAdapter(xmlAdapterClass); return xmlAdapter.unmarshal(v.getValue()); } } catch (Exception ex) { throw new RuntimeException(ex); } } public static <BoundType> BoundType unmarshallJAXBElement(JAXBElement<? extends BoundType> v) { if (v == null) { return null; } else { return v.getValue(); } } public static <ValueType, BoundType> XmlAdapter<ValueType, BoundType> getXmlAdapter( Class<? extends XmlAdapter<ValueType, BoundType>> xmlAdapterClass) { try { final XmlAdapter<ValueType, BoundType> xmlAdapter = xmlAdapterClass.newInstance(); return xmlAdapter; } catch (IllegalAccessException iaex) { throw new RuntimeException(iaex); } catch (InstantiationException iex) { throw new RuntimeException(iex); } } }