当前位置: 首页>>代码示例>>Java>>正文


Java AnnotationBoolean.TRUE属性代码示例

本文整理汇总了Java中com.google.api.server.spi.config.AnnotationBoolean.TRUE属性的典型用法代码示例。如果您正苦于以下问题:Java AnnotationBoolean.TRUE属性的具体用法?Java AnnotationBoolean.TRUE怎么用?Java AnnotationBoolean.TRUE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.google.api.server.spi.config.AnnotationBoolean的用法示例。


在下文中一共展示了AnnotationBoolean.TRUE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testValidateMethods_ignoredMethod

@Test
public void testValidateMethods_ignoredMethod() throws Exception {
  final class Bean {

  }
  @Api
  final class Endpoint {
    @ApiMethod(ignored = AnnotationBoolean.TRUE)
    public void thisShouldBeIgnored(Bean resource1, Bean resource2) {
    }
  }
  ApiConfig config = configLoader.loadConfiguration(ServiceContext.create(), Endpoint.class);
  // If this passes validation, then no error will be thrown. Otherwise, the validator will
  // complain that the method has two resources.
  validator.validate(config);
}
 
开发者ID:cloudendpoints,项目名称:endpoints-java,代码行数:16,代码来源:ApiConfigValidatorTest.java

示例2: testLevelOverridingWithDefaultOverrides

@Test
public void testLevelOverridingWithDefaultOverrides() throws Exception {
  @Api(
      scopes = {"s0c", "s1c"},
      audiences = {"a0c", "a1c"},
      clientIds = {"c0c", "c1c"},
      resource = "resource2",
      useDatastoreForAdditionalConfig = AnnotationBoolean.TRUE
  )
  final class Test extends SimpleLevelOverridingInheritedApi {
  }

  ApiConfig config = createConfig(Test.class);
  annotationReader.loadEndpointClass(serviceContext, Test.class, config);
  annotationReader.loadEndpointMethods(serviceContext, Test.class,
      config.getApiClassConfig().getMethods());

  // All values overridden at a lower level, so nothing should change.
  verifySimpleLevelOverriding(config);
}
 
开发者ID:cloudendpoints,项目名称:endpoints-java,代码行数:20,代码来源:ApiConfigAnnotationReaderTest.java

示例3: setIsAbstractIfSpecified

public void setIsAbstractIfSpecified(AnnotationBoolean isAbstract) {
  if (isAbstract == AnnotationBoolean.TRUE) {
    config.setIsAbstract(true);
  } else if (isAbstract == AnnotationBoolean.FALSE) {
    config.setIsAbstract(false);
  }
}
 
开发者ID:cloudendpoints,项目名称:endpoints-java,代码行数:7,代码来源:ApiAnnotationConfig.java

示例4: getKey

@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public Key<SauceEntity> getKey() {
    if(userKey == null || id == 0) {
        return null;
    }
    return Key.create(userKey, SauceEntity.class, id);
}
 
开发者ID:saucenet,项目名称:sync,代码行数:7,代码来源:SauceEntity.java

示例5: setUseDatastoreIfSpecified

public void setUseDatastoreIfSpecified(AnnotationBoolean useDatastore) {
  if (useDatastore == AnnotationBoolean.TRUE) {
    config.setUseDatastore(true);
  } else if (useDatastore == AnnotationBoolean.FALSE) {
    config.setUseDatastore(false);
  }
}
 
开发者ID:cloudendpoints,项目名称:endpoints-java,代码行数:7,代码来源:ApiAnnotationConfig.java

示例6: setAllowCookieAuthIfSpecified

public void setAllowCookieAuthIfSpecified(AnnotationBoolean allowCookieAuth) {
  if (allowCookieAuth == AnnotationBoolean.TRUE) {
    config.setAllowCookieAuth(true);
  } else if (allowCookieAuth == AnnotationBoolean.FALSE) {
    config.setAllowCookieAuth(false);
  }
}
 
开发者ID:cloudendpoints,项目名称:endpoints-java,代码行数:7,代码来源:ApiAuthAnnotationConfig.java

示例7: setApiKeyRequiredIfSpecified

public void setApiKeyRequiredIfSpecified(AnnotationBoolean apiKeyRequired) {
  if (apiKeyRequired == AnnotationBoolean.TRUE) {
    config.setApiKeyRequired(true);
  } else if (apiKeyRequired == AnnotationBoolean.FALSE) {
    config.setApiKeyRequired(false);
  }
}
 
开发者ID:cloudendpoints,项目名称:endpoints-java,代码行数:7,代码来源:ApiClassAnnotationConfig.java

示例8: setIgnoredIfSpecified

public void setIgnoredIfSpecified(AnnotationBoolean ignored) {
  if (ignored == AnnotationBoolean.TRUE) {
    config.setIgnored(true);
  } else if (ignored == AnnotationBoolean.FALSE) {
    config.setIgnored(false);
  }
}
 
开发者ID:cloudendpoints,项目名称:endpoints-java,代码行数:7,代码来源:ApiMethodAnnotationConfig.java

示例9: testAbstract

@Test
public void testAbstract() throws Exception {
  @Api(isAbstract = AnnotationBoolean.TRUE)
  class Test {}

  String apiConfigSource = g.generateConfig(Test.class).get("myapi-v1.api");
  ObjectNode root = objectMapper.readValue(apiConfigSource, ObjectNode.class);
  assertTrue(root.get("abstract").asBoolean());
}
 
开发者ID:cloudendpoints,项目名称:endpoints-java,代码行数:9,代码来源:AnnotationApiConfigGeneratorTest.java

示例10: testAbstract

@Test
public void testAbstract() throws Exception {
  @Api(isAbstract = AnnotationBoolean.TRUE)
  class Test {}

  ApiConfig config = createConfig(Test.class);
  annotationReader.loadEndpointClass(serviceContext, Test.class, config);
  assertTrue(config.getIsAbstract());
}
 
开发者ID:cloudendpoints,项目名称:endpoints-java,代码行数:9,代码来源:ApiConfigAnnotationReaderTest.java

示例11: getBar

@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public String getBar() {
  return null;
}
 
开发者ID:cloudendpoints,项目名称:endpoints-java,代码行数:4,代码来源:ResourceSchemaProviderTest.java

示例12: getUnindexedData

@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public Map<String, Object> getUnindexedData() { return unindexedData; }
 
开发者ID:saucenet,项目名称:sync,代码行数:2,代码来源:SauceEntity.java

示例13: getKey

@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public Key<SauceUser> getKey() {
    return Key.create(SauceUser.class, userId);
}
 
开发者ID:saucenet,项目名称:sync,代码行数:4,代码来源:SauceUser.java

示例14: setIndexedData

@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public void setIndexedData(Map<String, Object> indexedData) { this.indexedData = indexedData; }
 
开发者ID:saucenet,项目名称:sync,代码行数:2,代码来源:SauceEntity.java

示例15: getIndexedData

@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
public Map<String, Object> getIndexedData(){ return indexedData; }
 
开发者ID:saucenet,项目名称:sync,代码行数:2,代码来源:SauceEntity.java


注:本文中的com.google.api.server.spi.config.AnnotationBoolean.TRUE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。