public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) { converter.marshal(source, writer, context); }
public void registerConverter(SingleValueConverter converter, int priority) { if (converterRegistry != null) { converterRegistry.registerConverter( new SingleValueConverterWrapper(converter), priority); } }
/** * Write the bare item of the collection into the writer. * * @param item the item to write * @param context the current marshalling context * @param writer the target writer * @since 1.4.11 */ protected void writeBareItem(final Object item, final MarshallingContext context, final HierarchicalStreamWriter writer) { context.convertAnother(item); }
protected Object unmarshalField(final UnmarshallingContext context, final Object result, Class type, Field field) { Converter converter = mapper.getLocalConverter(field.getDeclaringClass(), field.getName()); return context.convertAnother(result, type, converter); }
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { return findConverter(context.getRequiredType()).unmarshal(reader,context); } }
@Override public Object fromString(String str) { URL url = (URL) super.fromString(str); try { return URLDeserializationHelper.wrapIfRequired(url); } catch (IOException e) { throw new ConversionException(e); } } }
@Override public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { throw new ConversionException("Refusing to unmarshal " + reader.getNodeName() + " for security reasons; see https://jenkins.io/redirect/class-filter/"); }
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { Object obj = converter.unmarshal(reader, context); callback((T)obj, context); return obj; }
private SingleValueConverter getLocalConverterFromItemType(Class type) { Converter converter = converterLookup.lookupConverterForType(type); if (converter != null && converter instanceof SingleValueConverter) { return (SingleValueConverter)converter; } else { return null; } }
public void registerValidation(final ObjectInputValidation validation, int priority) { context.addCompletionCallback(new Runnable() { public void run() { try { validation.validateObject(); } catch (InvalidObjectException e) { throw new ObjectAccessException("Cannot validate object", e); } } }, priority); }
public void appendErrors(ErrorWriter errorWriter) { StringBuilder buf = new StringBuilder(); Pointer parent = null; for (Pointer cur : pointers) { if (parent!=null) { buf.append('/').append(parent.xpath()); } else { buf.append(cur.node.tagName); } parent = cur; } errorWriter.add("xpath", buf.toString()); }
public void registerConverter(Converter converter, int priority) { if (converterRegistry != null) { converterRegistry.registerConverter(converter, priority); } }
/** * Constructs a ErrorWritingException. * * @param message the error message * @since 1.4.9 */ public ErrorWritingException(String message) { super(message); addData(message, null); }
protected void marshallField(final MarshallingContext context, Object newObj, Field field) { Converter converter = mapper.getLocalConverter(field.getDeclaringClass(), field.getName()); context.convertAnother(newObj, converter); }
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { if (context.get(IN_NESTED)==null) { context.put(IN_NESTED,true); try { return super.unmarshal(reader,context); } finally { context.put(IN_NESTED,false); } } else return leafLabelConverter.unmarshal(reader,context); }
public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) { if (context.get(IN_NESTED)==null) { context.put(IN_NESTED,true); try { super.marshal(source,writer,context); } finally { context.put(IN_NESTED,false); } } else leafLabelConverter.marshal(source,writer,context); }
/** * Constructs a ErrorWritingException. * * @param cause the causing exception * @since 1.4.9 */ public ErrorWritingException(Throwable cause) { super(cause); addData(null, cause); }
/** * Constructs a ErrorWritingException. * * @param message the error message * @param cause the causing exception * @since 1.4.9 */ public ErrorWritingException(String message, Throwable cause) { super(message, cause); addData(message, cause); }