Package org.reflections

Examples of org.reflections.ReflectionsException


    public static Field resolveField(final Class<? extends IField> aField) {
        try {
            String name = aField.getSimpleName();
            return resolveClassOf(aField).getDeclaredField(name);
        } catch (Exception e) {
            throw new ReflectionsException("could not resolve to field " + aField.getName(), e);
        }
    }
View Full Code Here


                paramTypes = null;
            }

            return resolveClassOf(aMethod).getDeclaredMethod(methodName, paramTypes);
        } catch (Exception e) {
            throw new ReflectionsException("could not resolve to method " + aMethod.getName(), 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

            List<URL> urls = Lists.newArrayList(Iterators.forEnumeration(urlEnumeration));

            return getBaseUrls(urls, getUrlsForCurrentClasspath());

        } catch (IOException e) {
            throw new ReflectionsException("Can't resolve URL for package prefix " + packagePrefix, e);
        }
    }
View Full Code Here

                for (String path : javaClassPath.split(File.pathSeparator)) {
                    try {
                        urls.add(new File(path).toURI().toURL());
                    } catch (Exception e) {
                        throw new ReflectionsException("could not create url from " + path, e);
                    }
                }
            }
        }
View Full Code Here

        try {
            XMLWriter xmlWriter = new XMLWriter(new FileOutputStream(file), OutputFormat.createPrettyPrint());
            xmlWriter.write(document);
            xmlWriter.close();
        } catch (IOException e) {
            throw new ReflectionsException("could not save to file " + filename, e);
        }

        return file;
    }
View Full Code Here

                        break;
                    case '-':
                        filter = new Exclude(pattern);
                        break;
                    default:
                        throw new ReflectionsException("includeExclude should start with either + or -");
                }

                filters.add(filter);
            }
View Full Code Here

            if (dis != null) {
                try {
                    dis.close();
                } catch (IOException e) {
                    //noinspection ThrowFromFinallyBlock
                    throw new ReflectionsException("could not close DataInputStream", e);
                }
            }
        }
    }
View Full Code Here

            for (CtBehavior member : ctClass.getDeclaredMethods()) {
                scanMember(member);
            }
            ctClass.detach();
        } catch (Exception e) {
            throw new ReflectionsException("Could not scan method usage for " + getMetadataAdapter().getClassName(cls), e);
        }
    }
View Full Code Here

            public void edit(NewExpr e) throws CannotCompileException {
                try {
                    put(e.getConstructor().getDeclaringClass().getName() + "." + "<init>" +
                            "(" + parameterNames(e.getConstructor().getMethodInfo()) + ")", e.getLineNumber(), key);
                } catch (NotFoundException e1) {
                    throw new ReflectionsException("Could not find new instance usage in " + key, e1);
                }
            }

            @Override
            public void edit(MethodCall m) throws CannotCompileException {
                try {
                    put(m.getMethod().getDeclaringClass().getName() + "." + m.getMethodName() +
                            "(" + parameterNames(m.getMethod().getMethodInfo()) + ")", m.getLineNumber(), key);
                } catch (NotFoundException e) {
                    throw new ReflectionsException("Could not find member " + m.getClassName() + " in " + key, e);
                }
            }

            @Override
            public void edit(ConstructorCall c) throws CannotCompileException {
                try {
                    put(c.getConstructor().getDeclaringClass().getName() + "." + "<init>" +
                            "(" + parameterNames(c.getConstructor().getMethodInfo()) + ")", c.getLineNumber(), key);
                } catch (NotFoundException e) {
                    throw new ReflectionsException("Could not find member " + c.getClassName() + " in " + key, e);
                }
            }

            @Override
            public void edit(FieldAccess f) throws CannotCompileException {
                try {
                    put(f.getField().getDeclaringClass().getName() + "." + f.getFieldName(), f.getLineNumber(), key);
                } catch (NotFoundException e) {
                    throw new ReflectionsException("Could not find member " + f.getFieldName() + " in " + key, 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.