org.apache.juneau.http.annotation.Body.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(229)

本文整理了Java中org.apache.juneau.http.annotation.Body.<init>()方法的一些代码示例,展示了Body.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Body.<init>()方法的具体详情如下:
包路径:org.apache.juneau.http.annotation.Body
类名称:Body
方法名:<init>

Body.<init>介绍

暂无

代码示例

代码示例来源:origin: org.apache.juneau/juneau-examples-rest

@RemoteMethod(method=POST, path="/user/createWithArray")
public Ok createUsers(
  @Body(
    description="List of user objects"
  )
  User[] users
) throws InvalidUsername, IdConflict, NotAcceptable, UnsupportedMediaType;

代码示例来源:origin: org.apache.juneau/juneau-examples-rest

@RemoteMethod(method=PUT, path="/pet/{petId}")
public Ok updatePet(
  @Body(
    description="Pet object that needs to be added to the store"
  ) UpdatePet pet
) throws IdNotFound, NotAcceptable, UnsupportedMediaType;

代码示例来源:origin: apache/juneau

@Body
  public static class B05 {
    private String s;
    public B05(Reader in) throws Exception { this.s = IOUtils.read(in); }
    @Override public String toString() { return s; }
  }
}

代码示例来源:origin: org.apache.juneau/juneau-examples-rest

@RestMethod(
    summary="Overwrite the JSON-Schema document",
    description="Replaces the schema document with the specified content, and then mirrors it as the response."
  )
  public JsonSchema put(@Body JsonSchema schema) throws Exception {
    this.schema = schema;
    return schema;
  }
}

代码示例来源:origin: org.apache.juneau/juneau-examples-rest

@RestMethod(
    summary="Overwrite the sample ATOM feed",
    description="Replaces the feed with the specified content, and then mirrors it as the response."
  )
  public Feed put(@Body Feed feed) throws Exception {
    this.feed = feed;
    return feed;
  }
}

代码示例来源:origin: apache/juneau

@RestMethod(name=POST, path="/setEnum1d3dListMap")
public void setEnum1d3dListMap(@Body Map<TestEnum,List<TestEnum[][][]>> x) {
  assertObjectEquals("{ONE:[[[['TWO',null],null],null],null]}", x);
  Map.Entry<TestEnum,List<TestEnum[][][]>> e = x.entrySet().iterator().next();
  assertClass(TestEnum.class, e.getKey());
  assertClass(TestEnum[][][].class, e.getValue().get(0));
}

代码示例来源:origin: apache/juneau

@RestMethod(name=POST, path="/setSwappedPojoMap")
public void setSwappedPojoMap(@Body Map<SwappedPojo,SwappedPojo> x) {
  assertObjectEquals("{'"+SWAP+"':'"+SWAP+"'}", x);
  Map.Entry<SwappedPojo,SwappedPojo> e = x.entrySet().iterator().next();
  assertTrue(e.getKey().wasUnswapped);
  assertTrue(e.getValue().wasUnswapped);
}

代码示例来源:origin: org.apache.juneau/juneau-examples-rest

@RemoteMethod(method=PUT, path="/user/{username}")
public Ok updateUser(
  @Path(
    name="username",
    description="Name that need to be updated"
  )
  String username,
  @Body(
    description="Updated user object"
  )
  User user
) throws InvalidUsername, IdNotFound, NotAcceptable, UnsupportedMediaType;

代码示例来源:origin: apache/juneau

@RestMethod(name=POST, path="/setTypedBean1d3dListMap")
public void setTypedBean1d3dListMap(@Body Map<String,List<TypedBean[][][]>> x) {
  assertObjectEquals("{foo:[[[[{_type:'TypedBeanImpl',a:1,b:'foo'},null],null],null],null]}", x);
  assertClass(TypedBeanImpl.class, x.get("foo").get(0)[0][0][0]);
}

代码示例来源:origin: apache/juneau

@RestMethod(name=POST, path="/setTypedBeanListMapIntegerKeys")
public void setTypedBeanListMapIntegerKeys(@Body Map<Integer,List<TypedBean>> x) {
  assertObjectEquals("{'1':[{_type:'TypedBeanImpl',a:1,b:'foo'}]}", x);  // Note: JsonSerializer serializes key as string.
  assertClass(TypedBeanImpl.class, x.get(1).get(0));
}

代码示例来源:origin: apache/juneau

@RemoteMethod(method=PUT, path="/user/{username}")
public Ok updateUser(
  @Path(
    name="username",
    description="Name that need to be updated"
  )
  String username,
  @Body(
    description="Updated user object"
  )
  User user
) throws InvalidUsername, IdNotFound, NotAcceptable, UnsupportedMediaType;

代码示例来源:origin: apache/juneau

@RestMethod(name=POST, path="/setEnum1d3dList")
public void setEnum1d3dList(@Body List<TestEnum[][][]> x) {
  assertObjectEquals("[[[['TWO',null],null],null],null]", x);
  assertClass(TestEnum[][][].class, x.get(0));
}

代码示例来源:origin: apache/juneau

@RestMethod(name=POST, path="/setTypedBean3dArray")
public void setTypedBean3dArray(@Body TypedBean[][][] x) {
  assertObjectEquals("[[[{_type:'TypedBeanImpl',a:1,b:'foo'},null],null],null]", x);
  assertClass(TypedBeanImpl.class, x[0][0][0]);
}

代码示例来源:origin: apache/juneau

@RestMethod(name=PUT, path="/classTransformOverridesParentClassTransform")
public A a01b(@Body A a) {
  return a; // Should return "A2-1".
}
@RestMethod(name=PUT, path="/classTransformOverridesParentClassTransform/{a}")

代码示例来源:origin: apache/juneau

@RestMethod
  public String putA01(@Body String in) {
    return in;
  }
}

代码示例来源:origin: apache/juneau

public void a(
      @Body(
        description={"b3","b3"},
        required=true,
        schema=@Schema($ref="c3"),
        example="f2",
        api="{g2:true}"
      ) A02 x
    ) {
  }
}

代码示例来源:origin: apache/juneau

@RestMethod(name=PUT, path="/parserOnMethod", parsers=PB.class)
public String a02(@Body String in) {
  return in;
}
@RestMethod(name=PUT, path="/parserOverriddenOnMethod", parsers={Inherit.class, PB.class,PC.class})

代码示例来源:origin: apache/juneau

@RestMethod(name=PUT, path="/Boolean")
public Boolean a04(@Body Boolean b) {
  return b;
}
@RestMethod(name=PUT, path="/boolean")

代码示例来源:origin: apache/juneau

@RestMethod(name=PUT, path="/String")
public Reader d01(@Body Reader b) throws Exception {
  return b;
}
@RestMethod(name=PUT, path="/InputStream")

代码示例来源:origin: apache/juneau

@RestMethod(name=POST,path="/",
    properties={
      @Property(name=UrlEncodingSerializer.URLENC_expandedParams, value="true"),
      @Property(name=UrlEncodingParser.URLENC_expandedParams, value="true")
    }
  )
  public DTOs.B g(@Body DTOs.B content) throws Exception {
    return content;
  }
}

相关文章