actionReturn.format = entityView.getExtension(); if (actionReturn.encoding == null || actionReturn.mimeType == null) {
actionReturn.format = entityView.getExtension(); if (actionReturn.encoding == null || actionReturn.mimeType == null) {
/** * Makes a copy of an EntityView which can be changed independently * @param ev any EntityView * @return the copy * @throws IllegalArgumentException if the input is null OR not completely constructed */ public static EntityView copy(EntityView ev) { if (ev == null) { throw new IllegalArgumentException("input entity view must not be null"); } if (ev.viewKey == null || ev.entityReference == null) { throw new IllegalArgumentException("input entity view must be completely constructed"); } EntityView togo = new EntityView(); EntityReference ref = ev.getEntityReference(); togo.setEntityReference( new EntityReference(ref.getPrefix(), ref.getId() == null ? "" : ref.getId()) ); togo.preloadParseTemplates( ev.getAnazlyzedTemplates() ); togo.setExtension( ev.getExtension() ); togo.setViewKey( ev.getViewKey() ); return togo; }