public class HttpAttribute
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
HttpAttribute.FieldSegment
A path segment representing a field reference.
|
static class |
HttpAttribute.LiteralSegment
A path segment representing a literal.
|
static class |
HttpAttribute.PathSegment
Base class for path segments.
|
static class |
HttpAttribute.WildcardSegment
A path segment representing a wildcard, which is bounded (matches 1 segment) or unbounded
(matches 1 or more segments).
|
| Modifier and Type | Field and Description |
|---|---|
static com.google.inject.Key<HttpAttribute> |
KEY
Key used to access this attribute.
|
| Constructor and Description |
|---|
HttpAttribute(com.google.api.HttpRule rule,
MethodKind methodKind,
MessageType message,
com.google.common.collect.ImmutableList<HttpAttribute.PathSegment> path,
java.lang.String body,
boolean isFromIdl,
com.google.common.collect.ImmutableList<HttpAttribute> additionalBindings,
boolean isPrimary)
Constructs an http binding for the given method kind, message, path, and body.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
bodyCapturesUnboundFields()
Returns true if the body is configured to include unbound fields.
|
com.google.common.collect.ImmutableList<HttpAttribute> |
getAdditionalBindings() |
java.lang.Iterable<HttpAttribute> |
getAllBindings()
Returns an
Iterable that includes the primary binding (the current one) and all
additional bindings. |
java.lang.String |
getAnySpecifiedFieldInHttpRule()
Returns the name of the any field specified in the underlying http rule.
|
java.lang.String |
getBody()
Gets the body or null if none specified.
|
com.google.common.collect.ImmutableList<FieldSelector> |
getBodySelectors()
Get fields which are bound via the body.
|
com.google.common.collect.ImmutableList<HttpAttribute.PathSegment> |
getFlatPath()
Gets the flattened path, where all FieldSegments have been replaced by their sub-paths.
|
com.google.api.HttpRule |
getHttpRule()
Gets the underlying http rule.
|
MessageType |
getMessage()
Gets the request message this configuration is associated with.
|
MethodKind |
getMethodKind()
Gets the http method kind.
|
com.google.common.collect.ImmutableList<FieldSelector> |
getParamSelectors()
Gets fields which are bound via parameters.
|
com.google.common.collect.ImmutableList<HttpAttribute.PathSegment> |
getPath()
Gets the path as a list of segments.
|
com.google.common.collect.ImmutableList<FieldSelector> |
getPathSelectors()
Gets the fields which are bound via the path.
|
RestMethod |
getRestMethod()
Returns the associated rest method.
|
com.google.common.collect.ImmutableList<FieldSelector> |
getVisibleBodySelectors()
Gets visible fields which are bound via body.
|
com.google.common.collect.ImmutableList<FieldSelector> |
getVisibleParamSelectors()
Gets visible fields which are bound via parameters.
|
com.google.common.collect.ImmutableList<FieldSelector> |
getVisiblePathSelectors()
Gets visible fields which are bound via the path.
|
boolean |
isFromIdl()
Return true if the http binding information is from IDL.
|
boolean |
isPrimary()
Returns true if this is the primary binding.
|
static HttpAttribute |
noConfig(MessageType message)
Creates an empty binding for a method which is not exposed via http.
|
HttpAttribute |
reroot(java.lang.String newRoot)
Create a new HTTP binding where the HTTP paths are rooted underneath the provided path.
|
void |
setFields(com.google.common.collect.ImmutableList<FieldSelector> paramFields,
com.google.common.collect.ImmutableList<FieldSelector> bodyFields)
Sets the parameter and body fields.
|
void |
setRestMethod(RestMethod method)
Sets the rest method.
|
public static final com.google.inject.Key<HttpAttribute> KEY
public HttpAttribute(com.google.api.HttpRule rule,
MethodKind methodKind,
MessageType message,
com.google.common.collect.ImmutableList<HttpAttribute.PathSegment> path,
java.lang.String body,
boolean isFromIdl,
com.google.common.collect.ImmutableList<HttpAttribute> additionalBindings,
boolean isPrimary)
public static HttpAttribute noConfig(MessageType message)
public java.lang.String getAnySpecifiedFieldInHttpRule()
public boolean isPrimary()
public RestMethod getRestMethod()
public void setRestMethod(RestMethod method)
public HttpAttribute reroot(java.lang.String newRoot)
public java.lang.Iterable<HttpAttribute> getAllBindings()
Iterable that includes the primary binding (the current one) and all
additional bindings. The primary binding is always the first item in the Iterable.public com.google.api.HttpRule getHttpRule()
public MethodKind getMethodKind()
public MessageType getMessage()
public com.google.common.collect.ImmutableList<HttpAttribute.PathSegment> getPath()
public com.google.common.collect.ImmutableList<HttpAttribute.PathSegment> getFlatPath()
public java.lang.String getBody()
public boolean isFromIdl()
public boolean bodyCapturesUnboundFields()
public com.google.common.collect.ImmutableList<FieldSelector> getPathSelectors()
public com.google.common.collect.ImmutableList<FieldSelector> getParamSelectors()
public com.google.common.collect.ImmutableList<FieldSelector> getBodySelectors()
public void setFields(com.google.common.collect.ImmutableList<FieldSelector> paramFields, com.google.common.collect.ImmutableList<FieldSelector> bodyFields)
public com.google.common.collect.ImmutableList<FieldSelector> getVisiblePathSelectors()
public com.google.common.collect.ImmutableList<FieldSelector> getVisibleParamSelectors()
public com.google.common.collect.ImmutableList<FieldSelector> getVisibleBodySelectors()
public com.google.common.collect.ImmutableList<HttpAttribute> getAdditionalBindings()