Package com.jayway.jaxrs.hateoas

Examples of com.jayway.jaxrs.hateoas.HateoasInjectException


    public static Object getFieldValue(Object entity, String fieldName) {
        try {
            Field field = getField(entity, fieldName);
            return field.get(entity);
        } catch (Exception e) {
            throw new HateoasInjectException(e);
        }

    }
View Full Code Here


    public static void setField(Object entity, String fieldName, Object value) {
        try {
            Field field = getField(entity, fieldName);
            field.set(entity, value);
        } catch (Exception e) {
            throw new HateoasInjectException(e);
        }
    }
View Full Code Here

            return target;
        }
        try {
            return injectLinks(iterator(), target, injector, linkProducer, verbosity);
        } catch (Exception e) {
            throw new HateoasInjectException(e);
        }
    }
View Full Code Here

        }

        HateoasLinkInjector<Object> injector = INJECTOR_MAPPING.get(entity.getClass());

        if(injector == null){
            throw new HateoasInjectException("No suitable injector found for " + entity.getClass());
        }

        return injector.injectLinks(entity, objectLinkProducer, verbosity);
    }
View Full Code Here

    public static Object getFieldValue(Object entity, String fieldName) {
        try {
            Field field = getField(entity, fieldName);
            return field.get(entity);
        } catch (Exception e) {
            throw new HateoasInjectException(e);
        }
    }
View Full Code Here

    public static Object getFieldValueHierarchical(Object entity, String fieldName) {
        try {
            Field field = getFieldHierarchical(entity.getClass(), fieldName);
            return field.get(entity);
        } catch (Exception e) {
            throw new HateoasInjectException(e);
        }
    }
View Full Code Here

                    }

                } while (!Object.class.equals(superClass));
            }
        } catch (Exception e) {
            throw new HateoasInjectException(e);
        }
        if (!done) {
            throw new HateoasInjectException("Field not found: " + fieldName);
        }
    }
View Full Code Here

    public static void setField(Object entity, String fieldName, Object value) {
        try {
            Field field = getField(entity, fieldName);
            field.set(entity, value);
        } catch (Exception e) {
            throw new HateoasInjectException(e);
        }
    }
View Full Code Here

                            valid = true;
                            break;
                        }
                    }
                    if (!valid){
                        throw new HateoasInjectException("DTO's must have no arg constructor. Check " + entity.getClass().getName());
                    }

                    CtClass newClass = CLASS_POOL.makeClass(newClassName);
                    newClass.setSuperclass(CLASS_POOL.get(entity.getClass().getName()));
                    CtConstructor ctConstructor = new CtConstructor(new CtClass[0], newClass);
View Full Code Here

            return target;
        }
        try {
            return injectLinks(iterator(), target, injector, linkProducer, verbosity);
        } catch (Exception e) {
            throw new HateoasInjectException(e);
        }
    }
View Full Code Here

TOP

Related Classes of com.jayway.jaxrs.hateoas.HateoasInjectException

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.