Java 类javax.json.bind.annotation.JsonbProperty 实例源码

项目:yasson    文件:AnnotationIntrospector.java   
private JsonbCreator createJsonbCreator(Executable executable, JsonbCreator existing, Class<?> clazz) {
    if (existing != null) {
        throw new JsonbException(Messages.getMessage(MessageKeys.MULTIPLE_JSONB_CREATORS, clazz));
    }

    final Parameter[] parameters = executable.getParameters();

    CreatorModel[] creatorModels = new CreatorModel[parameters.length];
    for (int i=0; i<parameters.length; i++) {
        final Parameter parameter = parameters[i];
        final JsonbProperty jsonbPropertyAnnotation = parameter.getAnnotation(JsonbProperty.class);
        if (jsonbPropertyAnnotation != null && !jsonbPropertyAnnotation.value().isEmpty()) {
            creatorModels[i] = new CreatorModel(jsonbPropertyAnnotation.value(), parameter, jsonbContext);
        } else {
            creatorModels[i] = new CreatorModel(parameter.getName(), parameter, jsonbContext);
        }
    }

    return new JsonbCreator(executable, creatorModels);
}
项目:Java-EE-8-Sampler    文件:Magazine.java   
@JsonbCreator
public Magazine(@JsonbProperty("bookTitle") String title,
                @JsonbProperty("firstName") String firstName,
                @JsonbProperty("surname") String lastName) {
    this.title = title;
    this.authorName = new Author(firstName, lastName);
}
项目:yasson    文件:AnnotationIntrospector.java   
private String getJsonbPropertyCustomizedName(Property property, JsonbAnnotatedElement<Method> methodElement) {
    JsonbProperty methodAnnotation = getMethodAnnotation(JsonbProperty.class, methodElement);
    if (methodAnnotation != null && !methodAnnotation.value().isEmpty()) {
        return methodAnnotation.value();
    }
    //in case of property name getter/setter override field value
    JsonbProperty fieldAnnotation = getFieldAnnotation(JsonbProperty.class, property.getFieldElement());
    if (fieldAnnotation != null && !fieldAnnotation.value().isEmpty()) {
        return fieldAnnotation.value();
    }

    return null;
}
项目:Java-EE-8-Sampler    文件:Book.java   
@JsonbCreator
public static Book createBook(@JsonbProperty("id") String id,
                              @JsonbProperty("title") String title,
                              @JsonbProperty("author") String author) {
    return new Book(id, title, author);
}
项目:Java-EE-8-Sampler    文件:Book.java   
@JsonbProperty("bookTitle")
public String getTitle() {
    return title;
}
项目:Java-EE-8-Sampler    文件:Book.java   
@JsonbProperty("authorName")
public void setAuthor(String author) {
    this.author = author;
}
项目:Java-EE-8-Sampler    文件:Book.java   
@JsonbProperty("bookTitle")
public String getTitle() {
    return title;
}
项目:Java-EE-8-Sampler    文件:Book.java   
@JsonbProperty("authorName")
public void setAuthor(String author) {
    this.author = author;
}
项目:yasson    文件:JsonbPropertyNillable.java   
@JsonbProperty(nillable = true)
public String getNillableOverride() {
    return nillableOverride;
}
项目:yasson    文件:InterfacedPojoA.java   
@JsonbProperty("propA")
String getPropertyA();
项目:yasson    文件:InterfacedPojoA.java   
@JsonbProperty("propA")
void setPropertyA(String property);
项目:yasson    文件:InterfacedPojoC.java   
@JsonbProperty("propC")
String getPropertyC();
项目:yasson    文件:InterfacedPojoC.java   
@JsonbProperty("propC")
void setPropertyC(String propertyC);
项目:yasson    文件:CreatorPackagePrivateConstructor.java   
@JsonbCreator
CreatorPackagePrivateConstructor(@JsonbProperty("intVal") int intVal) {
    this.intVal = intVal;
}
项目:yasson    文件:CreatorWithoutJavabeanProperty.java   
@JsonbCreator
public CreatorWithoutJavabeanProperty(@JsonbProperty("s1") String s1, @JsonbProperty("s2") String s2) {
    this.strField = s1 + s2;
}
项目:yasson    文件:CreatorWithoutJsonbProperty.java   
@JsonbCreator
public CreatorWithoutJsonbProperty(@JsonbProperty("s1") String par1, String par2, double d1) {
    this.par1 = par1;
    this.par2 = par2;
    this.par3 = d1;
}
项目:yasson    文件:CreatorWithoutJsonbProperty1.java   
@JsonbCreator
public CreatorWithoutJsonbProperty1(String par1, @JsonbProperty("s2") String par2, byte par3) {
    this.par1 = par1;
    this.par2 = par2;
    this.par3 = par3;
}
项目:yasson    文件:CreatorConstructorPojo.java   
@JsonbCreator
public CreatorConstructorPojo(@JsonbProperty("str1") String str1, @JsonbProperty("str2") String str2) {
    this.str1 = str1;
    this.str2 = str2;
}
项目:yasson    文件:InterfacedPojoB.java   
@JsonbProperty("propB")
String getPropertyB();
项目:yasson    文件:InterfacedPojoB.java   
@JsonbProperty("propB")
void setPropertyB(String propertyB);
项目:yasson    文件:JsonbNillableOverriddenWithJsonbProperty.java   
@JsonbProperty(nillable = false)
public String getNillableOverriddenWithGetterJsonbProperty() {
    return nillableOverriddenWithGetterJsonbProperty;
}
项目:yasson    文件:JsonbNillableOverriddenWithJsonbProperty.java   
@JsonbProperty(nillable = false)
public void setNillableOverriddenWithSetterJsonbProperty(String nillableOverriddenWithSetterJsonbProperty) {
    this.nillableOverriddenWithSetterJsonbProperty = nillableOverriddenWithSetterJsonbProperty;
}
项目:yasson    文件:CreatorMultipleDeclarationErrorPojo.java   
@JsonbCreator
public CreatorMultipleDeclarationErrorPojo(@JsonbProperty("val1") String s1) {
    this.s1 = s1;
}
项目:yasson    文件:CreatorFactoryMethodPojo.java   
@JsonbCreator
public static CreatorFactoryMethodPojo getInstance(@JsonbProperty("par1") String str1, @JsonbProperty("par2")String str2) {
    return new CreatorFactoryMethodPojo(str1, str2);
}
项目:yasson    文件:JsonbPropertyName.java   
@JsonbProperty("getterAnnotatedName")
public String getMethodAnnotName() {
    return methodAnnotName;
}
项目:yasson    文件:JsonbPropertyName.java   
@JsonbProperty("setterAnnotatedName")
public void setMethodAnnotName(String methodAnnotName) {
    this.methodAnnotName = methodAnnotName;
}
项目:yasson    文件:JsonbPropertyName.java   
@JsonbProperty("getterOverriddenName")
public String getFieldOverriddenWithMethodAnnot() {
    return fieldOverriddenWithMethodAnnot;
}
项目:yasson    文件:JsonbPropertyName.java   
@JsonbProperty("setterOverriddenName")
public void setFieldOverriddenWithMethodAnnot(String fieldOverriddenWithMethodAnnot) {
    this.fieldOverriddenWithMethodAnnot = fieldOverriddenWithMethodAnnot;
}
项目:yasson    文件:JsonbTransientCollisionOnPropertyAndGetterAndSetter.java   
@JsonbProperty("custom_name")
public String getTransientProperty() {
    return transientProperty;
}
项目:yasson    文件:JsonbTransientCollisionOnPropertyAndGetterAndSetter.java   
@JsonbProperty("custom_name")
public void setTransientProperty(String transientProperty) {
    this.transientProperty = transientProperty;
}
项目:yasson    文件:JsonbTransientCollisionOnSetter.java   
@JsonbTransient
@JsonbProperty("custom_name")
public void setTransientProperty(String transientProperty) {
    this.transientProperty = transientProperty;
}
项目:yasson    文件:JsonbTransientCollisionOnPropertyAndGetter.java   
@JsonbProperty("custom_name")
public String getTransientProperty() {
    return transientProperty;
}
项目:yasson    文件:JsonbTransientCollisionOnGetter.java   
@JsonbTransient
@JsonbProperty("custom_name")
public String getTransientProperty() {
    return transientProperty;
}
项目:yasson    文件:TransientSetterPlusCustomizationAnnotatedGetterContainer.java   
@JsonbProperty("instance")
public String getInstance() {
    return instance;
}
项目:yasson    文件:JsonbTransientCollisionOnPropertyAndSetter.java   
@JsonbProperty("custom_name")
public void setTransientProperty(String transientProperty) {
    this.transientProperty = transientProperty;
}
项目:yasson    文件:JsonbPropertyTest.java   
@JsonbProperty("doi")
public String getDOI() {
    return doi;
}
项目:yasson    文件:JsonbPropertyTest.java   
@JsonbProperty("doi")
public String getDOI() {
    return doi;
}
项目:yasson    文件:JsonbPropertyTest.java   
@JsonbProperty("Doi")
public String getDOI() {
    return doi;
}
项目:yasson    文件:JsonbCreatorTest.java   
@JsonbCreator
public DateConstructor(@JsonbProperty("localDate") @JsonbDateFormat(value = "dd-MM-yyyy", locale = "nl-NL") LocalDate localDate) {
    this.localDate = localDate;
}
项目:yasson    文件:JsonbCreatorTest.java   
@JsonbCreator
public DateConstructorMergedWithProperty(@JsonbProperty("localDate") LocalDate localDate) {
    this.localDate = localDate;
}