Examples of IType


Examples of org.eclipse.jdt.core.IType

     * @param javaElement
     * @return simply element name
     */
    public static String getElementName(IJavaElement javaElement) {
        if (isAnonymousType(javaElement)) {
            IType anonType = (IType) javaElement;
            List allAnonymous = new ArrayList();
            /*
             * in order to resolve anon. class name we need to know about all other
             * anonymous classes in declaring class, therefore we need to collect all here
             */
 
View Full Code Here

Examples of org.eclipse.jdt.core.IType

                       exception on classFile.isInterface() call.
                    }*/
                    break;
                case IJavaElement.COMPILATION_UNIT :
                    ICompilationUnit cUnit = (ICompilationUnit) javaEl;
                    IType type = cUnit.findPrimaryType();
                    abstractOrInterface = type != null && type.isInterface();
                    break;
                case IJavaElement.TYPE :
                    abstractOrInterface = ((IType) javaEl).isInterface();
                    break;
                case IJavaElement.METHOD :
                    // test for "abstract" flag on method in a class
                    abstractOrInterface = Flags.isAbstract(((IMethod) javaEl)
                        .getFlags());
                    // "abstract" flags could be not exist on interface methods
                    if (!abstractOrInterface) {
                        IType ancestor = (IType) javaEl
                            .getAncestor(IJavaElement.TYPE);
                        abstractOrInterface = ancestor != null
                            && ancestor.isInterface();
                    }
                    break;
                default :
                    IType ancestor1 = (IType) javaEl
                        .getAncestor(IJavaElement.TYPE);
                    abstractOrInterface = ancestor1 != null
                        && ancestor1.isInterface();
                    break;
            }
        } catch (JavaModelException e) {
            // No point to log it here
            // BytecodeOutlinePlugin.log(e, IStatus.ERROR);
View Full Code Here

Examples of org.eclipse.jdt.core.IType

     * @return non public class (local type class) with the name from "debugType" and
     * which source was in the "parent" class. Null if no class file could be found.
     */
    private static IClassFile getLocalTypeClass(IJavaReferenceType debugType, IClassFile parent) {
        try {
            IType type = parent.getType();
            if((type.isLocal()) || (type.isMember())) {
                // local type could not be defined in local or inner classes
                return null;
            }
            // debugType.getSignature() == Lpackage/name/with/slashes/className;
            String binarySignature = debugType.getSignature();
            // get only type name from binary signature
            int idx = binarySignature.lastIndexOf('/');
            if(idx > 0 && idx < binarySignature.length() - 1){
                String name = binarySignature.substring(idx + 1);
                if(name.charAt(name.length() - 1) == ';'){
                    name = name.substring(0, name.length() - 1);
                }
                return type.getPackageFragment().getClassFile(name + ".class");
            }
        } catch (Exception e) {
            BytecodeOutlinePlugin.log(e, IStatus.ERROR);
        }
        return null;
View Full Code Here

Examples of org.eclipse.jdt.core.IType

         * @param o1 should be IType
         * @param o2 should be IType
         * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
         */
        public int compare(Object o1, Object o2) {
            IType m1 = (IType) o1;
            IType m2 = (IType) o2;
            int idx1, idx2;
            try {
                ISourceRange sr1 = m1.getSourceRange();
                ISourceRange sr2 = m2.getSourceRange();
                if (sr1 == null || sr2 == null) {
                    return 0;
                }
                idx1 = sr1.getOffset();
                idx2 = sr2.getOffset();
View Full Code Here

Examples of org.eclipse.jdt.core.IType

         */
        public int compare(Object o1, Object o2) {
            if(o1 == o2){
                return 0;
            }
            IType m1 = (IType) o1;
            IType m2 = (IType) o2;
            if(is50OrHigher){
                return compare50(m1, m2);
            }

            IJavaElement firstAncestor1 = getFirstAncestor(m1);
View Full Code Here

Examples of org.eclipse.jdt.core.IType

            + File.separator;

        String fieldName = getFieldName();
        IType[] allTypes = getAllTypes(cu);
        for (int i = 0; i < allTypes.length; i++) {
            IType type = allTypes[i];
            IField field = type.getField(fieldName);
            if (field == null) {
                continue;
            }
            String constant = (String) field.getConstant();
            if(constant != null){
View Full Code Here

Examples of org.eclipse.jst.jsf.metadataprocessors.IType

  }


  private boolean canCreateTypeForFeatureExtension(IMetaDataEnabledFeatureExtension feature) {
    if (! typeCacheMap.containsKey(feature.getTypeID())){
      IType type = AttributeValueRuntimeTypeRegistry.getInstance().getType(feature.getTypeID());
      if (type != null){
        Class typeClass = AttributeValueRuntimeTypeFactory.getInstance().getClassForType(type);
        typeCacheMap.put(feature.getTypeID(), typeClass);
      }
      else
View Full Code Here

Examples of org.eclipse.persistence.jpa.jpql.spi.IType

    /**
     * {@inheritDoc}
     */
    @Override
    public final void visit(CaseExpression expression) {
      IType type = getType(expression);
      valid = isRightType(type);
    }
View Full Code Here

Examples of org.eclipse.persistence.jpa.jpql.tools.spi.IType

        return true;
      }

      // Determine if it's assignable to the desired type
      IType mappingType = value.getType();
      mappingType = queryContext.getTypeHelper().convertPrimitive(mappingType);
      return mappingType.isAssignableTo(type);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.