com.google.api.server.spi.config.ApiResourceProperty Java Examples

The following examples show how to use com.google.api.server.spi.config.ApiResourceProperty. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ConferenceQueryForm.java    From ud859 with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns an Objectify Query object for the specified filters.
 *
 * @return an Objectify Query.
 */
@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public Query<Conference> getQuery() {
    // First check the feasibility of inequality filters.
    checkFilters();
    Query<Conference> query = ofy().load().type(Conference.class);
    if (inequalityFilter == null) {
        // Order by name.
        query = query.order("name");
    } else {
        // If we have any inequality filters, order by the field first.
        query = query.order(inequalityFilter.field.getFieldName());
        query = query.order("name");
    }
    for (Filter filter : this.filters) {
        // Applies filters in order.
        if (filter.field.fieldType == FieldType.STRING) {
            query = query.filter(String.format("%s %s", filter.field.getFieldName(),
                    filter.operator.getQueryOperator()), filter.value);
        } else if (filter.field.fieldType == FieldType.INTEGER) {
            query = query.filter(String.format("%s %s", filter.field.getFieldName(),
                    filter.operator.getQueryOperator()), Integer.parseInt(filter.value));
        }
    }
    LOG.info(query.toString());
    return query;
}
 
Example #2
Source File: ApiAnnotationIntrospector.java    From endpoints-java with Apache License 2.0 5 votes vote down vote up
@Override
public PropertyName findNameForSerialization(Annotated a) {
  ApiResourceProperty apiName = a.getAnnotation(ApiResourceProperty.class);
  if (apiName != null && apiName.ignored() != AnnotationBoolean.TRUE) {
    return PropertyName.construct(apiName.name());
  }
  return null;
}
 
Example #3
Source File: ConferenceQueryForm.java    From ud859 with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns an Objectify Query object for the specified filters.
 *
 * @return an Objectify Query.
 */
@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public Query<Conference> getQuery() {
    // First check the feasibility of inequality filters.
    checkFilters();
    Query<Conference> query = ofy().load().type(Conference.class);
    if (inequalityFilter == null) {
        // Order by name.
        query = query.order("name");
    } else {
        // If we have any inequality filters, order by the field first.
        query = query.order(inequalityFilter.field.getFieldName());
        query = query.order("name");
    }
    for (Filter filter : this.filters) {
        // Applies filters in order.
        if (filter.field.fieldType == FieldType.STRING) {
            query = query.filter(String.format("%s %s", filter.field.getFieldName(),
                    filter.operator.getQueryOperator()), filter.value);
        } else if (filter.field.fieldType == FieldType.INTEGER) {
            query = query.filter(String.format("%s %s", filter.field.getFieldName(),
                    filter.operator.getQueryOperator()), Integer.parseInt(filter.value));
        }
    }
    LOG.info(query.toString());
    return query;
}
 
Example #4
Source File: ConferenceQueryForm.java    From ud859 with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns an Objectify Query object for the specified filters.
 *
 * @return an Objectify Query.
 */
@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public Query<Conference> getQuery() {
    // First check the feasibility of inequality filters.
    checkFilters();
    Query<Conference> query = ofy().load().type(Conference.class);
    if (inequalityFilter == null) {
        // Order by name.
        query = query.order("name");
    } else {
        // If we have any inequality filters, order by the field first.
        query = query.order(inequalityFilter.field.getFieldName());
        query = query.order("name");
    }
    for (Filter filter : this.filters) {
        // Applies filters in order.
        if (filter.field.fieldType == FieldType.STRING) {
            query = query.filter(String.format("%s %s", filter.field.getFieldName(),
                    filter.operator.getQueryOperator()), filter.value);
        } else if (filter.field.fieldType == FieldType.INTEGER) {
            query = query.filter(String.format("%s %s", filter.field.getFieldName(),
                    filter.operator.getQueryOperator()), Integer.parseInt(filter.value));
        }
    }
    LOG.info(query.toString());
    return query;
}
 
Example #5
Source File: ConferenceQueryForm.java    From ud859 with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns an Objectify Query object for the specified filters.
 *
 * @return an Objectify Query.
 */
@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public Query<Conference> getQuery() {
    // First check the feasibility of inequality filters.
    checkFilters();
    Query<Conference> query = ofy().load().type(Conference.class);
    if (inequalityFilter == null) {
        // Order by name.
        query = query.order("name");
    } else {
        // If we have any inequality filters, order by the field first.
        query = query.order(inequalityFilter.field.getFieldName());
        query = query.order("name");
    }
    for (Filter filter : this.filters) {
        // Applies filters in order.
        if (filter.field.fieldType == FieldType.STRING) {
            query = query.filter(String.format("%s %s", filter.field.getFieldName(),
                    filter.operator.getQueryOperator()), filter.value);
        } else if (filter.field.fieldType == FieldType.INTEGER) {
            query = query.filter(String.format("%s %s", filter.field.getFieldName(),
                    filter.operator.getQueryOperator()), Integer.parseInt(filter.value));
        }
    }
    LOG.info(query.toString());
    return query;
}
 
Example #6
Source File: Conference.java    From ud859 with GNU General Public License v3.0 4 votes vote down vote up
@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public String getOrganizerUserId() {
    return organizerUserId;
}
 
Example #7
Source File: Conference.java    From ud859 with GNU General Public License v3.0 4 votes vote down vote up
@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public Key<Profile> getProfileKey() {
    return profileKey;
}
 
Example #8
Source File: Conference.java    From ud859 with GNU General Public License v3.0 4 votes vote down vote up
@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public String getOrganizerUserId() {
    return organizerUserId;
}
 
Example #9
Source File: Conference.java    From ud859 with GNU General Public License v3.0 4 votes vote down vote up
@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public Key<Profile> getProfileKey() {
    return profileKey;
}
 
Example #10
Source File: Conference.java    From ud859 with GNU General Public License v3.0 4 votes vote down vote up
@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public String getOrganizerUserId() {
    return organizerUserId;
}
 
Example #11
Source File: Conference.java    From ud859 with GNU General Public License v3.0 4 votes vote down vote up
@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public Key<Profile> getProfileKey() {
    return profileKey;
}
 
Example #12
Source File: AnnotationApiConfigGeneratorTest.java    From endpoints-java with Apache License 2.0 4 votes vote down vote up
@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public Integer getBar() {
  return null;
}
 
Example #13
Source File: Conference.java    From ud859 with GNU General Public License v3.0 4 votes vote down vote up
@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public Key<Profile> getProfileKey() {
    return profileKey;
}
 
Example #14
Source File: Conference.java    From ud859 with GNU General Public License v3.0 4 votes vote down vote up
@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public String getOrganizerUserId() {
    return organizerUserId;
}
 
Example #15
Source File: YourFirstAPI.java    From appengine-endpoints-helloworld-java-maven with Apache License 2.0 4 votes vote down vote up
@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public String getBin() {
  return bin;
}
 
Example #16
Source File: YourFirstAPI.java    From appengine-endpoints-helloworld-java-maven with Apache License 2.0 4 votes vote down vote up
@ApiResourceProperty(name = "baz")
public String getFoobar() {
  return foobar;
}
 
Example #17
Source File: Foo.java    From appengine-tck with Apache License 2.0 4 votes vote down vote up
@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public int getY() {
    return y;
}
 
Example #18
Source File: Foo.java    From appengine-tck with Apache License 2.0 4 votes vote down vote up
@ApiResourceProperty(name = "qwerty")
public int getZ() {
    return z;
}
 
Example #19
Source File: FooDescription.java    From endpoints-java with Apache License 2.0 4 votes vote down vote up
@ApiResourceProperty(description = "description of value")
public int getValue() {
  return value;
}
 
Example #20
Source File: AnnotationApiConfigGeneratorTest.java    From endpoints-java with Apache License 2.0 4 votes vote down vote up
@ApiResourceProperty(name = "bar")
public String getFoo() {
  return null;
}
 
Example #21
Source File: AnnotationApiConfigGeneratorTest.java    From endpoints-java with Apache License 2.0 4 votes vote down vote up
@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public String getBar() {
  return null;
}
 
Example #22
Source File: AnnotationApiConfigGeneratorTest.java    From endpoints-java with Apache License 2.0 4 votes vote down vote up
@ApiResourceProperty(name = "baz")
public String getFoo() {
  return null;
}
 
Example #23
Source File: ResourceSchemaProviderTest.java    From endpoints-java with Apache License 2.0 4 votes vote down vote up
@ApiResourceProperty(description = "description of bar")
public String getBar() {
  return null;
}
 
Example #24
Source File: ResourceSchemaProviderTest.java    From endpoints-java with Apache License 2.0 4 votes vote down vote up
@ApiResourceProperty(name = "bar")
public String getFoo() {
  return null;
}
 
Example #25
Source File: ResourceSchemaProviderTest.java    From endpoints-java with Apache License 2.0 4 votes vote down vote up
@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public String getBar() {
  return null;
}
 
Example #26
Source File: ApiAnnotationIntrospectorTest.java    From endpoints-java with Apache License 2.0 4 votes vote down vote up
@Override
@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public void setFoo(String foo) {
  this.foo = foo;
}
 
Example #27
Source File: ApiAnnotationIntrospectorTest.java    From endpoints-java with Apache License 2.0 4 votes vote down vote up
@Override
@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public String getFoo() {
  return foo;
}
 
Example #28
Source File: ApiAnnotationIntrospectorTest.java    From endpoints-java with Apache License 2.0 4 votes vote down vote up
@Override
@ApiResourceProperty(name = "bar")
public void setFoo(String foo) {
  this.foo = foo;
}
 
Example #29
Source File: ApiAnnotationIntrospectorTest.java    From endpoints-java with Apache License 2.0 4 votes vote down vote up
@Override
@ApiResourceProperty(name = "bar")
public String getFoo() {
  return foo;
}
 
Example #30
Source File: ApiAnnotationIntrospector.java    From endpoints-java with Apache License 2.0 4 votes vote down vote up
private ApiResourceProperty findAnnotation(Annotated a) {
  ApiResourceProperty annotation = a.getAnnotation(ApiResourceProperty.class);
  return annotation != null && annotation.ignored() != AnnotationBoolean.TRUE ? annotation : null;
}