private static boolean validateWildcardSerializable(MetaClass mc) { if (mc.isInterface() || (mc.isAbstract() && !mc.isEnum())) { log.debug("Serializable types cannot be an interface or abstract, ignoring: {}", mc.getFullyQualifiedName()); return false; } return true; }
private static boolean validateWildcardSerializable(MetaClass mc) { if (mc.isInterface() || (mc.isAbstract() && !mc.isEnum())) { log.debug("Serializable types cannot be an interface or abstract, ignoring: {}", mc.getFullyQualifiedName()); return false; } return true; }
private static boolean validateWildcard(MetaClass bindable) { if (bindable.isInterface()) { log.debug("@Bindable types cannot be an interface, ignoring: {}", bindable.getFullyQualifiedName()); return false; } else if (bindable.isAbstract()) { log.debug("@Bindable types cannot be abstract, ignoring: {}", bindable.getFullyQualifiedName()); return false; } else if (bindable.isFinal()) { log.debug("@Bindable types cannot be final, ignoring: {}", bindable.getFullyQualifiedName()); return false; } return true; } }
private static boolean validateWildcard(MetaClass bindable) { if (bindable.isInterface()) { log.debug("@Bindable types cannot be an interface, ignoring: {}", bindable.getFullyQualifiedName()); return false; } else if (bindable.isAbstract()) { log.debug("@Bindable types cannot be abstract, ignoring: {}", bindable.getFullyQualifiedName()); return false; } else if (bindable.isFinal()) { log.debug("@Bindable types cannot be final, ignoring: {}", bindable.getFullyQualifiedName()); return false; } return true; } }
@Override public boolean shouldUseObjectMarshaller(final MetaClass type) { final boolean hasPortableSubtypes = inheritanceMap.containsKey(type.getFullyQualifiedName()); final MappingDefinition definition = getDefinition(type); final boolean hasMarshaller = definition != null; if (hasMarshaller) { if (definition.getClass().isAnnotationPresent(CustomMapping.class) || definition.getClientMarshallerClass() != null) { return false; } } final boolean isConcrete = !(type.isAbstract() || type.isInterface()); if (!type.isArray() && !type.isEnum() && !isConcrete && !hasPortableSubtypes) { throw new IllegalStateException("A field of type " + type + " appears in a portable class, but " + type + " has no portable implementations."); } return (hasPortableSubtypes && !hasMarshaller) || (hasPortableSubtypes && hasMarshaller && isConcrete); }
@Override public boolean shouldUseObjectMarshaller(final MetaClass type) { final boolean hasPortableSubtypes = inheritanceMap.containsKey(type.getFullyQualifiedName()); final MappingDefinition definition = getDefinition(type); final boolean hasMarshaller = definition != null; if (hasMarshaller) { if (definition.getClass().isAnnotationPresent(CustomMapping.class) || definition.getClientMarshallerClass() != null) { return false; } } final boolean isConcrete = !(type.isAbstract() || type.isInterface()); if (!type.isArray() && !type.isEnum() && !isConcrete && !hasPortableSubtypes) { throw new IllegalStateException("A field of type " + type + " appears in a portable class, but " + type + " has no portable implementations."); } return (hasPortableSubtypes && !hasMarshaller) || (hasPortableSubtypes && hasMarshaller && isConcrete); }
if (!metaClass.isAbstract() && metaClass.isAssignableTo(ClientExceptionMapper.class)) { MapsFrom mapsFrom = metaClass.getAnnotation(MapsFrom.class); if (mapsFrom == null) {
public boolean isConcrete() { return !isInterface() && !isAbstract() && !isSynthetic() && !isAnonymousClass() && !isPrimitive() && !isArray() && !isAnnotation() && !isEnum(); }
public boolean isConcrete() { return !isInterface() && !isAbstract() && !isSynthetic() && !isAnonymousClass() && !isPrimitive() && !isArray() && !isAnnotation() && !isEnum(); }
if ((toMap.isAbstract() || toMap.isInterface()) && !toMap.isEnum()) { throw new RuntimeException("cannot map an abstract class or interface: " + toMap.getFullyQualifiedName());
if (extendsBlock == null && (type.isAbstract() || type.isInterface() || type.isPrimitive())) throw new InvalidTypeException("Cannot instantiate type:" + type, blame);
if (extendsBlock == null && (type.isAbstract() || type.isInterface() || type.isPrimitive())) throw new InvalidTypeException("Cannot instantiate type:" + type, blame);
public static MappingDefinition map(final MetaClass toMap, final DefinitionsFactory definitionsFactory) { if ((toMap.isAbstract() && !toMap.isEnum()) || toMap.isInterface()) { throw new RuntimeException("cannot marshal an abstract class or interface: " + toMap.getFullyQualifiedName()); final MetaClass compType = type.isArray() ? type.getOuterComponentType().asBoxed() : type.asBoxed(); if (!(compType.isAbstract() || compType.isInterface() || compType.isEnum()) && !definitionsFactory.isExposedClass(compType)) { throw new InvalidMappingException("portable entity " + toMap.getFullyQualifiedName() + " contains a field (" + field.getName() + ") that is not known to the marshaller framework: "
public static MappingDefinition map(final MetaClass toMap, final DefinitionsFactory definitionsFactory) { if ((toMap.isAbstract() && !toMap.isEnum()) || toMap.isInterface()) { throw new RuntimeException("cannot marshal an abstract class or interface: " + toMap.getFullyQualifiedName()); final MetaClass compType = type.isArray() ? type.getOuterComponentType().asBoxed() : type.asBoxed(); if (!(compType.isAbstract() || compType.isInterface() || compType.isEnum()) && !definitionsFactory.isExposedClass(compType)) { throw new InvalidMappingException("portable entity " + toMap.getFullyQualifiedName() + " contains a field (" + field.getName() + ") that is not known to the marshaller framework: "
buildMetaClass.setAbstract(clazz.isAbstract()); buildMetaClass.setFinal(clazz.isFinal()); buildMetaClass.setStatic(clazz.isStatic());
buildMetaClass.setAbstract(clazz.isAbstract()); buildMetaClass.setFinal(clazz.isFinal()); buildMetaClass.setStatic(clazz.isStatic());
loadVariable(targetVar).invoke(readMethod))); if ((type.isInterface() || type.isAbstract()) && (type.isAssignableTo(List.class) || type.isAssignableTo(Set.class))) { final MetaClass clazz = (type.isAssignableTo(Set.class)) if (!type.isInterface() && !type.isAbstract()) { colBlock.append(Stmt.declareFinalVariable(colVarName, type.getErased(), Stmt.newObject(type.getErased())));
loadVariable(targetVar).invoke(readMethod))); if ((type.isInterface() || type.isAbstract()) && (type.isAssignableTo(List.class) || type.isAssignableTo(Set.class))) { final MetaClass clazz = (type.isAssignableTo(Set.class)) if (!type.isInterface() && !type.isAbstract()) { colBlock.append(Stmt.declareFinalVariable(colVarName, type.getErased(), Stmt.newObject(type.getErased())));
targetType.isArray() ? targetType.getOuterComponentType().asBoxed() : targetType.asBoxed(); if (!(compType.isAbstract() || compType.isInterface() || compType.isEnum()) && !context.canMarshal(compType.getFullyQualifiedName())) { throw new NoAvailableMarshallerException(compType.getFullyQualifiedName());
targetType.isArray() ? targetType.getOuterComponentType().asBoxed() : targetType.asBoxed(); if (!(compType.isAbstract() || compType.isInterface() || compType.isEnum()) && !context.canMarshal(compType.getFullyQualifiedName())) { throw new NoAvailableMarshallerException(compType.getFullyQualifiedName());