Examples of Variant


Examples of com.jengine.utils.commons.Variant

    public boolean isChanged(Model obj) throws DBException {
        return obj.getOldData().containsKey(fieldName);
    }

    public Object cast(Object value) throws DBException {
        return new Variant(value).convertTo(getFieldClass());
    }
View Full Code Here

Examples of com.sun.jna.platform.win32.Variant.VARIANT

  }

  public void testDISPPARAMS() {
    // Build DISPPARAMS
    SAFEARRAY.ByReference safeArg = OleAutoUtil.createVarArray(1);
    OleAutoUtil.SafeArrayPutElement(safeArg, 0, new VARIANT(
        Variant.VARIANT_TRUE));
    //System.out.println(safeArg.toString(true));
  }
View Full Code Here

Examples of com.volantis.mcs.policies.variants.Variant

            return null;
        }

        ActivatedVariablePolicy policy = selected.getPolicy();

        Variant variant = selected.getVariant();
        if (variant == null) {
            return null;
        }

        Content content = variant.getContent();
        if (content instanceof EmbeddedContent) {
            EmbeddedContent embedded = (EmbeddedContent) content;
            return embedded.getData();
        } else {
            MarinerURL marinerURL = computeURL((Asset) selected.getOldObject());
View Full Code Here

Examples of com4j.Variant

        if(method.isVarArg() && p==params[params.length-1]) {
            // use varargs if applicable
            if( javaType.endsWith("[]") )
                javaType = javaType.substring(0,javaType.length()-2)+"...";
        }
        Variant defValue = p.getDefaultValue();
        if(defValue!=null)
            try {
                o.print("@DefaultValue(\""+ defValue.stringValue()+"\")");
            } catch (ComException e) {
                // in rare occasions we get default values that are not printable.
                // ignore such an error.
            }
        o.print(javaType);
View Full Code Here

Examples of edu.cmu.cs.fusion.Variant

    partialSub = partialSub.addSub(utils.getVar(0), labels[0]);
    partialSub = partialSub.addSub(utils.getVar(1), labels[1]);
    partialSub = partialSub.addSub(Constraint.RESULT, labels[6]);
    partialSub = partialSub.addSub(Constraint.RECEIVER, labels[1]);

    Variant vOld = this.variant;
    this.variant = Variant.PRAGMATIC_VARIANT;
    FusionEnvironment<?> env = new FusionEnvironment<TestAliasContext>(aliases, rels, null, types, new InferenceEnvironment(null), variant);   
    Pair<RelationshipDelta, Substitution> deltas = runFullyBound(env, partialSub, cons);
    this.variant = vOld;
    assertNull(deltas.snd());
View Full Code Here

Examples of edu.mayo.bmi.guoqian.claml.Variant

    /**
     * Create an instance of {@link Variant }
     *
     */
    public Variant createVariant() {
        return new Variant();
    }
View Full Code Here

Examples of javax.ws.rs.core.Variant


   public Variant getBestMatch(List<Variant> available)
   {
      BigDecimal bestQuality = BigDecimal.ZERO;
      Variant bestOption = null;
      for (Variant option : available)
      {
         VariantQuality quality = new VariantQuality();
         if (!applyMediaType(option, quality))
            continue;
View Full Code Here

Examples of javax.ws.rs.core.Variant

      MediaType mediaType = MediaType.valueOf("text/plain");
      String encoding = "gzip";
      Locale locale = Locale.UK;

      List<Variant> available = new ArrayList<Variant>();
      available.add(new Variant(mediaTypeWithCharset, null, null));
      available.add(new Variant(mediaTypeWithCharset, locale, null));
      available.add(new Variant(mediaTypeWithCharset, null, encoding));
      available.add(new Variant(mediaTypeWithCharset, locale, encoding));
      available.add(new Variant(mediaType, null, null));
      available.add(new Variant(mediaType, locale, null));
      available.add(new Variant(mediaType, null, encoding));
      available.add(new Variant(mediaType, locale, encoding));
      available.add(new Variant(null, locale, null));
      available.add(new Variant(null, locale, encoding));
      available.add(new Variant(null, null, encoding));

      // Assert all acceptable:
      for (Variant variant : available)
         assertEquals(variant, negotiation.getBestMatch(Arrays.asList(variant)));

      Variant best = negotiation.getBestMatch(available);
      assertNotNull(best);
      assertEquals(mediaTypeWithCharset, best.getMediaType());
      assertEquals(encoding, best.getEncoding());
      assertEquals(locale, best.getLanguage());
   }
View Full Code Here

Examples of javax.ws.rs.core.Variant

   {
      String header = "text/*, text/html, text/html;level=1, */*";
      ServerDrivenNegotiation negotiation = new ServerDrivenNegotiation();
      negotiation.setAcceptHeaders(Arrays.asList(header));

      Variant o1 = new Variant(MediaType.valueOf("text/html;level=1"), null, null);
      Variant o2 = new Variant(MediaType.valueOf("text/html"), null, null);
      Variant o3 = new Variant(MediaType.valueOf("text/*"), null, null);
      Variant o4 = new Variant(MediaType.valueOf("*/*"), null, null);

      List<Variant> available = new ArrayList<Variant>();
      available.add(o4);
      assertEquals(o4, negotiation.getBestMatch(available));
      available.add(o3);
View Full Code Here

Examples of javax.ws.rs.core.Variant

      String header2 = "text/html;level=2;q=0.4, */*;q=0.5";
      ServerDrivenNegotiation negotiation = new ServerDrivenNegotiation();
      negotiation.setAcceptHeaders(Arrays.asList(header1, header2));
      negotiation.setAcceptLanguageHeaders(Arrays.asList("en"));

      Variant q03 = new Variant(MediaType.valueOf("text/plain"), null, null);
      Variant q04 = new Variant(MediaType.valueOf("text/html;level=2"), null, null);
      Variant q05 = new Variant(MediaType.valueOf("image/jpeg"), null, null);
      Variant q07 = new Variant(MediaType.valueOf("text/html"), null, null);
      Variant q07plus = new Variant(MediaType.valueOf("text/html;level=3"), null, null);
      Variant q10 = new Variant(MediaType.valueOf("text/html;level=1"), null, null);

      List<Variant> available = new ArrayList<Variant>();
      available.add(q03);
      assertEquals(q03, negotiation.getBestMatch(available));
      available.add(q04);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.