Codota Logo
org.eclipse.xtext.common.types
Code IndexAdd Codota to your IDE (free)

How to use org.eclipse.xtext.common.types

Best Java code snippets using org.eclipse.xtext.common.types (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: org.eclipse.xtext/org.eclipse.xtext.xbase

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;
}

origin: org.eclipse.xtext/org.eclipse.xtext.common.types

  @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;
  }
});
origin: org.eclipse.xtext/org.eclipse.xtext.xbase

private JvmType getTypeForAnnotationValue(JvmOperation value) {
  JvmType expectedType = value.getReturnType().getType();
  if (expectedType instanceof JvmArrayType) {
    expectedType = ((JvmArrayType) expectedType).getComponentType();
  }
  return expectedType;
}
origin: org.eclipse.xtend/org.eclipse.xtend.core

protected String getDeclaratorName(JvmFeature feature) {
  JvmDeclaredType declarator = feature.getDeclaringType();
  if (declarator.isLocal()) {
    return "new " + Iterables.getLast(declarator.getSuperTypes()).getType().getSimpleName()+ "(){}";
  } else {
    return declarator.getSimpleName();
  }
}

origin: org.eclipse.xtext.common/types

  public String getSuperTypeName(JvmTypeReference typeReference) {
    if (typeReference instanceof JvmParameterizedTypeReference) {
      JvmType rawType = typeReference.getType();
      if (rawType != null && !rawType.eIsProxy()) {
        return rawType.getIdentifier();
      }
      return null;
    } else {
      return typeReference.getIdentifier();
    }
  }
});
origin: org.eclipse.xtend/org.eclipse.xtend.core

protected boolean isArrayOfAnnotations(final JvmAnnotationValue annotationValue) {
 final JvmTypeReference returnType = annotationValue.getOperation().getReturnType();
 if ((returnType instanceof JvmGenericArrayTypeReference)) {
  JvmType _type = ((JvmGenericArrayTypeReference)returnType).getComponentType().getType();
  return (_type instanceof JvmAnnotationType);
 }
 return false;
}

origin: org.testeditor/org.testeditor.dsl.common

public Iterable<String> getEnumValues(final JvmTypeReference reference) {
 JvmType _type = reference.getType();
 final JvmEnumerationType enumType = ((JvmEnumerationType) _type);
 final Function1<JvmEnumerationLiteral, String> _function = (JvmEnumerationLiteral it) -> {
  return it.getSimpleName();
 };
 return ListExtensions.<JvmEnumerationLiteral, String>map(enumType.getLiterals(), _function);
}

origin: org.eclipse.xtext.common/types

  public boolean apply(JvmTypeReference typeReference) {
    JvmType type = typeReference.getType();
    if (type instanceof JvmGenericType) {
      return ((JvmGenericType) type).isInterface();
    }
    return false;
  }
});
origin: org.eclipse.xtext.common/types

public static boolean isDeprecated(JvmAnnotationTarget jvmAnnotationTarget) {
  for (JvmAnnotationReference ref : jvmAnnotationTarget.getAnnotations()) {
    if (ref != null && !ref.eIsProxy()) {
      JvmAnnotationType annotation = ref.getAnnotation();
      if(annotation != null && !annotation.eIsProxy() && isDeprecated(annotation))
        return true;
    }
  }
  return false;
}
origin: org.eclipse.xtext/org.eclipse.xtext.xbase

public void completeJvmConstructor(JvmConstructor constructor) {
  JvmDeclaredType declaringType = constructor.getDeclaringType();
  if(declaringType != null) {
    String simpleName = declaringType.getSimpleName();
    if(simpleName != null) {
      constructor.setSimpleName(simpleName);
      return;
    }
  }
  constructor.setSimpleName("unset");
}

origin: org.eclipse.xtext/org.eclipse.xtext.xbase

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();
}

origin: org.eclipse.xtext/org.eclipse.xtext.xbase

protected String getDeclaratorSimpleName(JvmIdentifiableElement element) {
  if (element instanceof JvmConstructor) {
    return null;
  }
  if (element instanceof JvmMember) {
    return ((JvmMember) element).getDeclaringType().getSimpleName();
  }
  return null;
}

origin: org.eclipse.xtext/org.eclipse.xtext.xbase

protected boolean isInner(JvmType type) {
  if (type != null && type.eClass() == TypesPackage.Literals.JVM_GENERIC_TYPE) {
    if (type.eContainer() instanceof JvmDeclaredType) {
      return !((JvmGenericType) type).isStatic();
    }
  }
  return false;
}
origin: org.eclipse.xtext/org.eclipse.xtext.xbase

private JvmTypeReference createUnknownTypeReference(String name) {
  JvmUnknownTypeReference reference = TypesFactory.eINSTANCE.createJvmUnknownTypeReference();
  reference.setQualifiedName(name);
  return reference;
}
origin: org.eclipse.xtext/org.eclipse.xtext.xbase

@Override
public boolean isAnonymous() {
  return type.eClass() == TypesPackage.Literals.JVM_GENERIC_TYPE && ((JvmGenericType) type).isAnonymous();
}
origin: org.eclipse.xtext.common/types

public JvmDelegateTypeReference createDelegateTypeReference(JvmTypeReference typeRef) {
  JvmDelegateTypeReference delegate = factory.createJvmDelegateTypeReference();
  delegate.setDelegate(typeRef);
  return delegate;
}
origin: org.eclipse.xtext/org.eclipse.xtext.xbase

protected boolean isStatic(JvmIdentifiableElement declarator) {
  if (declarator instanceof JvmFeature) {
    return ((JvmFeature) declarator).isStatic();
  }
  if (declarator instanceof JvmDeclaredType) {
    return ((JvmDeclaredType) declarator).isStatic();
  }
  return false;
}
origin: org.eclipse.xtext/org.eclipse.xtext.xbase

protected String getDeclaratorSimpleName(JvmIdentifiableElement element) {
  if (element instanceof JvmConstructor) {
    return null;
  }
  if (element instanceof JvmMember) {
    return ((JvmMember) element).getDeclaringType().getSimpleName();
  }
  return null;
}

origin: org.eclipse.xtext/org.eclipse.xtext.xbase

protected boolean isInner(JvmType type) {
  if (type.eClass() == TypesPackage.Literals.JVM_GENERIC_TYPE) {
    if (type.eContainer() instanceof JvmDeclaredType) {
      return !((JvmGenericType) type).isStatic();
    }
  }
  return false;
}

origin: org.eclipse.xtext.common/types

protected JvmUnknownTypeReference getUnknownTypeReference(String qualifiedName) {
  JvmUnknownTypeReference reference = TypesFactory.eINSTANCE.createJvmUnknownTypeReference();
  reference.setQualifiedName(qualifiedName);
  return reference;
}
org.eclipse.xtext.common.types

Most used classes

  • JvmOperation
  • JvmDeclaredType
    A representation of the model object 'Jvm Declared Type'. The following features are supported: *
  • JvmTypeReference
  • JvmGenericType
  • JvmType
  • JvmFormalParameter,
  • JvmConstructor,
  • JvmParameterizedTypeReference,
  • TypesPackage,
  • TypeReferences,
  • TypesFactory,
  • JvmAnnotationReference,
  • JvmAnnotationType,
  • JvmIdentifiableElement,
  • Primitives,
  • JvmEnumerationLiteral,
  • JvmEnumerationType,
  • JvmMember,
  • JvmAnnotationValue
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now