public V get(B bean) throws AccessorException { V v = core.get(bean); if(v==null) { // creates a new object P pack = lister.startPacking(bean,core); lister.endPacking(pack,bean,core); v = core.get(bean); } return v; }
/** * Access a field of the class. * * @param bean the class to be processed. * @param field the field within the class to be accessed. * @param readOnly the isStatic value of the field's modifier. * @return Accessor the accessor for this field */ public Accessor createFieldAccessor(Class bean, Field field, boolean readOnly) { return readOnly ? new Accessor.ReadOnlyFieldReflection(field) : new Accessor.FieldReflection(field); }
public ListIterator<String> iterator(PropT prop, XMLSerializer context) { final ListIterator i = core.iterator(prop,context); return new IDREFSIterator(i, context); }
public ListIterator<OnWireItemT> iterator(PropT prop, XMLSerializer context) { return new ListIteratorImpl( core.iterator(prop,context), context ); }
/** * Sets the value without adapting the value. * <p> * This ugly entry point is only used by JAX-WS. * See {@link JAXBRIContext#getElementPropertyAccessor} */ public void setUnadapted(BeanT bean, Object value) throws AccessorException { set(bean, (ValueT) value); }
/** * Sets the value without adapting the value. * <p> * This ugly entry point is only used by JAX-WS. * See {@link JAXBRIContext#getElementPropertyAccessor} */ public Object getUnadapted(BeanT bean) throws AccessorException { return get(bean); }
public NullSafeAccessor(Accessor<B,V> core, Lister<B,V,?,P> lister) { super(core.getValueType()); this.core = core; this.lister = lister; }
/** * Wraps this {@link Accessor} into another {@link Accessor} * and performs the type adaption as necessary. */ public final <T> Accessor<BeanT, T> adapt(Class<T> targetType, final Class<? extends XmlAdapter<T, ValueT>> adapter) { return new AdaptedAccessor<BeanT, ValueT, T>(targetType, this, adapter); }
/** * Access a field of the class. * * @param bean the class to be processed. * @param field the field within the class to be accessed. * @param readOnly the isStatic value of the field's modifier. * @param supressWarning supress security warning about accessing fields through reflection * @return Accessor the accessor for this field */ public Accessor createFieldAccessor(Class bean, Field field, boolean readOnly, boolean supressWarning) { return readOnly ? new Accessor.ReadOnlyFieldReflection(field, supressWarning) : new Accessor.FieldReflection(field, supressWarning); }
public void set(B bean, V value) throws AccessorException { core.set(bean,value); } }