Package org.exoplatform.services.token.attribute

Examples of org.exoplatform.services.token.attribute.Attribute


      {
         System.out.println("NAME: " + attr.getName() + " & " + "VALUE: " + attr.getValue());
      }

      //Add a new Attribute to the attribute collection of the Node.
      Attribute newAttr = new Attribute("bgcolor", "red");
      attrs.set(newAttr);
      assertEquals(newAttr.getName(), "bgcolor");
      assertEquals(newAttr.getValue(), "red");
      for (Attribute attr : attrs)
      {
         System.out.println("NAME: " + attr.getName() + " & " + "VALUE: " + attr.getValue());
      }

      //Clear (remove) an Attribute in the attribute collection of the Node.
      System.out.println("\n\nRemove:");
      assertEquals(true, attrs.contains(new Attribute("bgcolor", "red")));
      attrs.remove(new Attribute("bgcolor", "red"));
      assertNull(attrs.get("bgcolor"));
      for (Attribute attr : attrs)
      {
         System.out.println("NAME: " + attr.getName() + " & " + "VALUE: " + attr.getValue());
      }
      //Clear all the attributes of the Node.
      attrs.clear();
      assertEquals(true, attrs.isEmpty());
      //assertEquals(attrs,null);

      //Add a new Atribute collection to the Node.
      System.out.println("\n\nAdd:");
      List<Attribute> attrList = new ArrayList<Attribute>();
      attrList.add(new Attribute("caption", "New Table"));
      attrList.add(1, new Attribute("border", "2"));
      attrList.add(2, new Attribute("bgcolor", "blue"));
      assertEquals(true, attrs.addAll(0, attrList));
      for (Attribute attr : attrs)
      {
         System.out.println("NAME: " + attr.getName() + " & " + "VALUE: " + attr.getValue());
      }

      //Insert a new Attribute to the attribute collection of the Node.
      attrs.add(attrs.size() - 1, new Attribute("cellspacing", "2"));
      //assertEquals(attrs.get(attrs.size()-1),new Attribute("cellspacing","2"));
      assertNotNull(attrs.get(attrs.size() - 1));
      System.out.println("\n\nInsert:");
      for (Attribute attr : attrs)
      {
View Full Code Here


         {
            ele.setValue(value);
            return;
         }
      }
      Attribute attr = new Attribute(name, value);
      attrs.set(attr);
   }
View Full Code Here

   }

   private void createFullSingleLink(HTMLNode node, Map<String, String> map, URL home, URLCreator creator,
      ValueVerifier verifier)
   {
      Attribute attr = null;
      Set<String> keys = map.keySet();
      Iterator<String> iter = keys.iterator();
      while (iter.hasNext())
      {
         String key = iter.next();
         if (!node.isNode(key))
            continue;
         Attributes attrs = AttributeParser.getAttributes(node);
         int idx = attrs.indexOf(map.get(key));
         if (idx < 0)
            continue;
         attr = attrs.get(idx);
         String value = attr.getValue();
         if (verifier != null && !verifier.verify(value))
            return;
         value = creator.createURL(home, value);
         attr.setValue(value);
         attrs.set(attr);
         return;
      }
   }
View Full Code Here

TOP

Related Classes of org.exoplatform.services.token.attribute.Attribute

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.