本文整理匯總了Java中org.codehaus.jackson.annotate.JsonTypeInfo類的典型用法代碼示例。如果您正苦於以下問題:Java JsonTypeInfo類的具體用法?Java JsonTypeInfo怎麽用?Java JsonTypeInfo使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
JsonTypeInfo類屬於org.codehaus.jackson.annotate包,在下文中一共展示了JsonTypeInfo類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
import org.codehaus.jackson.annotate.JsonTypeInfo; //導入依賴的package包/類
/**
* Inits the.
*/
@Validate
public void init() {
ObjectMapper mapper = new ObjectMapper();
mapper.enableDefaultTyping(
ObjectMapper.DefaultTyping.OBJECT_AND_NON_CONCRETE,
JsonTypeInfo.As.PROPERTY);
DeserializerProvider p = mapper.getDeserializerProvider();
// mapper.setPropertyNamingStrategy(new
// DotNetTollerantNamingStrategy());
mapper.setDeserializerProvider(p);
setMapper(mapper);
}
示例2: init
import org.codehaus.jackson.annotate.JsonTypeInfo; //導入依賴的package包/類
public StdTypeResolverBuilder init(JsonTypeInfo.Id idType, TypeIdResolver idRes)
{
// sanity checks
if (idType == null) {
throw new IllegalArgumentException("idType can not be null");
}
_idType = idType;
_customIdResolver = idRes;
// Let's also initialize property name as per idType default
_typeProperty = idType.getDefaultPropertyName();
return this;
}
示例3: inclusion
import org.codehaus.jackson.annotate.JsonTypeInfo; //導入依賴的package包/類
public StdTypeResolverBuilder inclusion(JsonTypeInfo.As includeAs) {
if (includeAs == null) {
throw new IllegalArgumentException("includeAs can not be null");
}
_includeAs = includeAs;
return this;
}
示例4: enableDefaultTyping
import org.codehaus.jackson.annotate.JsonTypeInfo; //導入依賴的package包/類
public ObjectMapper enableDefaultTyping(DefaultTyping dti, JsonTypeInfo.As includeAs)
{
TypeResolverBuilder<?> typer = new DefaultTypeResolverBuilder(dti);
// we'll always use full class name, when using defaulting
typer = typer.init(JsonTypeInfo.Id.CLASS, null);
typer = typer.inclusion(includeAs);
return setDefaltTyping(typer);
}
示例5: getProcessResultList
import org.codehaus.jackson.annotate.JsonTypeInfo; //導入依賴的package包/類
@Override
@XmlElementWrapper
@XmlElementRefs({
@XmlElementRef(type = org.tanaguru.entity.audit.IndefiniteResultImpl.class),
@XmlElementRef(type = org.tanaguru.entity.audit.DefiniteResultImpl.class)})
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes({
@JsonSubTypes.Type(value=org.tanaguru.entity.audit.IndefiniteResultImpl.class, name="Indefinite"),
@JsonSubTypes.Type(value=org.tanaguru.entity.audit.DefiniteResultImpl.class, name="Definite")})
public Collection<ProcessResult> getProcessResultList() {
return (Collection)processResultSet;
}
示例6: getSubject
import org.codehaus.jackson.annotate.JsonTypeInfo; //導入依賴的package包/類
@Override
@XmlElementRefs({
@XmlElementRef(type = org.tanaguru.entity.subject.PageImpl.class),
@XmlElementRef(type = org.tanaguru.entity.subject.SiteImpl.class)})
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=As.WRAPPER_OBJECT)
@JsonSubTypes({
@JsonSubTypes.Type(value=org.tanaguru.entity.subject.PageImpl.class, name="Page"),
@JsonSubTypes.Type(value=org.tanaguru.entity.subject.SiteImpl.class, name="Site")})
public WebResourceImpl getSubject() {
return subject;
}
示例7: getParameterSet
import org.codehaus.jackson.annotate.JsonTypeInfo; //導入依賴的package包/類
@Override
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=As.WRAPPER_OBJECT)
@JsonSubTypes({
@JsonSubTypes.Type(value=org.tanaguru.entity.parameterization.ParameterImpl.class, name="Parameter")})
public Collection<Parameter> getParameterSet() {
if (this.parameterSet == null) {
this.parameterSet = new HashSet<>();
}
return (Collection)parameterSet;
}
示例8: getElementList
import org.codehaus.jackson.annotate.JsonTypeInfo; //導入依賴的package包/類
@Override
@XmlElementWrapper
@XmlElementRefs({
@XmlElementRef(type = org.tanaguru.entity.audit.EvidenceElementImpl.class)})
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes({
@JsonSubTypes.Type(value=org.tanaguru.entity.audit.EvidenceElementImpl.class, name="EvidenceElement")})
public Collection<EvidenceElement> getElementList() {
return (Collection)elementSet;
}
示例9: getRemarkSet
import org.codehaus.jackson.annotate.JsonTypeInfo; //導入依賴的package包/類
@Override
@XmlElementWrapper
@XmlElementRefs({
@XmlElementRef(type = org.tanaguru.entity.audit.ProcessRemarkImpl.class),
@XmlElementRef(type = org.tanaguru.entity.audit.SourceCodeRemarkImpl.class)})
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes({
@JsonSubTypes.Type(value=org.tanaguru.entity.audit.ProcessRemarkImpl.class, name="ProcessRemark"),
@JsonSubTypes.Type(value=org.tanaguru.entity.audit.SourceCodeRemarkImpl.class, name="SourceCodeRemark")})
// @Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED)
public Collection<ProcessRemark> getRemarkSet() {
return (Collection)remarkSet;
}
示例10: getTest
import org.codehaus.jackson.annotate.JsonTypeInfo; //導入依賴的package包/類
@Override
@XmlElementRef(type = org.tanaguru.entity.reference.TestImpl.class)
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes({
@JsonSubTypes.Type(value=org.tanaguru.entity.reference.TestImpl.class, name="Test")})
public Test getTest() {
return test;
}
示例11: getEvidence
import org.codehaus.jackson.annotate.JsonTypeInfo; //導入依賴的package包/類
@XmlTransient
@Override
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes({
@JsonSubTypes.Type(value=org.tanaguru.entity.audit.EvidenceImpl.class, name="Evidence")})
public Evidence getEvidence() {
return (Evidence) evidence;
}
示例12: getValue
import org.codehaus.jackson.annotate.JsonTypeInfo; //導入依賴的package包/類
@Override
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes({
@JsonSubTypes.Type(value=org.tanaguru.entity.audit.TestSolution.class, name="TestSolution")})
public Object getValue() {
return getDefiniteValue();
}
示例13: setParameterElement
import org.codehaus.jackson.annotate.JsonTypeInfo; //導入依賴的package包/類
@Override
@XmlElementWrapper
@XmlElementRef(type = org.tanaguru.entity.parameterization.ParameterElementImpl.class)
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes({
@JsonSubTypes.Type(value=org.tanaguru.entity.parameterization.ParameterElementImpl.class, name="ParameterElement")})
public void setParameterElement(ParameterElement parameterElement) {
this.parameterElement = (ParameterElementImpl)parameterElement;
}
示例14: setParameterFamily
import org.codehaus.jackson.annotate.JsonTypeInfo; //導入依賴的package包/類
@Override
@XmlElementWrapper
@XmlElementRef(type = org.tanaguru.entity.parameterization.ParameterFamilyImpl.class)
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes({
@JsonSubTypes.Type(value=org.tanaguru.entity.parameterization.ParameterFamilyImpl.class, name="ParameterFamily")})
public void setParameterFamily(ParameterFamily parameterFamily) {
this.parameterFamily = (ParameterFamilyImpl)parameterFamily;
}
示例15: getCriterion
import org.codehaus.jackson.annotate.JsonTypeInfo; //導入依賴的package包/類
@Override
@XmlElementRef(type = org.tanaguru.entity.reference.CriterionImpl.class)
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes({
@JsonSubTypes.Type(value = org.tanaguru.entity.reference.CriterionImpl.class, name = "Criterion")})
public Criterion getCriterion() {
return this.criterion;
}