@Override public void setLanguages(List<Language> languages) { getWrappedRepresentation().setLanguages(languages); }
private Representation entityHeaders( Representation representation, EntityState entityState ) { representation.setModificationDate( java.util.Date.from( entityState.lastModified() ) ); representation.setTag( new Tag( "" + entityState.version() ) ); representation.setCharacterSet( CharacterSet.UTF_8 ); representation.setLanguages( Collections.singletonList( Language.ENGLISH ) ); return representation; }
.setEncodings(representation.getEncodings()); resultRepresentation .setLanguages(representation.getLanguages());
@Override public Representation toRepresentation(Object object, Variant targetVariant, UniformResource resource) throws IOException { Representation result = null; if (object instanceof Document) { result = new DomRepresentation(targetVariant == null ? null : targetVariant.getMediaType(), (Document) object); } if ((result != null) && (targetVariant != null)) { // Copy the variant metadata result.setCharacterSet(targetVariant.getCharacterSet()); result.setMediaType(targetVariant.getMediaType()); result.setEncodings(targetVariant.getEncodings()); result.setLanguages(targetVariant.getLanguages()); } return result; } }
/** * Constructor from a variant. * * @param variant * The variant to copy. * @param modificationDate * The modification date. * @param tag * The tag. */ public Representation(Variant variant, Date modificationDate, Tag tag) { setCharacterSet(variant.getCharacterSet()); setEncodings(variant.getEncodings()); setLocationRef(variant.getLocationRef()); setLanguages(variant.getLanguages()); setMediaType(variant.getMediaType()); setModificationDate(modificationDate); setTag(tag); }