Package org.restlet.representation

Examples of org.restlet.representation.Variant


    {
        super();

        // Define the supported variants.
        getVariants().addAll(
            Arrays.asList( new Variant( MediaType.TEXT_HTML ), new Variant( MediaType.APPLICATION_RDF_XML ),
                           new Variant( MediaType.APPLICATION_JSON ), new Variant( MediaType.APPLICATION_ATOM ) ) );

        setNegotiated( true );
    }
View Full Code Here


                                        .getPreferredMediaType( Collections.singletonList( MediaType.ALL ) ) == MediaType.ALL )
        {
            responseType = possibleMediaTypes.get( 0 );
        }

        Variant variant = new Variant( responseType, language );
        variant.setCharacterSet( CharacterSet.UTF_8 );

        return variant;
    }
View Full Code Here

    private RdfExporter exporter;

    public IndexResource()
    {
        getVariants().addAll( Arrays.asList(
            new Variant( MediaType.TEXT_PLAIN ),
            new Variant( MediaType.APPLICATION_RDF_TRIG ),
            new Variant( MediaType.APPLICATION_RDF_XML ) ) );

        setNegotiated( true );
    }
View Full Code Here

    Repository repository;

    public SPARQLResource()
    {
        getVariants().addAll( Arrays.asList(
            new Variant( MediaType.TEXT_HTML ),
            new Variant( MediaType.APPLICATION_RDF_XML ),
            new Variant( RestApplication.APPLICATION_SPARQL_JSON ) ) );
        setNegotiated( true );
    }
View Full Code Here

    @Override
    public void init(final Context context, final Request request, final Response response) {
        super.init(context, request, response);
        this.ticketGrantingTicketId = (String) request.getAttributes().get("ticketGrantingTicketId");
        this.setNegotiated(false);
        this.getVariants().add(new Variant(MediaType.APPLICATION_WWW_FORM));
    }
View Full Code Here

  WeakHashMap<String,DbReader> readers = new WeakHashMap<String,DbReader>();
 
  @Override
  protected void doInit() throws ResourceException {
    super.doInit();
    getVariants().add(new Variant(MediaType.APPLICATION_JSON));
  }
View Full Code Here

TOP

Related Classes of org.restlet.representation.Variant

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.