Java Code Examples for org.codehaus.jackson.annotate.JsonProperty

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project resty-gwt, under directory /restygwt/src/main/java/org/fusesource/restygwt/rebind/.

Source file: JsonEncoderDecoderClassCreator.java

  21 
vote

private List<JField> getOrderedFields(List<JField> fields,JConstructor creator) throws UnableToCompleteException {
  List<JField> orderedFields=new ArrayList<JField>();
  for (  JParameter param : creator.getParameters()) {
    JsonProperty prop=param.getAnnotation(JsonProperty.class);
    if (prop != null) {
      for (      JField field : fields) {
        if (field.getName().equals(prop.value())) {
          orderedFields.add(field);
        }
      }
    }
 else {
      error("a constructor annotated with @JsonCreator requires that all paramaters are annotated with @JsonProperty.");
    }
  }
  return orderedFields;
}
 

Example 2

From project airlift, under directory /discovery/src/main/java/io/airlift/discovery/client/.

Source file: ServiceDescriptor.java

  19 
vote

@JsonCreator public ServiceDescriptor(@JsonProperty("id") UUID id,@JsonProperty("nodeId") String nodeId,@JsonProperty("type") String type,@JsonProperty("pool") String pool,@JsonProperty("location") String location,@JsonProperty("state") ServiceState state,@JsonProperty("properties") Map<String,String> properties){
  Preconditions.checkNotNull(properties,"properties is null");
  this.id=id;
  this.nodeId=nodeId;
  this.type=type;
  this.pool=pool;
  this.location=location;
  this.state=state;
  this.properties=ImmutableMap.copyOf(properties);
}
 

Example 3

From project ambrose, under directory /common/src/main/java/com/twitter/ambrose/model/.

Source file: JobInfo.java

  19 
vote

@JsonCreator public JobInfo(@JsonProperty("counterGroupInfoMap") Map<String,CounterGroupInfo> counterGroupInfoMap,@JsonProperty("inputInfoList") List<InputInfo> inputInfoList,@JsonProperty("outputInfoList") List<OutputInfo> outputInfoList,@JsonProperty("jobData") Map<String,Object> jobData,@JsonProperty("jobConfProperties") Properties jobConfProperties){
  this.counterGroupInfoMap=counterGroupInfoMap;
  this.inputInfoList=inputInfoList;
  this.outputInfoList=outputInfoList;
  this.jobData=jobData;
  this.jobConfProperties=jobConfProperties;
}
 

Example 4

From project Arecibo, under directory /alert-confdata-support/src/main/java/com/ning/arecibo/alert/confdata/.

Source file: AlertingConfig.java

  19 
vote

@JsonCreator public AlertingConfig(@JsonProperty("label") final String alertingConfigurationName,@JsonProperty("enabled") final String enabled,@JsonProperty("notif_on_recovery") final String notifOnRecovery,@JsonProperty("notif_repeat_interval_ms") final Long repeatInterval,@JsonProperty("notif_repeat_mode") final String repeatMode,@JsonProperty("id") final Integer id){
  this.alertingConfigurationName=alertingConfigurationName;
  this.enabled=!(enabled != null && enabled.equals("0"));
  this.notifyOnRecovery=!(notifOnRecovery != null && notifOnRecovery.equals("0"));
  this.repeatInterval=repeatInterval;
  this.repeatMode=repeatMode;
  this.id=id;
}
 

Example 5

From project cloud-management, under directory /src/main/java/com/proofpoint/cloudmanagement/service/.

Source file: InstanceCreationRequest.java

  19 
vote

@JsonCreator public InstanceCreationRequest(@JsonProperty("size") String size,@JsonProperty("namePrefix") String namePrefix,@JsonProperty("provider") String provider,@JsonProperty("location") String location){
  this.size=size;
  this.namePrefix=namePrefix;
  this.provider=provider;
  this.location=location;
}
 

Example 6

From project crest, under directory /sample/src/main/java/org/codegist/crest/google/model/.

Source file: Address.java

  19 
vote

@JsonCreator public Address(@JsonProperty("unescapedUrl") String unescapedUrl,@JsonProperty("url") String url,@JsonProperty("visibleUrl") String visibleUrl,@JsonProperty("cacheUrl") String cacheUrl,@JsonProperty("title") String title,@JsonProperty("titleNoFormatting") String titleNoFormatting,@JsonProperty("content") String content){
  this.unescapedUrl=unescapedUrl;
  this.url=url;
  this.visibleUrl=visibleUrl;
  this.cacheUrl=cacheUrl;
  this.title=title;
  this.titleNoFormatting=titleNoFormatting;
  this.content=content;
}
 

Example 7

From project event-collector, under directory /event-collector/src/main/java/com/proofpoint/event/collector/.

Source file: Event.java

  19 
vote

@JsonCreator public Event(@JsonProperty("type") String type,@JsonProperty("uuid") String uuid,@JsonProperty("host") String host,@JsonProperty("timestamp") DateTime timestamp,@JsonProperty("data") Map<String,?> data){
  this.type=type;
  this.uuid=uuid;
  this.host=host;
  this.timestamp=timestamp;
  this.data=data;
}
 

Example 8

From project gxa, under directory /atlas-web/src/main/java/ae3/service/structuredquery/.

Source file: AtlasStructuredQuery.java

  19 
vote

/** 
 * Checks if query is "simple" query (just one condition)
 * @return true or false
 */
@JsonProperty("simple") public boolean isSimple(){
  Iterator<ExpFactorQueryCondition> efi=conditions.iterator();
  if (efi.hasNext()) {
    ExpFactorQueryCondition efc=efi.next();
    if (efi.hasNext() || !"".equals(efc.getFactor()) || efc.getMinExperiments() > 1)     return false;
  }
  Iterator<GeneQueryCondition> gqi=geneConditions.iterator();
  if (gqi.hasNext()) {
    GeneQueryCondition gqc=gqi.next();
    if (gqi.hasNext() || gqc.isNegated())     return false;
  }
  Iterator<String> spi=species.iterator();
  return (!spi.hasNext() || (spi.next() != null && !spi.hasNext()));
}
 

Example 9

From project monitor-event-tap, under directory /src/main/java/com/proofpoint/event/monitor/.

Source file: Event.java

  19 
vote

@JsonCreator public Event(@JsonProperty("type") String type,@JsonProperty("uuid") String uuid,@JsonProperty("host") String host,@JsonProperty("timestamp") DateTime timestamp,@JsonProperty("data") Map<String,?> data){
  this.type=type;
  this.uuid=uuid;
  this.host=host;
  this.timestamp=timestamp;
  this.data=data;
}
 

Example 10

From project platform_3, under directory /discovery/src/main/java/com/proofpoint/discovery/client/.

Source file: ServiceDescriptor.java

  19 
vote

@JsonCreator public ServiceDescriptor(@JsonProperty("id") UUID id,@JsonProperty("nodeId") String nodeId,@JsonProperty("type") String type,@JsonProperty("pool") String pool,@JsonProperty("location") String location,@JsonProperty("state") ServiceState state,@JsonProperty("properties") Map<String,String> properties){
  Preconditions.checkNotNull(properties,"properties is null");
  this.id=id;
  this.nodeId=nodeId;
  this.type=type;
  this.pool=pool;
  this.location=location;
  this.state=state;
  this.properties=ImmutableMap.copyOf(properties);
}
 

Example 11

From project riak-java-client, under directory /src/main/java/com/basho/riak/client/query/.

Source file: BucketMapReduce.java

  19 
vote

@Override protected void writeInput(JsonGenerator jsonGenerator) throws IOException {
  if (hasFilters()) {
    jsonGenerator.writeObject(new Object(){
      @SuppressWarnings("unused") @JsonProperty String bucket=getBucket();
      @SuppressWarnings("unused") @JsonProperty Collection<Object[]> key_filters=getKeyFilters();
    }
);
  }
 else {
    jsonGenerator.writeString(bucket);
  }
}
 

Example 12

From project SchoolPlanner4Untis, under directory /src/edu/htl3r/schoolplanner/backend/schoolObjects/lesson/.

Source file: Lesson.java

  19 
vote

@JsonProperty(value="date") public void setDate(String iso8601Date){
  DateTime dateTime=DateTimeUtils.iso8601StringToDateTime(iso8601Date);
  date.set(dateTime.getDay(),dateTime.getMonth(),dateTime.getYear());
  startTime.set(dateTime.getDay(),dateTime.getMonth(),dateTime.getYear());
  endTime.set(dateTime.getDay(),dateTime.getMonth(),dateTime.getYear());
}
 

Example 13

From project service-discovery, under directory /client/src/main/java/com/nesscomputing/service/discovery/client/.

Source file: ServiceInformation.java

  19 
vote

@JsonCreator ServiceInformation(@Nonnull @JsonProperty("serviceName") final String serviceName,@Nullable @JsonProperty("serviceType") final String serviceType,@JsonProperty("serviceId") final UUID serviceId,@JsonProperty("properties") final Map<String,String> grabBag,@JsonProperty("staticAnnouncement") final Boolean staticAnnouncement){
  Preconditions.checkNotNull(serviceName,"Service name can not be null!");
  this.serviceName=serviceName;
  this.serviceType=serviceType;
  this.serviceId=serviceId == null ? UUID.randomUUID() : serviceId;
  this.staticAnnouncement=BooleanUtils.isTrue(staticAnnouncement);
  if (grabBag != null) {
    this.grabBag.putAll(grabBag);
  }
  this.announcementName=StringUtils.join(new String[]{this.serviceName,this.serviceType,this.serviceId.toString()},"-");
}
 

Example 14

From project SpoutcraftLauncher, under directory /src/main/java/org/spoutcraft/launcher/rest/.

Source file: Library.java

  19 
vote

@JsonCreator public Library(@JsonProperty("groupId") String groupId,@JsonProperty("artifactId") String artifactId,@JsonProperty("version") String version,@JsonProperty("hash") String md5){
  this.groupId=groupId;
  this.artifactId=artifactId;
  this.version=version;
  this.md5=md5;
}
 

Example 15

From project spring-data-document-examples, under directory /couchdb-myrestaurants/src/main/java/com/springone/myrestaurants/domain/.

Source file: Restaurant.java

  19 
vote

@JsonProperty("_id") public void getId(String s){
  Assert.hasText(s,"id must have a value");
  if (id != null) {
    throw new IllegalStateException("cannot set id, id already set");
  }
  id=s;
}
 

Example 16

From project spring-social-google, under directory /spring-social-google/spring-social-google/src/main/java/org/springframework/social/google/api/plus/comment/.

Source file: Comment.java

  19 
vote

@JsonCreator public Comment(@JsonProperty("id") String id,@JsonProperty("published") Date published,@JsonProperty("updated") Date updated,@JsonProperty("object") CommentObject object,@JsonProperty("actor") Person actor){
  this.id=id;
  this.published=published;
  this.updated=updated;
  this.content=object.content;
  this.actor=actor;
}
 

Example 17

From project usergrid-stack, under directory /count-common/src/main/java/com/usergrid/count/common/.

Source file: Count.java

  19 
vote

@JsonCreator public Count(@JsonProperty(value="tableName") String tableName,@JsonProperty(value="keyName") K keyName,@JsonProperty(value="columnName") C columnName,@JsonProperty(value="value") long value){
  this.tableName=tableName;
  this.keyName=keyName;
  this.columnName=columnName;
  this.value=value;
  this.keySerializer=SerializerTypeInferer.getSerializer(keyName);
  this.columnNameSerializer=SerializerTypeInferer.getSerializer(columnName);
}
 

Example 18

From project wiremock, under directory /src/main/java/com/github/tomakehurst/wiremock/verification/.

Source file: LoggedRequest.java

  19 
vote

@JsonCreator private LoggedRequest(@JsonProperty("url") String url,@JsonProperty("absoluteUrl") String absoluteUrl,@JsonProperty("method") RequestMethod method,@JsonProperty("headers") HttpHeaders headers,@JsonProperty("body") String body,@JsonProperty("browserProxyRequest") boolean isBrowserProxyRequest,@JsonProperty("loggedDate") Date loggedDate){
  this.url=url;
  this.absoluteUrl=absoluteUrl;
  this.method=method;
  this.body=body;
  this.headers=headers;
  this.isBrowserProxyRequest=isBrowserProxyRequest;
  this.loggedDate=loggedDate;
}