protected String getStyle(JvmGenericType type) { if (type.isInterface()) { return INTERFACE; } else if (type.isAbstract()) { return ABSTRACT_CLASS; } else { return CLASS; } }
/** Replies if the given JVM element is a SARL skill. * * @param type the JVM type to test. * @return {@code true} if the given type is a SARL skill, or not. * @since 0.6 */ public boolean isSarlSkill(JvmGenericType type) { return !type.isInterface() && getSarlElementEcoreType(type) == SarlPackage.SARL_SKILL; }
/** Replies if the given JVM element is a SARL behavior. * * @param type the JVM type to test. * @return {@code true} if the given type is a SARL behavior, or not. * @since 0.6 */ public boolean isSarlBehavior(JvmGenericType type) { return !type.isInterface() && getSarlElementEcoreType(type) == SarlPackage.SARL_BEHAVIOR; }
/** Replies if the given JVM element is a SARL capacity. * * @param type the JVM type to test. * @return {@code true} if the given type is a SARL capacity, or not. * @since 0.6 */ public boolean isSarlCapacity(JvmGenericType type) { return type.isInterface() && getSarlElementEcoreType(type) == SarlPackage.SARL_CAPACITY; }
/** Replies if the given reference is pointing to a class type. * * @param typeRef - the type reference to test. * @return <code>true</code> if the pointed element is a class type. */ public static boolean isClass(LightweightTypeReference typeRef) { final JvmType t = typeRef.getType(); if (t instanceof JvmGenericType) { return !((JvmGenericType) t).isInterface(); } return false; }
/** Replies if the given JVM element is a SARL agent. * * @param type the JVM type to test. * @return {@code true} if the given type is a SARL agent, or not. * @since 0.6 */ public boolean isSarlAgent(JvmGenericType type) { return !type.isInterface() && getSarlElementEcoreType(type) == SarlPackage.SARL_AGENT; }
public boolean apply(JvmTypeReference typeReference) { JvmType type = typeReference.getType(); if (type instanceof JvmGenericType) { return ((JvmGenericType) type).isInterface(); } return false; } });
/** Replies if the given JVM element is a SARL event. * * @param type the JVM type to test. * @return {@code true} if the given type is a SARL event, or not. * @since 0.6 */ public boolean isSarlEvent(JvmGenericType type) { return !type.isInterface() && getSarlElementEcoreType(type) == SarlPackage.SARL_EVENT; }
@Override public boolean isInterfaceType() { return type.eClass() == TypesPackage.Literals.JVM_GENERIC_TYPE && ((JvmGenericType) type).isInterface(); }
public JvmTypeReference getExtendedClass(JvmDeclaredType type) { for(JvmTypeReference candidate: type.getSuperTypes()) { JvmType candidateType = candidate.getType(); if (candidateType instanceof JvmGenericType && !((JvmGenericType) candidateType).isInterface()) return candidate; } return null; }
@Override public boolean apply(JvmTypeReference typeReference) { JvmType type = typeReference.getType(); if (type != null && type.eClass() == TypesPackage.Literals.JVM_GENERIC_TYPE) { return ((JvmGenericType) type).isInterface(); } return false; } });
protected boolean isClass(JvmType type) { if (type instanceof JvmArrayType) return isClass(((JvmArrayType) type).getComponentType()); return type instanceof JvmGenericType && !((JvmGenericType) type).isInterface(); }
/** Replies if the given type is an interface. * * @param type - the type to test. * @return <code>true</code> if the given type is an interface. */ public static boolean isInterface(LightweightTypeReference type) { return type.getType() instanceof JvmGenericType && ((JvmGenericType) type.getType()).isInterface(); }
private boolean isClass(LightweightTypeReference typeRef) { return typeRef.getType() instanceof JvmGenericType && !((JvmGenericType)typeRef.getType()).isInterface(); }
/** Append the serial number field if and only if the container type is serializable. * * <p>The serial number field is computed from the given context and from the generated fields. * * @param context the current generation context. * @param source the source object. * @param target the inferred JVM object. * @see #appendSerialNumber(GenerationContext, XtendTypeDeclaration, JvmGenericType) */ protected void appendSerialNumberIfSerializable(GenerationContext context, XtendTypeDeclaration source, JvmGenericType target) { if (!target.isInterface() && this.inheritanceHelper.isSubTypeOf(target, Serializable.class, null)) { appendSerialNumber(context, source, target); } }
protected boolean isClass(JvmType type) { EClass eClass = type.eClass(); if (eClass == TypesPackage.Literals.JVM_ARRAY_TYPE) return isClass(((JvmArrayType) type).getComponentType()); return eClass == TypesPackage.Literals.JVM_GENERIC_TYPE && !((JvmGenericType) type).isInterface(); }
@Override public JvmTypeReference getExtendedClass() { for(JvmTypeReference candidate: getSuperTypes()) { if (candidate.getType() instanceof JvmGenericType && !((JvmGenericType) candidate.getType()).isInterface()) return candidate; } return null; }
private boolean isInvalidThisReference(IIdentifiableElementDescription desc) { EObject object = desc.getEObjectOrProxy(); return object instanceof JvmGenericType && ((JvmGenericType) object).isInterface() && IFeatureNames.THIS.equals(desc.getName()); }
@Override public JvmTypeReference getExtendedClass() { for(JvmTypeReference candidate: getSuperTypes()) { if (candidate.getType() instanceof JvmGenericType && !((JvmGenericType) candidate.getType()).isInterface()) return candidate; } return null; }
@Override protected void setTypeModifiers(int accessFlags) { super.setTypeModifiers(accessFlags); if (result.eClass() != TypesPackage.Literals.JVM_GENERIC_TYPE) { result.setStatic(true); } else if (((JvmGenericType) result).isInterface()) { result.setStatic(true); } }