@Override
public Accessor getElementPropertyAccessor(String nsUri, String localName) {
JaxBeanInfo bi = expectedElements.get(nsUri, localName);
if(bi!=null) {
if(bi instanceof ElementBeanInfoImpl) {
final ElementBeanInfoImpl ebi = (ElementBeanInfoImpl) bi;
// a JAXBElement. We need to handle JAXBElement for JAX-WS
return new Accessor<BeanT,Object>(ebi.expectedType) {
public Object get(BeanT bean) throws AccessorException {
ValueT r = acc.get(bean);
if(r instanceof JAXBElement) {
return ((JAXBElement)r).getValue();
} else
// this is sloppy programming, but hey...
return r;
}
public void set(BeanT bean, Object value) throws AccessorException {
if(value!=null) {
try {
value = ebi.createInstanceFromValue(value);
} catch (IllegalAccessException e) {
throw new AccessorException(e);
} catch (InvocationTargetException e) {
throw new AccessorException(e);
} catch (InstantiationException e) {