當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。