Tabnine Logo
Representation.getLanguages
Code IndexAdd Tabnine 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)

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

  • Making http requests using okhttp
  • getContentResolver (Context)
  • getApplicationContext (Context)
  • putExtra (Intent)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Collectors (java.util.stream)
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now