@Override public List<NamedType> findSubtypes(Annotated a) { JsonSubTypes t = a.getAnnotation(JsonSubTypes.class); if (t == null) return null; JsonSubTypes.Type[] types = t.value(); ArrayList<NamedType> result = new ArrayList<NamedType>(types.length); for (JsonSubTypes.Type type : types) { result.add(new NamedType(type.value(), type.name())); } return result; }
@JsonSubTypes({@Type(value=MessageReceived.class), @Type(value=MessageSent.class), @Type(value=RequestReceived.class), @Type(value=RequestSent.class), @Type(value=ResponseReceived.class), @Type(value=ResponseSent.class), @Type(value=ProcessCompleted.class), @Type(value=ProcessStarted.class), @Type(value=ProcessVariableSet.class), @Type(value=CustomActivity.class), @Type(value=LogMessage.class) }) @Entity @IdClass(value=ActivityTypeId.class)
String choiceTypeId = element.name(); if ("".equals(choiceTypeId)) {
@JsonSubTypes({@Type(value=Choice.class), @Type(value=Continue.class), @Type(value=Do.class), @Type(value=Interruptible.class), @Type(value=MessageNode.class), @Type(value=Parallel.class), @Type(value=Receive.class), @Type(value=Recursion.class), @Type(value=Send.class) }) public abstract class Node {
String choiceTypeId = element.name(); if ("".equals(choiceTypeId)) {
try { stack.push(elementUtils.getTypeElement(JsonSubTypes.class.getName())); Class clazz = type.value(); add(createTypeDefinition(elementUtils.getTypeElement(clazz.getName())), stack);
try { stack.push(elementUtils.getTypeElement(JsonSubTypes.class.getName())); Class clazz = type.value(); add(createTypeDefinition(elementUtils.getTypeElement(clazz.getName())), stack);
@JsonSubTypes({ @Type(name = "checkin", value = CheckinPost.class), @Type(name = "link", value = LinkPost.class), @Type(name = "note", value = NotePost.class), @Type(name = "photo", value = PhotoPost.class), @Type(name = "status", value = StatusPost.class), @Type(name = "video", value = VideoPost.class), @Type(name = "post", value = Post.class), @Type(name = "swf", value = SwfPost.class), @Type(name = "music", value = MusicPost.class) }) @JsonIgnoreProperties(ignoreUnknown = true) abstract class PostMixin {
@JsonSubTypes({@Type(value=MVELScriptEvaluator.class, name="mvel") }) public abstract class ScriptEvaluator {
@JsonSubTypes({@Type(value=MonitorRoleSimulator.class) }) public abstract class RoleSimulator {
if (jsonSubTypes != null) { for (JsonSubTypes.Type type : jsonSubTypes.value()) { addBeanToQueue(new SourceType<>(type.value(), sourceClass.type, "<subClass>"));
@JsonSubTypes({@Type(value=MessageTransfer.class)}) public abstract class Step {
private String findSpecifiedTypeInfoValue(Member member, String specifiedType, TypeDefinition type) { if (type == null) { return null; } else if (type.getTypeIdType() == JsonTypeInfo.Id.NAME && member.getSimpleName().toString().equals(type.getTypeIdProperty())) { JsonSubTypes subTypes = type.getAnnotation(JsonSubTypes.class); if (subTypes != null) { for (final JsonSubTypes.Type element : subTypes.value()) { DecoratedTypeMirror choiceType = Annotations.mirrorOf(new Callable<Class<?>>() { @Override public Class<?> call() throws Exception { return element.value(); } }, type.getContext().getContext().getProcessingEnvironment()); if (choiceType.isInstanceOf(specifiedType)) { return element.name(); } } return null; } } JsonType supertype = type instanceof ObjectTypeDefinition ? ((ObjectTypeDefinition)type).getSupertype() : null; if (supertype instanceof JsonClassType) { return findSpecifiedTypeInfoValue(member, specifiedType, ((JsonClassType) supertype).getTypeDefinition()); } return null; }
private String findSpecifiedTypeInfoValue(Member member, String specifiedType, TypeDefinition type) { if (type == null) { return null; } else if (type.getTypeIdType() == JsonTypeInfo.Id.NAME && member.getSimpleName().toString().equals(type.getTypeIdProperty())) { JsonSubTypes subTypes = type.getAnnotation(JsonSubTypes.class); if (subTypes != null) { for (final JsonSubTypes.Type element : subTypes.value()) { DecoratedTypeMirror choiceType = Annotations.mirrorOf(new Callable<Class<?>>() { @Override public Class<?> call() throws Exception { return element.value(); } }, type.getContext().getContext().getProcessingEnvironment()); if (choiceType.isInstanceOf(specifiedType)) { return element.name(); } } return null; } } JsonType supertype = type instanceof ObjectTypeDefinition ? ((ObjectTypeDefinition)type).getSupertype() : null; if (supertype instanceof JsonClassType) { return findSpecifiedTypeInfoValue(member, specifiedType, ((JsonClassType) supertype).getTypeDefinition()); } return null; }