@JsonApiResource(type = "meta/mapType") public class MetaMapType extends MetaType { @JsonApiRelation(serialize=SerializeType.LAZY) private MetaType keyType; public MetaType getKeyType() { return keyType; } public void setKeyType(MetaType keyType) { this.keyType = keyType; } }
public static LookupIncludeBehavior getLookupIncludeBehavior(Collection<Annotation> annotations, LookupIncludeBehavior defaultBehavior) { for (Annotation annotation : annotations) { if (annotation instanceof JsonApiRelation) { JsonApiRelation jsonApiRelation = (JsonApiRelation) annotation; return jsonApiRelation.lookUp(); } if (annotation instanceof JsonApiLookupIncludeAutomatically) { JsonApiLookupIncludeAutomatically includeAnnotation = (JsonApiLookupIncludeAutomatically) annotation; if (includeAnnotation.overwrite()) return LookupIncludeBehavior.AUTOMATICALLY_ALWAYS; else return LookupIncludeBehavior.AUTOMATICALLY_WHEN_NULL; } } return defaultBehavior; }
public static boolean getIncludeByDefault(Collection<Annotation> annotations) { for (Annotation annotation : annotations) { if (annotation instanceof JsonApiRelation) { JsonApiRelation jsonApiRelation = (JsonApiRelation) annotation; return jsonApiRelation.serialize() == SerializeType.EAGER; } if (annotation instanceof JsonApiIncludeByDefault) { return true; } } return false; }
private static String getOppositeName(List<Annotation> annotations) { for (Annotation annotation : annotations) { if (annotation instanceof JsonApiToMany) { return StringUtils.emptyToNull(((JsonApiToMany) annotation).opposite()); } if (annotation instanceof JsonApiToOne) { return StringUtils.emptyToNull(((JsonApiToOne) annotation).opposite()); } if (annotation instanceof JsonApiRelation) { return StringUtils.emptyToNull(((JsonApiRelation) annotation).opposite()); } } return null; }
private Type implementationType; @JsonApiRelation(serialize=SerializeType.LAZY) private MetaType elementType;
@JsonApiResource(type = "meta/attribute") public class MetaAttribute extends MetaElement { @JsonApiRelation(serialize=SerializeType.LAZY) private MetaType type; @JsonApiRelation(serialize=SerializeType.LAZY) private MetaAttribute oppositeAttribute;
@JsonApiRelation(serialize=SerializeType.LAZY, opposite = "children") private MetaElement parent;
private Set<MetaDataObject> subTypes = new HashSet<>(); @JsonApiRelation(serialize=SerializeType.LAZY,opposite = "subTypes") private MetaDataObject superType; private List<MetaDataObject>[] subTypesCache = new List[4]; @JsonApiRelation(serialize=SerializeType.LAZY) private MetaPrimaryKey primaryKey;