Codota Logo
Representation.getLanguages
Code IndexAdd Codota to your IDE (free)

How to use
getLanguages
method
in
org.restlet.representation.Representation

Best Java code snippets using org.restlet.representation.Representation.getLanguages (Showing top 16 results out of 315)

  • Common ways to obtain Representation
private void myMethod () {
Representation r =
  • Codota Iconnew EmptyRepresentation()
  • Codota IconClientResource clientResource;clientResource.get()
  • Codota IconResponse response;response.getEntity()
  • Smart code suggestions by Codota
}
origin: org.restlet.osgi/org.restlet

private Object getLanguagesAsString(Representation entity) {
  if (entity != null && !entity.getLanguages().isEmpty()) {
    final StringBuilder value = new StringBuilder();
    for (int i = 0; i < entity.getLanguages().size(); i++) {
      if (i > 0) {
        value.append(", ");
      }
      value.append(entity.getLanguages().get(i).getName());
    }
    return value.toString();
  }
  return null;
}
origin: org.restlet.osgi/org.restlet

@Override
public List<Language> getLanguages() {
  return getWrappedRepresentation().getLanguages();
}
origin: org.restlet.jee/org.restlet.ext.jaxrs

/**
 * @see HttpHeaders#getLanguage()
 */
public Locale getLanguage() {
  if (this.language == null) {
    final Representation entity = this.request.getEntity();
    if (entity == null) {
      return null;
    }
    final List<Language> languages = entity.getLanguages();
    if (languages.isEmpty()) {
      return null;
    }
    this.language = Converter.toLocale(Util.getFirstElement(languages));
  }
  return this.language;
}
origin: org.restlet.osgi/org.restlet

  && !representation.getLanguages().isEmpty()
  && !var.getLanguages().containsAll(representation.getLanguages())) {
return false;
origin: org.restlet/org.restlet.ext.xml

    .setEncodings(representation.getEncodings());
resultRepresentation
    .setLanguages(representation.getLanguages());
origin: org.restlet.jee/org.restlet.ext.xml

/**
 * Transforms a source XML representation by applying an XSLT transform
 * sheet to it.
 * 
 * @param source
 *            The source XML representation.
 * @return The generated result representation.
 */
public Representation transform(Representation source) {
  final Representation result = new TransformRepresentation(getContext(),
      source, getTransformSheet());
  if (this.resultLanguages != null) {
    result.getLanguages().addAll(getResultLanguages());
  }
  result.setCharacterSet(getResultCharacterSet());
  if (this.resultEncodings != null) {
    result.getEncodings().addAll(getResultEncodings());
  }
  result.setMediaType(getResultMediaType());
  return result;
}
origin: org.restlet/org.restlet.ext.xml

/**
 * Transforms a source XML representation by applying an XSLT transform
 * sheet to it.
 * 
 * @param source
 *            The source XML representation.
 * @return The generated result representation.
 */
public Representation transform(Representation source) {
  final Representation result = new TransformRepresentation(getContext(),
      source, getTransformSheet());
  if (this.resultLanguages != null) {
    result.getLanguages().addAll(getResultLanguages());
  }
  result.setCharacterSet(getResultCharacterSet());
  if (this.resultEncodings != null) {
    result.getEncodings().addAll(getResultEncodings());
  }
  result.setMediaType(getResultMediaType());
  return result;
}
origin: org.restlet.osgi/org.restlet

resultRepresentation.getEncodings().addAll(
    source.getEncodings());
resultRepresentation.getLanguages().addAll(
    source.getLanguages());
origin: org.restlet.osgi/org.restlet

for (Language language : request.getEntity().getLanguages()) {
  updateFileExtension(fileName, language);
origin: org.restlet.osgi/org.restlet

if (result.getLanguages().isEmpty()) {
  result.getLanguages().addAll(target.getLanguages());
origin: apache/attic-polygene-java

if( response.getEntity().getLanguages().isEmpty() )
  response.getEntity().getLanguages().add( Language.ENGLISH );
    if( response.getEntity().getLanguages().isEmpty() )
      response.getEntity().getLanguages().add( Language.ENGLISH );
origin: org.apache.polygene.libraries/org.apache.polygene.library.rest-server

if( response.getEntity().getLanguages().isEmpty() )
  response.getEntity().getLanguages().add( Language.ENGLISH );
    if( response.getEntity().getLanguages().isEmpty() )
      response.getEntity().getLanguages().add( Language.ENGLISH );
origin: org.qi4j.library/org.qi4j.library.rest-server

if( response.getEntity().getLanguages().isEmpty() )
  response.getEntity().getLanguages().add( Language.ENGLISH );
    if( response.getEntity().getLanguages().isEmpty() )
      response.getEntity().getLanguages().add( Language.ENGLISH );
origin: org.restlet.osgi/org.restlet

    HeaderConstants.HEADER_CONTENT_LANGUAGE)) {
  new LanguageReader(header.getValue()).addValues(result
      .getLanguages());
} else if (header.getName().equalsIgnoreCase(
    HeaderConstants.HEADER_CONTENT_TYPE)) {
origin: org.restlet.osgi/org.restlet

  entityHeaderFound = true;
} else if (HEADER_CONTENT_LANGUAGE.equalsIgnoreCase(header.getName())) {
  new LanguageReader(header.getValue()).addValues(result.getLanguages());
  entityHeaderFound = true;
} else if (HEADER_LAST_MODIFIED.equalsIgnoreCase(header.getName())) {
origin: org.restlet.osgi/org.restlet

addHeader(HEADER_CONTENT_LANGUAGE, LanguageWriter.write(entity.getLanguages()), headers);
org.restlet.representationRepresentationgetLanguages

Popular methods of Representation

  • getMediaType
  • getStream
    Returns a stream with the representation's content. This method is ensured to return a fresh stream
  • getText
    Converts the representation to a string value. Be careful when using this method as the conversion o
  • isAvailable
    Indicates if some fresh content is potentially available, without having to actually call one of the
  • write
    Writes the representation to a byte channel. This method is ensured to write the full content for ea
  • setMediaType
  • getCharacterSet
  • getReader
    Returns a characters reader with the representation's content. This method is ensured to return a fr
  • getSize
    Returns the total size in bytes if known, UNKNOWN_SIZE (-1) otherwise. When ranges are used, this mi
  • setCharacterSet
  • getModificationDate
  • release
    Releases the representation and all associated objects like streams, channels or files which are use
  • getModificationDate,
  • release,
  • setModificationDate,
  • getEncodings,
  • getLocationRef,
  • setTag,
  • exhaust,
  • getDisposition,
  • getTag

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (Timer)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • onRequestPermissionsResult (Fragment)
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now