com.fasterxml.jackson.annotation.JsonTypeInfo.Id Java Examples

The following examples show how to use com.fasterxml.jackson.annotation.JsonTypeInfo.Id. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BeanTypeInfo.java    From gwt-jackson with Apache License 2.0 5 votes vote down vote up
BeanTypeInfo( Id use, As include, String propertyName, ImmutableMap<JClassType, String> mapTypeToSerializationMetadata,
              ImmutableMap<JClassType, String> mapTypeToDeserializationMetadata ) {
    this.use = use;
    this.include = include;
    this.propertyName = propertyName;
    this.mapTypeToSerializationMetadata = mapTypeToSerializationMetadata;
    this.mapTypeToDeserializationMetadata = mapTypeToDeserializationMetadata;
}
 
Example #2
Source File: BeanProcessor.java    From gwt-jackson with Apache License 2.0 5 votes vote down vote up
/**
 * <p>processType</p>
 *
 * @param logger a {@link com.google.gwt.core.ext.TreeLogger} object.
 * @param typeOracle a {@link com.github.nmorel.gwtjackson.rebind.JacksonTypeOracle} object.
 * @param configuration a {@link com.github.nmorel.gwtjackson.rebind.RebindConfiguration} object.
 * @param typeOracle a {@link com.github.nmorel.gwtjackson.rebind.JacksonTypeOracle} object.
 * @param type a {@link com.google.gwt.core.ext.typeinfo.JClassType} object.
 * @param jsonTypeInfo a {@link com.google.gwt.thirdparty.guava.common.base.Optional} object.
 * @param propertySubTypes a {@link com.google.gwt.thirdparty.guava.common.base.Optional} object.
 * @return a {@link com.google.gwt.thirdparty.guava.common.base.Optional} object.
 * @throws com.google.gwt.core.ext.UnableToCompleteException if any.
 */
public static Optional<BeanTypeInfo> processType( TreeLogger logger, JacksonTypeOracle typeOracle, RebindConfiguration configuration,
                                                  JClassType type, Optional<JsonTypeInfo> jsonTypeInfo, Optional<JsonSubTypes>
        propertySubTypes ) throws UnableToCompleteException {

    if ( !jsonTypeInfo.isPresent() ) {
        jsonTypeInfo = findFirstEncounteredAnnotationsOnAllHierarchy( configuration, type, JsonTypeInfo.class );
        if ( !jsonTypeInfo.isPresent() ) {
            return Optional.absent();
        }
    }

    Id use = jsonTypeInfo.get().use();
    As include = jsonTypeInfo.get().include();
    String propertyName = jsonTypeInfo.get().property().isEmpty() ? jsonTypeInfo.get().use().getDefaultPropertyName() : jsonTypeInfo
            .get().property();

    Optional<JsonSubTypes> typeSubTypes = findFirstEncounteredAnnotationsOnAllHierarchy( configuration, type, JsonSubTypes.class );

    // TODO we could do better, we actually extract metadata twice for a lot of classes
    ImmutableMap<JClassType, String> classToSerializationMetadata = extractMetadata( logger, configuration, type, jsonTypeInfo,
            propertySubTypes, typeSubTypes, CreatorUtils
                    .filterSubtypesForSerialization( logger, configuration, type ) );
    ImmutableMap<JClassType, String> classToDeserializationMetadata = extractMetadata( logger, configuration, type, jsonTypeInfo,
            propertySubTypes, typeSubTypes, CreatorUtils
                    .filterSubtypesForDeserialization( logger, configuration, type ) );

    return Optional.of(
            new BeanTypeInfo( use, include, propertyName, classToSerializationMetadata, classToDeserializationMetadata ) );
}
 
Example #3
Source File: ExecutionActionRequest.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@JsonTypeInfo(use = Id.CLASS, defaultImpl = RestVariable.class)
public List<RestVariable> getTransientVariables() {
    return transientVariables;
}
 
Example #4
Source File: HistoricVariableInstanceQueryRequest.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@JsonTypeInfo(use = Id.CLASS, defaultImpl = QueryVariable.class)
public List<QueryVariable> getVariables() {
    return variables;
}
 
Example #5
Source File: ExecutionQueryRequest.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@JsonTypeInfo(use = Id.CLASS, defaultImpl = QueryVariable.class)
public void setProcessInstanceVariables(List<QueryVariable> processInstanceVariables) {
    this.processInstanceVariables = processInstanceVariables;
}
 
Example #6
Source File: TaskActionRequest.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@ApiModelProperty(value = "If action is complete, you can use this parameter to set variables ")
@JsonTypeInfo(use = Id.CLASS, defaultImpl = RestVariable.class)
public List<RestVariable> getVariables() {
    return variables;
}
 
Example #7
Source File: TaskQueryRequest.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@JsonTypeInfo(use = Id.CLASS, defaultImpl = QueryVariable.class)
public List<QueryVariable> getProcessInstanceVariables() {
    return processInstanceVariables;
}
 
Example #8
Source File: TaskActionRequest.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@ApiModelProperty(value = "If action is complete, you can use this parameter to set variables ")
@JsonTypeInfo(use = Id.CLASS, defaultImpl = RestVariable.class)
public List<RestVariable> getVariables() {
    return variables;
}
 
Example #9
Source File: TaskActionRequest.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@JsonTypeInfo(use = Id.CLASS, defaultImpl = RestVariable.class)
public void setTransientVariables(List<RestVariable> transientVariables) {
    this.transientVariables = transientVariables;
}
 
Example #10
Source File: HistoricProcessInstanceQueryRequest.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@JsonTypeInfo(use = Id.CLASS, defaultImpl = QueryVariable.class)
public List<QueryVariable> getVariables() {
    return variables;
}
 
Example #11
Source File: ConfiguredBean.java    From logsniffer with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public Id getMechanism() {
	return Id.NAME;
}
 
Example #12
Source File: NodeTypeResolver.java    From depgraph-maven-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public Id getMechanism() {
  return Id.CUSTOM;
}
 
Example #13
Source File: NodeTypeResolverTest.java    From depgraph-maven-plugin with Apache License 2.0 4 votes vote down vote up
@Test
void getMechanism() {
  assertEquals(Id.CUSTOM, this.resolver.getMechanism());
}
 
Example #14
Source File: RegisteredClassIdResolver.java    From dawnsci with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public Id getMechanism() { return Id.CUSTOM; }
 
Example #15
Source File: TypeIdResolverStructure.java    From tutorials with MIT License 4 votes vote down vote up
@Override
public Id getMechanism() {
    return Id.NAME;
}
 
Example #16
Source File: HistoricTaskInstanceQueryRequest.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@JsonTypeInfo(use = Id.CLASS, defaultImpl = QueryVariable.class)
public List<QueryVariable> getProcessVariables() {
    return processVariables;
}
 
Example #17
Source File: ExecutionQueryRequest.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@JsonTypeInfo(use = Id.CLASS, defaultImpl = QueryVariable.class)
public List<QueryVariable> getVariables() {
    return variables;
}
 
Example #18
Source File: TaskQueryRequest.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@JsonTypeInfo(use = Id.CLASS, defaultImpl = QueryVariable.class)
public List<QueryVariable> getTaskVariables() {
    return taskVariables;
}
 
Example #19
Source File: ExecutionActionRequest.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@JsonTypeInfo(use = Id.CLASS, defaultImpl = RestVariable.class)
public List<RestVariable> getVariables() {
    return variables;
}
 
Example #20
Source File: ProcessInstanceCreateRequest.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@JsonTypeInfo(use = Id.CLASS, defaultImpl = RestVariable.class)
public List<RestVariable> getStartFormVariables() {
    return startFormVariables;
}
 
Example #21
Source File: ProcessInstanceCreateRequest.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@JsonTypeInfo(use = Id.CLASS, defaultImpl = RestVariable.class)
public List<RestVariable> getTransientVariables() {
    return transientVariables;
}
 
Example #22
Source File: ProcessInstanceCreateRequest.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@JsonTypeInfo(use = Id.CLASS, defaultImpl = RestVariable.class)
public List<RestVariable> getVariables() {
    return variables;
}
 
Example #23
Source File: SignalEventReceivedRequest.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@JsonTypeInfo(use = Id.CLASS, defaultImpl = RestVariable.class)
@ApiModelProperty(value = "Array of variables (in the general variables format) to use as payload to pass along with the signal. Cannot be used in case async is set to true, this will result in an error.")
public List<RestVariable> getVariables() {
    return variables;
}
 
Example #24
Source File: ProcessInstanceQueryRequest.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@JsonTypeInfo(use = Id.CLASS, defaultImpl = QueryVariable.class)
public List<QueryVariable> getVariables() {
    return variables;
}
 
Example #25
Source File: SubmitFormRequest.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@JsonTypeInfo(use = Id.CLASS, defaultImpl = RestFormProperty.class)
public List<RestFormProperty> getProperties() {
    return properties;
}
 
Example #26
Source File: HistoricTaskInstanceQueryRequest.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@JsonTypeInfo(use = Id.CLASS, defaultImpl = QueryVariable.class)
public List<QueryVariable> getTaskVariables() {
    return taskVariables;
}
 
Example #27
Source File: HistoricCaseInstanceQueryRequest.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@JsonTypeInfo(use = Id.CLASS, defaultImpl = QueryVariable.class)
public List<QueryVariable> getVariables() {
    return variables;
}
 
Example #28
Source File: HistoricVariableInstanceQueryRequest.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@JsonTypeInfo(use = Id.CLASS, defaultImpl = QueryVariable.class)
public List<QueryVariable> getVariables() {
    return variables;
}
 
Example #29
Source File: TaskActionRequest.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@JsonTypeInfo(use = Id.CLASS, defaultImpl = RestVariable.class)
public void setTransientVariables(List<RestVariable> transientVariables) {
    this.transientVariables = transientVariables;
}
 
Example #30
Source File: DestinationTypeIdResolver.java    From data-highway with Apache License 2.0 4 votes vote down vote up
@Override
public Id getMechanism() {
  return Id.CUSTOM;
}