@Override public boolean isWriteable(Class<?> type, Type genericType, Annotation[] anns, MediaType mt) { if (ui.getRequestUri().toString().endsWith("/test/5/bookstorestorage/thosebooks/123")) { for (Annotation ann : anns) { if (ann.annotationType() == SchemaValidation.class) { return super.isWriteable(type, genericType, anns, mt); } } throw new RuntimeException(); } return super.isWriteable(type, genericType, anns, mt); } @Override
@Override public boolean isWriteable(Class<?> type, Type genericType, Annotation[] anns, MediaType mt) { // JAXB support is required if (!super.isWriteable(type, genericType, anns, mt)) { return false; } if (InjectionUtils.isSupportedCollectionOrArray(type)) { return supportJaxbOnly; } // if the user has set the list of out classes and a given class // is in that list then it can only be handled by the template if (outClassCanBeHandled(type.getName()) || outClassesToHandle == null && !supportJaxbOnly) { return outTemplatesAvailable(type, anns, mt); } return supportJaxbOnly; }
@Override public boolean isWriteable(Class<?> type, Type genericType, Annotation[] anns, MediaType mt) { // JAXB support is required if (!super.isWriteable(type, genericType, anns, mt)) { return false; } if (InjectionUtils.isSupportedCollectionOrArray(type)) { return supportJaxbOnly; } // if the user has set the list of out classes and a given class // is in that list then it can only be handled by the template if (outClassCanBeHandled(type.getName()) || outClassesToHandle == null && !supportJaxbOnly) { return outTemplatesAvailable(mt); } else { return supportJaxbOnly; } }