Examples of Tags


Examples of org.apache.cxf.jaxrs.resources.Tags

        byte[] bytes =
            "{\"Tags\":{\"list\":[{\"group\":\"b\",\"name\":\"a\"},{\"group\":\"d\",\"name\":\"c\"}]}}"
            .getBytes();
        Object tagsObject = p.readFrom((Class)Tags.class, null, null,
                                          null, null, new ByteArrayInputStream(bytes));
        Tags tags = (Tags)tagsObject;
        List<TagVO> list = tags.getTags();
        assertEquals(2, list.size());
        assertEquals("a", list.get(0).getName());
        assertEquals("b", list.get(0).getGroup());
        assertEquals("c", list.get(1).getName());
        assertEquals("d", list.get(1).getGroup());
View Full Code Here

Examples of org.apache.cxf.jaxrs.resources.Tags

    }
   
    @Test
    public void testWriteToListWithManyValues() throws Exception {
        JSONProvider p = new JSONProvider();
        Tags tags = new Tags();
        tags.addTag(createTag("a", "b"));
        tags.addTag(createTag("c", "d"));
       
        ByteArrayOutputStream os = new ByteArrayOutputStream();
       
        p.writeTo(tags, (Class)Tags.class, Tags.class, Tags.class.getAnnotations(),
                  MediaType.APPLICATION_JSON_TYPE, new MetadataMap<String, Object>(), os);
View Full Code Here

Examples of org.apache.cxf.jaxrs.resources.Tags

    @Test
    public void testWriteToListWithSingleValue() throws Exception {
        JSONProvider p = new JSONProvider();
        p.setSerializeAsArray(true);
        p.setArrayKeys(Collections.singletonList("list"));
        Tags tags = new Tags();
        tags.addTag(createTag("a", "b"));
       
        ByteArrayOutputStream os = new ByteArrayOutputStream();
       
        p.writeTo(tags, (Class)Tags.class, Tags.class, Tags.class.getAnnotations(),
                  MediaType.APPLICATION_JSON_TYPE, new MetadataMap<String, Object>(), os);
View Full Code Here

Examples of org.apache.cxf.jaxrs.resources.Tags

    public void testManyTags() throws Exception {
        JSONProvider p = new JSONProvider();
        p.setSerializeAsArray(true);
        p.setArrayKeys(Collections.singletonList("list"));
       
        Tags tags = new Tags();
        tags.addTag(createTag("a", "b"));
        ManyTags many = new ManyTags();
        many.setTags(tags);
       
        ByteArrayOutputStream os = new ByteArrayOutputStream();
       
View Full Code Here

Examples of org.apache.cxf.jaxrs.resources.Tags

        list.add("ManyTags");
        list.add("list");
        list.add("tags");
        provider.setOutDropElements(list);
        ManyTags many = new ManyTags();
        Tags tags = new Tags();
        tags.addTag(new TagVO("A", "B"));
        tags.addTag(new TagVO("C", "D"));
        many.setTags(tags);
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        provider.writeTo(many, ManyTags.class, ManyTags.class,
                       new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, Object>(), bos);
        System.out.println(bos.toString());
View Full Code Here

Examples of org.apache.shale.util.Tags

          if (typeVars != null && typeVars.containsKey(v.getType())) {
              localVars = (Map) typeVars.get(v.getType());
          }
      }

      Tags tagUtils = new Tags();
      ValidatorAction validatorAction = v.getValidatorAction();
      writer.write("new Array(\"");
      writer.write(id);
      writer.write("\", \"");
      writer.write(v.getErrorMessage(context, validatorAction, localVars));
      writer.write("\", new Function(\"x\", \"return {");

      Iterator vi = v.getVars().entrySet().iterator();

      boolean first = true;

      // vars captured at render time and are the result of
      // EL.
      Map idVars = (Map) validatorVars.get(id);

      next: while (vi.hasNext()) {
         Map.Entry e = (Map.Entry) vi.next();

         Object value = e.getValue();

         // look for a render override by clientId/type
         if (idVars != null && idVars.containsKey(v.getType())) {

             Map typeVars = (Map) idVars.get(v.getType());
             // look for a render override by clientId/type/name
             if (typeVars != null && typeVars.containsKey(e.getKey())) {
                value = typeVars.get(e.getKey());
             }
         } else {
            if (value != null && value instanceof String
                && isValueReference((String) e.getValue())) {

                value = tagUtils.eval((String) e.getValue());
            }
         }

         if (value == null) {
            continue next;
View Full Code Here

Examples of org.broadinstitute.gatk.utils.commandline.Tags

    protected final static Logger logger = Logger.getLogger(TrainingSet.class);

    public TrainingSet( final RodBinding<VariantContext> rodBinding) {
        this.rodBinding = rodBinding;

        final Tags tags = rodBinding.getTags();
        final String name = rodBinding.getName();

        // Parse the tags to decide which tracks have which properties
        if( tags != null ) {
            isKnown = tags.containsKey("known") && tags.getValue("known").equals("true");
            isTraining = tags.containsKey("training") && tags.getValue("training").equals("true");
            isAntiTraining = tags.containsKey("bad") && tags.getValue("bad").equals("true");
            isTruth = tags.containsKey("truth") && tags.getValue("truth").equals("true");
            isConsensus = tags.containsKey("consensus") && tags.getValue("consensus").equals("true");
            prior = ( tags.containsKey("prior") ? Double.parseDouble(tags.getValue("prior")) : prior );
        }

        // Report back to the user which tracks were found and the properties that were detected
        if( !isConsensus && !isAntiTraining ) {
            logger.info( String.format( "Found %s track: \tKnown = %s \tTraining = %s \tTruth = %s \tPrior = Q%.1f", name, isKnown, isTraining, isTruth, prior) );
View Full Code Here

Examples of org.constretto.annotation.Tags

* @author <a href=mailto:zapodot@gmail.com>Sondre Eikanger Kval&oslash;</a>
*/
public class ConstrettoTagExtractor {

    public static String[] findTagValueForDescription(final Description description) {
        final Tags tagValues = getClassAnnotation(description);
        if (tagValues == null) {
            return null;
        } else {
            return tagValues.value();
        }
    }
View Full Code Here

Examples of org.eweb4j.util.xml.Tags

    this.task = task;
    this.target = target;
    this.listener = listener;
   
      fel.addFun(fun);
      Tags $Tags = Tags.me();
      Attrs $Attrs = Attrs.me();
      fel.getContext().set("$Tags", $Tags);
      fel.getContext().set("$Attrs", $Attrs);
      fel.getContext().set("$Util", CommonUtil.class);
      fel.getContext().set("$ParserUtil", ParserUtil.class);
View Full Code Here

Examples of org.platformlayer.core.model.Tags

  public boolean matchesItem(ItemBase item) {
    if (requiredTag == null) {
      throw new IllegalStateException();
    }

    Tags tags = item.getTags();
    return matchesTags(tags);
  }
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.