Package org.reflections

Examples of org.reflections.ReflectionsException


    public void scan(Vfs.File file) {
        try {
            Object cls = getMetadataAdapter().getOfCreateClassObject(file);
            scan(cls, file);
        } catch (Exception e) {
            throw new ReflectionsException("could not create class file from " + file.getName(), e);
        }
    }
View Full Code Here


        try {
            inputStream = file.openInputStream();
            DataInputStream dis = new DataInputStream(new BufferedInputStream(inputStream));
            return new ClassFile(dis);
        } catch (IOException e) {
            throw new ReflectionsException("could not create class file from " + file.getName(), e);
        } finally {
            Utils.close(inputStream);
        }
    }
View Full Code Here

                return null; //todo add support
            } else {
                return aClass.getDeclaredMethod(methodName, parameterTypes);
            }
        } catch (NoSuchMethodException e) {
            throw new ReflectionsException("Can't resolve method named " + methodName, e);
        }
    }
View Full Code Here

        String fieldName = field.substring(field.lastIndexOf('.') + 1);

        try {
            return ReflectionUtils.forName(className, classLoaders).getDeclaredField(fieldName);
        } catch (NoSuchFieldException e) {
            throw new ReflectionsException("Can't resolve field named " + fieldName, e);
        }
    }
View Full Code Here

      public Vfs.Dir createDir(URL url) {
        VirtualFile content;
        try {
          content = (VirtualFile) url.openConnection().getContent();
        } catch (Throwable e) {
          throw new ReflectionsException(
              "could not open url connection as VirtualFile ["
                  + url + "]", e);
        }

        Vfs.Dir dir = null;
View Full Code Here

        for (UrlType type : urlTypes) {
            if (type.matches(url)) {
                try {
                    return type.createDir(url);
                } catch (Exception e) {
                    throw new ReflectionsException("could not create Dir using " + type.getClass().getName() +" from url " + url.toExternalForm());
                }
            }
        }

        throw new ReflectionsException("could not create Vfs.Dir from url, no matching UrlType was found [" + url.toExternalForm() + "]\n" +
                "either use fromURL(final URL url, final List<UrlType> urlTypes) or " +
                "use the static setDefaultURLTypes(final List<UrlType> urlTypes) or addDefaultURLTypes(UrlType urlType) " +
                "with your specialized UrlType.");
    }
View Full Code Here

                return null; //todo add support
            } else {
                return aClass.getMethod(methodName, parameterTypes);
            }
        } catch (NoSuchMethodException e) {
            throw new ReflectionsException("Can't resolve method named " + methodName, e);
        }
    }
View Full Code Here

        String fieldName = field.substring(field.lastIndexOf('.') + 1);

        try {
            return forName(className).getDeclaredField(fieldName);
        } catch (NoSuchFieldException e) {
            throw new ReflectionsException("Can't resolve field named " + fieldName, e);
        }
    }
View Full Code Here

            try {
                if (inputStream != null) {
                    inputStream.close();
                }
            } catch (IOException e) {
                throw new ReflectionsException("could not close input stream", e);
            }
        }
    }
View Full Code Here

    public static Class<?> resolveClass(final Class<? extends IClass> aClass) {
        try {
            return resolveClassOf(aClass);
        } catch (Exception e) {
            throw new ReflectionsException("could not resolve to class " + aClass.getName(), e);
        }
    }
View Full Code Here

TOP

Related Classes of org.reflections.ReflectionsException

Copyright © 2018 www.massapicom. 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.