Examples of ApiObjectDoc


Examples of org.jsondoc.core.pojo.ApiObjectDoc

 
  @Test
  public void testEnumObjectDoc() {
    Set<Class<?>> classes = new HashSet<Class<?>>();
    classes.add(TestEnum.class);
    ApiObjectDoc childDoc = JSONDocUtils.getApiObjectDocs(classes).iterator().next();
    Assert.assertEquals("test-enum", childDoc.getName());
    Assert.assertEquals(0, childDoc.getFields().size());
    Assert.assertEquals(TestEnum.TESTENUM1.name(), childDoc.getAllowedvalues()[0]);
    Assert.assertEquals(TestEnum.TESTENUM2.name(), childDoc.getAllowedvalues()[1]);
    Assert.assertEquals(TestEnum.TESTENUM3.name(), childDoc.getAllowedvalues()[2]);
  }
View Full Code Here

Examples of org.jsondoc.core.pojo.ApiObjectDoc

 
  @Test
  public void testApiObjectDoc() {
    Set<Class<?>> classes = new HashSet<Class<?>>();
    classes.add(TestObject.class);
    ApiObjectDoc childDoc = JSONDocUtils.getApiObjectDocs(classes).iterator().next();
    Assert.assertEquals("test-object", childDoc.getName());
    Assert.assertEquals(12, childDoc.getFields().size());
    Assert.assertEquals("1.0", childDoc.getSupportedversions().getSince());
    Assert.assertEquals("2.12", childDoc.getSupportedversions().getUntil());
   
    for (ApiObjectFieldDoc fieldDoc : childDoc.getFields()) {
      if(fieldDoc.getName().equals("wildcardParametrized")) {
        Assert.assertEquals("wildcard", fieldDoc.getType());
        Assert.assertEquals("true", fieldDoc.getMultiple());
      }
     
View Full Code Here

Examples of org.jsondoc.core.pojo.ApiObjectDoc

  public static Set<ApiObjectDoc> getApiObjectDocs(Set<Class<?>> classes) {
    Set<ApiObjectDoc> pojoDocs = new TreeSet<ApiObjectDoc>();
    for (Class<?> pojo : classes) {
      log.debug("Getting JSONDoc for class: " + pojo.getName());
      ApiObject annotation = pojo.getAnnotation(ApiObject.class);
      ApiObjectDoc pojoDoc = ApiObjectDoc.buildFromAnnotation(annotation, pojo);
      if(pojo.isAnnotationPresent(ApiVersion.class)) {
        pojoDoc.setSupportedversions(ApiVersionDoc.buildFromAnnotation(pojo.getAnnotation(ApiVersion.class)));
      }
     
      if(annotation.show()) {
        pojoDocs.add(pojoDoc);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.