org.jclouds.vcloud.binders
Class BindCloneParamsToXmlPayload<O extends CloneOptions>

java.lang.Object
  extended by org.jclouds.vcloud.binders.BindCloneParamsToXmlPayload<O>
All Implemented Interfaces:
Binder, MapBinder
Direct Known Subclasses:
BindCloneVAppParamsToXmlPayload, BindCloneVAppTemplateParamsToXmlPayload

@Singleton
public abstract class BindCloneParamsToXmlPayload<O extends CloneOptions>
extends Object
implements MapBinder

Author:
Adrian Cole

Field Summary
protected  String ns
           
protected  String schema
           
 
Constructor Summary
BindCloneParamsToXmlPayload(BindToStringPayload stringBinder, String ns, String schema)
           
 
Method Summary
protected  void addElementsUnderRoot(com.jamesmurty.utils.XMLBuilder rootBuilder, String source, O options, boolean isSourceDelete)
           
<R extends HttpRequest>
R
bindToRequest(R request, Map<String,String> postParams)
          creates and binds the POST payload to the request using parameters specified.
<R extends HttpRequest>
R
bindToRequest(R request, Object input)
           
protected  com.jamesmurty.utils.XMLBuilder buildRoot(String name, O options)
           
protected  O findOptionsInArgsOrNew(GeneratedHttpRequest<?> gRequest)
           
protected  String generateXml(String name, String source, boolean isSourceDelete, O options)
           
protected abstract  Class<O> getOptionClass()
           
protected abstract  String getRootElement()
           
protected abstract  String getSourceMediaType()
           
protected  String ifNullDefaultTo(String value, String defaultValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ns

protected final String ns

schema

protected final String schema
Constructor Detail

BindCloneParamsToXmlPayload

@Inject
public BindCloneParamsToXmlPayload(BindToStringPayload stringBinder,
                                          @Named(value="jclouds.vcloud.xml.ns")
                                          String ns,
                                          @Named(value="jclouds.vcloud.xml.schema")
                                          String schema)
Method Detail

getRootElement

protected abstract String getRootElement()

getSourceMediaType

protected abstract String getSourceMediaType()

getOptionClass

protected abstract Class<O> getOptionClass()

bindToRequest

public <R extends HttpRequest> R bindToRequest(R request,
                                               Map<String,String> postParams)
Description copied from interface: MapBinder
creates and binds the POST payload to the request using parameters specified.

Specified by:
bindToRequest in interface MapBinder
See Also:
PayloadParam

generateXml

protected String generateXml(String name,
                             String source,
                             boolean isSourceDelete,
                             O options)

addElementsUnderRoot

protected void addElementsUnderRoot(com.jamesmurty.utils.XMLBuilder rootBuilder,
                                    String source,
                                    O options,
                                    boolean isSourceDelete)

buildRoot

protected com.jamesmurty.utils.XMLBuilder buildRoot(String name,
                                                    O options)

findOptionsInArgsOrNew

protected O findOptionsInArgsOrNew(GeneratedHttpRequest<?> gRequest)

bindToRequest

public <R extends HttpRequest> R bindToRequest(R request,
                                               Object input)
Specified by:
bindToRequest in interface Binder

ifNullDefaultTo

protected String ifNullDefaultTo(String value,
                                 String defaultValue)


Copyright © 2009-2011 jclouds. All Rights Reserved.