@Override public SdkHttpFullRequest marshall(SdkPojo pojo) { if (rootElement != null) { marshallerContext.xmlGenerator().startElement(rootElement); } doMarshall(pojo); if (rootElement != null) { marshallerContext.xmlGenerator().endElement(); } return finishMarshalling(pojo); }
/** * Convenience method to marshall a nested object (may be simple or structured) at the given location. * * @param marshallLocation Current {@link MarshallLocation} * @param val Value to marshall. */ public void marshall(MarshallLocation marshallLocation, Object val) { marshallerRegistry.getMarshaller(marshallLocation, val).marshall(val, this, null, null); }
@Override public void marshall(T val, XmlMarshallerContext context, String paramName, SdkField<T> sdkField) { if (!shouldEmit(val, paramName)) { return; } context.xmlGenerator().startElement(paramName); marshall(val, context, paramName, sdkField, converter); context.xmlGenerator().endElement(); }
void marshall(T val, XmlMarshallerContext context, String paramName, SdkField<T> sdkField, ValueToStringConverter.ValueToString<T> converter) { context.xmlGenerator().xmlWriter().value(converter.convert(val, sdkField)); }
@Override public void marshall(SdkPojo val, XmlMarshallerContext context, String paramName, SdkField<SdkPojo> sdkField, ValueToStringConverter.ValueToString<SdkPojo> converter) { context.protocolMarshaller().doMarshall(val); } };
public <T> Builder payloadMarshaller(MarshallingType<T> marshallingType, XmlMarshaller<T> marshaller) { register(MarshallLocation.PAYLOAD, marshallingType, marshaller); return this; }
/** * @return Builder instance to construct a {@link XmlMarshallerContext}. */ public static Builder builder() { return new Builder(); }
@SuppressWarnings("unchecked") public <T> XmlMarshaller<Object> getMarshaller(MarshallLocation marshallLocation, MarshallingType<T> marshallingType, Object val) { return (XmlMarshaller<Object>) get(marshallLocation, val == null ? MarshallingType.NULL : marshallingType); }
/** * @return Builder instance to construct a {@link XmlMarshallerRegistry}. */ public static Builder builder() { return new Builder(); }
@Override public SdkHttpFullRequest marshall(SdkPojo pojo) { if (rootElement != null) { marshallerContext.xmlGenerator().startElement(rootElement); } doMarshall(pojo); if (rootElement != null) { marshallerContext.xmlGenerator().endElement(); } return finishMarshalling(pojo); }
@Override public void marshall(T val, XmlMarshallerContext context, String paramName, SdkField<T> sdkField) { if (!shouldEmit(val, paramName)) { return; } context.xmlGenerator().startElement(paramName); marshall(val, context, paramName, sdkField, converter); context.xmlGenerator().endElement(); }
/** * Convenience method to marshall a nested object (may be simple or structured) at the given location. * * @param marshallLocation Current {@link MarshallLocation} * @param val Value to marshall. * @param paramName Name of parameter to marshall. */ public <T> void marshall(MarshallLocation marshallLocation, T val, String paramName, SdkField<T> sdkField) { marshallerRegistry.getMarshaller(marshallLocation, val).marshall(val, this, paramName, sdkField); }
@Override public void marshall(SdkPojo val, XmlMarshallerContext context, String paramName, SdkField<SdkPojo> sdkField, ValueToStringConverter.ValueToString<SdkPojo> converter) { context.protocolMarshaller().doMarshall(val); } };
public <T> Builder pathParamMarshaller(MarshallingType<T> marshallingType, XmlMarshaller<T> marshaller) { register(MarshallLocation.PATH, marshallingType, marshaller); return this; }
/** * Convenience method to marshall a nested object (may be simple or structured) at the given location. * * @param marshallLocation Current {@link MarshallLocation} * @param val Value to marshall. */ public void marshall(MarshallLocation marshallLocation, Object val) { marshallerRegistry.getMarshaller(marshallLocation, val).marshall(val, this, null, null); }
public <T> Builder queryParamMarshaller(MarshallingType<T> marshallingType, XmlMarshaller<T> marshaller) { register(MarshallLocation.QUERY_PARAM, marshallingType, marshaller); return this; }
/** * Convenience method to marshall a nested object (may be simple or structured) at the given location. * * @param marshallLocation Current {@link MarshallLocation} * @param val Value to marshall. * @param paramName Name of parameter to marshall. */ public <T> void marshall(MarshallLocation marshallLocation, T val, String paramName, SdkField<T> sdkField) { marshallerRegistry.getMarshaller(marshallLocation, val).marshall(val, this, paramName, sdkField); }
public <T> Builder greedyPathParamMarshaller(MarshallingType<T> marshallingType, XmlMarshaller<T> marshaller) { register(MarshallLocation.GREEDY_PATH, marshallingType, marshaller); return this; }
public <T> Builder headerMarshaller(MarshallingType<T> marshallingType, XmlMarshaller<T> marshaller) { register(MarshallLocation.HEADER, marshallingType, marshaller); return this; }
public <T> Builder queryParamMarshaller(MarshallingType<T> marshallingType, XmlMarshaller<T> marshaller) { register(MarshallLocation.QUERY_PARAM, marshallingType, marshaller); return this; }