|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gdata.wireformats.AltFormat.Builder
public static class AltFormat.Builder
A builder for AltFormat. Create new builders using AltFormat.builder()
or AltFormat.builder(AltFormat)
.
Method Summary | |
---|---|
AltFormat.Builder |
addAllowedInputFormats(AltFormat... formats)
Declares formats as being acceptable input formats when the current AltFormat is selected as output. |
AltFormat |
build()
Builds the AltFormat . |
AltFormat.Builder |
setAcceptableTextTypes()
Declares text/plain to be an acceptable match for the purpose of content negotiation. |
AltFormat.Builder |
setAcceptableTypes(ContentType... types)
Declares MIME types to be acceptable matches for the purpose of content negotiation. |
AltFormat.Builder |
setAcceptableXmlTypes()
Declares text/xml and text/plain to be acceptable matches for the purpose of content negotiation. |
AltFormat.Builder |
setBaseFormat(AltFormat base)
Declares another AltFormat as the base for this one. |
AltFormat.Builder |
setContentType(ContentType contentType)
Sets the primary MIME content type used for the representation. |
AltFormat.Builder |
setName(java.lang.String name)
Sets the short name for this format. |
AltFormat.Builder |
setSelectableByType(boolean isSelectableByType)
Indicates whether the MIME content type can be used as an alias to select the representation. |
AltFormat.Builder |
setWireFormat(WireFormat wireFormat)
Sets the content wire format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public AltFormat.Builder setName(java.lang.String name)
alt
query parameter. This is
required.
public AltFormat.Builder setWireFormat(WireFormat wireFormat)
public AltFormat.Builder setContentType(ContentType contentType)
public AltFormat.Builder setSelectableByType(boolean isSelectableByType)
public AltFormat.Builder setBaseFormat(AltFormat base)
AltFormat
as the base for this one.
This is set for *-in-script variants and to allows access to the original format.
public AltFormat.Builder setAcceptableTextTypes()
public AltFormat.Builder setAcceptableXmlTypes()
public AltFormat.Builder setAcceptableTypes(ContentType... types)
setContentType(com.google.gdata.util.ContentType)
is acceptable.
public AltFormat.Builder addAllowedInputFormats(AltFormat... formats)
When posting or putting data, the request content type is expected to be the same as the response content type selected with the alt query parameter. This is enforced in the server.
For example, this is acceptable:
POST http://gdata.example.com/feeds/myfeed?alt=jsonc ContentType: application/jsonand this is not:
POST http://gdata.example.com/feeds/myfeed?alt=jsonc ContentType: application/atom+xml
Some cases violate this rule. For example, when posting a media file, the request content type is the type of the media while the response content type is either atom or json.
Such special cases should be declared using this method.
public AltFormat build()
AltFormat
. This can be called only once.
java.lang.IllegalStateException
- unless both name and content type are set
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |