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


Java JsonIgnoreProperties类代码示例

本文整理汇总了Java中com.fasterxml.jackson.annotation.JsonIgnoreProperties的典型用法代码示例。如果您正苦于以下问题:Java JsonIgnoreProperties类的具体用法?Java JsonIgnoreProperties怎么用?Java JsonIgnoreProperties使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1:

import com.fasterxml.jackson.annotation.JsonIgnoreProperties; //导入依赖的package包/类
@JsonCreator
@JsonIgnoreProperties(ignoreUnknown=true)
TaskAssignmentResult(@JsonProperty("avm") AssignableVirtualMachine avm,
                     @JsonProperty("request") TaskRequest request,
                     @JsonProperty("successful") boolean successful,
                     @JsonProperty("failures") List<AssignmentFailure> failures,
                     @JsonProperty("constraintFailure") ConstraintFailure constraintFailure,
                     @JsonProperty("fitness") double fitness) {
    this.avm = avm;
    this.request = request;
    this.taskId = request.getId();
    this.hostname = avm==null? "":avm.getHostname();
    this.successful = successful;
    this.failures = failures;
    this.constraintFailure = constraintFailure;
    this.fitness = fitness;
    assignedPorts = new ArrayList<>();
    rSets = new ArrayList<>();
}
 
开发者ID:Netflix,项目名称:Fenzo,代码行数:20,代码来源:TaskAssignmentResult.java

示例2: getIgnoredProperties

import com.fasterxml.jackson.annotation.JsonIgnoreProperties; //导入依赖的package包/类
private void getIgnoredProperties(ClassInformation information, ReflectClass<?> cls) {
    JsonIgnoreProperties annot = cls.getAnnotation(JsonIgnoreProperties.class);
    if (annot == null) {
        return;
    }

    for (String name : annot.value()) {
        PropertyInformation property = information.properties.get(name);
        if (property == null) {
            property = new PropertyInformation();
            property.name = name;
            information.properties.put(name, property);
        }
        property.ignored = true;
    }
}
 
开发者ID:konsoletyper,项目名称:teavm-flavour,代码行数:17,代码来源:ClassInformationProvider.java

示例3: getAllOffersByTask

import com.fasterxml.jackson.annotation.JsonIgnoreProperties; //导入依赖的package包/类
/**
 * This method returns a list with all ids of offers that contain a specific task. This is irrespective 
 * of the marketplace. 
 *   
 * @param taskId
 * 			The id of the task, which all returned offers contain.
 * @param apiKey
 * 			The valid query parameter API key affiliated to one specific organisation, 
 *            to which the offer belongs to.
 * @return A list of all offers' ids that contain the task with the passed id as a list. 
 */
@GET
@Path("/offers/{taskId}/*")
@TypeHint(Integer[].class)
@JsonIgnoreProperties({ "player" })
public Response getAllOffersByTask(
		@PathParam("taskId") @NotNull @ValidPositiveDigit(message = "The task id must be a valid number") String taskId,
		@QueryParam("apiKey") @ValidApiKey String apiKey) {
	
	int idTask = ValidateUtils.requireGreaterThanZero(taskId);
	Task task = taskDao.getTask(idTask, apiKey);
	
	List<Offer> offers = marketPlDao.getOffersByTask(task, apiKey); 
	List<Integer> matchingOffers = new ArrayList<>();
	
	for (Offer offer : offers) {
		LOGGER.debug("| Offer:" + offer.getId());
		matchingOffers.add(offer.getId());
	}

	return ResponseSurrogate.of(matchingOffers);
}
 
开发者ID:InteractiveSystemsGroup,项目名称:GamificationEngine-Kinben,代码行数:33,代码来源:MarketPlaceApi.java

示例4: getAllMarketPlaceOffersByTask

import com.fasterxml.jackson.annotation.JsonIgnoreProperties; //导入依赖的package包/类
/**
 * This method returns a list with all offers which contain a specific task and the id of the 
 * offer's marketplace. 
 * 
 * @param taskId
 * 			The id of the task, which all returned offers contain.
 * @param apiKey
 * 			The valid query parameter API key affiliated to one specific organisation, 
 *            to which the offer belongs to.
 * @return A list of all offers and their marketplaces which contain the task with the 
 * 			passed id as a list. 
 */
@GET
@Path("/offers/{taskId}/market/*")
@TypeHint(Offer[].class)
@JsonIgnoreProperties({ "player" })
public Response getAllMarketPlaceOffersByTask(
		@PathParam("taskId") @NotNull @ValidPositiveDigit(message = "The task id must be a valid number") String taskId,
		@QueryParam("apiKey") @ValidApiKey String apiKey) {
	
	int idTask = ValidateUtils.requireGreaterThanZero(taskId);
	Task task = taskDao.getTask(idTask, apiKey);
	
	ArrayList<OfferMarketPlace> offList = MarketPlace.getAllOfferMarketPlaces(marketPlDao, task, apiKey);
	
	return ResponseSurrogate.of(offList);
}
 
开发者ID:InteractiveSystemsGroup,项目名称:GamificationEngine-Kinben,代码行数:28,代码来源:MarketPlaceApi.java

示例5: getAsJson

import com.fasterxml.jackson.annotation.JsonIgnoreProperties; //导入依赖的package包/类
@JsonIgnoreProperties
public String getAsJson(Tweet tweet) {
	ObjectMapper mapper = new ObjectMapper();
	String result = "";
	try {
		result = mapper.writeValueAsString(tweet);
	} catch (JsonProcessingException e) {
		e.printStackTrace();
	}
	return result;
}
 
开发者ID:shubhamsharma04,项目名称:jsonTweetDownload,代码行数:12,代码来源:Tweet.java

示例6: ConstraintFailure

import com.fasterxml.jackson.annotation.JsonIgnoreProperties; //导入依赖的package包/类
@JsonCreator
@JsonIgnoreProperties(ignoreUnknown=true)
public ConstraintFailure(@JsonProperty("name") String name, @JsonProperty("reason") String reason) {
    this.name = name;
    this.reason = reason;
    objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
 
开发者ID:Netflix,项目名称:Fenzo,代码行数:8,代码来源:ConstraintFailure.java

示例7: AssignmentFailure

import com.fasterxml.jackson.annotation.JsonIgnoreProperties; //导入依赖的package包/类
@JsonCreator
@JsonIgnoreProperties(ignoreUnknown=true)
public AssignmentFailure(@JsonProperty("resource") VMResource resource,
                         @JsonProperty("asking") double asking,
                         @JsonProperty("used") double used,
                         @JsonProperty("available") double available,
                         @JsonProperty("message") String message
) {
    this.resource = resource;
    this.asking = asking;
    this.used = used;
    this.available = available;
    this.message = message;
}
 
开发者ID:Netflix,项目名称:Fenzo,代码行数:15,代码来源:AssignmentFailure.java

示例8: ConsumeResult

import com.fasterxml.jackson.annotation.JsonIgnoreProperties; //导入依赖的package包/类
@JsonCreator
@JsonIgnoreProperties(ignoreUnknown=true)
public ConsumeResult(@JsonProperty("index") int index,
                     @JsonProperty("attrName") String attrName,
                     @JsonProperty("resName") String resName,
                     @JsonProperty("fitness") double fitness) {
    this.index = index;
    this.attrName = attrName;
    this.resName = resName;
    this.fitness = fitness;
}
 
开发者ID:Netflix,项目名称:Fenzo,代码行数:12,代码来源:PreferentialNamedConsumableResourceSet.java

示例9: of

import com.fasterxml.jackson.annotation.JsonIgnoreProperties; //导入依赖的package包/类
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonCreator
public static GroupMessage of( //
		@JsonProperty("_id") final String id, //
		@JsonProperty("_from") final String groupId, //
		@JsonProperty("participant") final String senderPhone, //
		@JsonProperty(value = "notify", required = false) final String senderName, //
		@JsonProperty(value = "body", required = false) final String text) {

	return new GroupMessage(escapeDot(id), escapeDot(groupId), escapeDot(senderPhone), senderName, text == null ? "" : text);
}
 
开发者ID:learning-spring-boot,项目名称:contest-votesapp,代码行数:12,代码来源:GroupMessage.java

示例10: annotatedWithIgnore

import com.fasterxml.jackson.annotation.JsonIgnoreProperties; //导入依赖的package包/类
/**
 * Returns a boolean indicating whether the provided field is annotated with
 * some form of ignore. This method is memoized to speed up execution time
 */
boolean annotatedWithIgnore(Field f) {
  return memoizer.ignoreAnnotations(f, () -> {
    JsonIgnore jsonIgnore = getAnnotation(f, JsonIgnore.class);
    JsonIgnoreProperties classIgnoreProperties = getAnnotation(f.getDeclaringClass(), JsonIgnoreProperties.class);
    JsonIgnoreProperties fieldIgnoreProperties = null;
    boolean backReferenced = false;

    //make sure the referring field didn't specify properties to ignore
    if(referringField != null) {
      fieldIgnoreProperties = getAnnotation(referringField, JsonIgnoreProperties.class);
    }

    //make sure the referring field didn't specify a backreference annotation
    if(getAnnotation(f, JsonBackReference.class) != null && referringField != null) {
      for(Field lastField : getDeclaredFields(referringField.getDeclaringClass())) {
        JsonManagedReference fieldManagedReference = getAnnotation(lastField, JsonManagedReference.class);
        if(fieldManagedReference != null && lastField.getType().equals(f.getDeclaringClass())) {
          backReferenced = true;
          break;
        }
      }
    }

    return (jsonIgnore != null && jsonIgnore.value()) ||
        (classIgnoreProperties != null && Arrays.asList(classIgnoreProperties.value()).contains(f.getName())) ||
        (fieldIgnoreProperties != null && Arrays.asList(fieldIgnoreProperties.value()).contains(f.getName())) ||
        backReferenced;
  });
}
 
开发者ID:monitorjbl,项目名称:json-view,代码行数:34,代码来源:JsonViewSerializer.java

示例11: findIgnoreUnknownProperties

import com.fasterxml.jackson.annotation.JsonIgnoreProperties; //导入依赖的package包/类
public Boolean findIgnoreUnknownProperties(AnnotatedClass paramAnnotatedClass)
{
  JsonIgnoreProperties localJsonIgnoreProperties = (JsonIgnoreProperties)paramAnnotatedClass.getAnnotation(JsonIgnoreProperties.class);
  if (localJsonIgnoreProperties == null)
    return null;
  return Boolean.valueOf(localJsonIgnoreProperties.ignoreUnknown());
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:8,代码来源:JacksonAnnotationIntrospector.java

示例12: findPropertiesToIgnore

import com.fasterxml.jackson.annotation.JsonIgnoreProperties; //导入依赖的package包/类
public String[] findPropertiesToIgnore(Annotated paramAnnotated)
{
  JsonIgnoreProperties localJsonIgnoreProperties = (JsonIgnoreProperties)paramAnnotated.getAnnotation(JsonIgnoreProperties.class);
  if (localJsonIgnoreProperties == null)
    return null;
  return localJsonIgnoreProperties.value();
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:8,代码来源:JacksonAnnotationIntrospector.java

示例13: PaymentResponse

import com.fasterxml.jackson.annotation.JsonIgnoreProperties; //导入依赖的package包/类
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonCreator
public PaymentResponse(@JsonProperty("id") String id,
                       @JsonProperty("score") Integer score,
                       @JsonProperty("type") String type,
                       @JsonProperty("likelyFraud") Boolean likelyFraud,
                       @JsonProperty("baseRisk") Double baseRisk,
                       @JsonProperty("explanation") List<Explanation> explanation) {
    this.id = id;
    this.score = score;
    this.type = type;
    this.likelyFraud = likelyFraud;
    this.baseRisk = baseRisk;
    this.explanation = explanation;
}
 
开发者ID:killbill,项目名称:feedzai-client,代码行数:16,代码来源:PaymentResponse.java

示例14: getParticipants

import com.fasterxml.jackson.annotation.JsonIgnoreProperties; //导入依赖的package包/类
@JsonIgnoreProperties({"pw", "email", "name", "devices", "lastModified", "created"})
public ArrayList<User> getParticipants() {
    if (participants == null) {
        participants = new ArrayList<>();
        User mDummy = new User("Dummy", 12);
        participants.add(mDummy);
        // Without cast IntelliJ is not happy
        Log.e(((Object) this).getClass().getSimpleName(), "Participants are null");
    }
    return new ArrayList<User>(participants);
}
 
开发者ID:FAU-Inf2,项目名称:yasme-android,代码行数:12,代码来源:Chat.java

示例15: getOwner

import com.fasterxml.jackson.annotation.JsonIgnoreProperties; //导入依赖的package包/类
@JsonIgnoreProperties({"pw", "email", "name", "devices", "lastModified", "created"})
public User getOwner() {
    if (owner == null) {
        owner = new User("Dummy", 12);
    }
    return owner;
}
 
开发者ID:FAU-Inf2,项目名称:yasme-android,代码行数:8,代码来源:Chat.java


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