Package org.jboss.metatype.api.values

Examples of org.jboss.metatype.api.values.SimpleValue


            role.setAttribute("name", name);
           
            // For each attribute: read, write, create
            for(String attribute : attributes)
            {
               SimpleValue v = (SimpleValue) row.get(attribute);
               if(v != null && v.getValue() != null)
               {
                  role.setAttribute(attribute, ((Boolean)v.getValue()).toString());
               }
            }
            security.appendChild(role);
         }
         return security;
View Full Code Here


   {
      boolean found = false;
      for(MetaValue v : values.getElements())
      {
         MapCompositeValueSupport c = (MapCompositeValueSupport) v;
         SimpleValue bindingName = (SimpleValue)c.get("bindingName");
         if(bindingName != null && bindingName.getValue().equals(name))
         {
            found = true;
            c.put("port", SimpleValueSupport.wrap(port));
         }
      }
View Full Code Here

         PropertyInfo info, Fields fields)
   {
      HashSet<MetaValue> values = new HashSet<MetaValue>();
      for(String s : legalValues)
      {
         SimpleValue svalue = SimpleValueSupport.wrap(s);
         values.add(svalue);
      }
      fields.setField(Fields.LEGAL_VALUES, values);
   }
View Full Code Here

      if (expected.isInstance(field))
         return expected.cast(field);
     
      if (field instanceof SimpleValue)
      {
         SimpleValue value = (SimpleValue) field;
         Object result = value.getValue();
         if (result == null)
            return null;
         return expected.cast(result);
      }
     
View Full Code Here

      if (expected.isInstance(field))
         return expected.cast(field);
     
      if (field instanceof SimpleValue)
      {
         SimpleValue value = (SimpleValue) field;
         Object result = value.getValue();
         if (result == null)
            return null;
         return expected.cast(result);
      }
     
View Full Code Here

      if (expected.isInstance(field))
         return expected.cast(field);
     
      if (field instanceof SimpleValue)
      {
         SimpleValue value = (SimpleValue) field;
         Object result = value.getValue();
         if (result == null)
            return null;
         return expected.cast(result);
      }
     
View Full Code Here

               {
                  log.warn("Cannot create String name from non-Simple property: "
                        +property+", value="+value);
                  continue;
               }
               SimpleValue svalue = (SimpleValue) value;
               String name = "" + svalue.getValue();
               managedObject.setName(name);
            }
            ManagementRuntimeRef runtimeRef = (ManagementRuntimeRef) annotations.get(ManagementRuntimeRef.class.getName());
            if (runtimeRef != null)
            {
View Full Code Here

               if (value == null || value.getMetaType().isSimple() == false)
               {
                  log.warn("Cannot create String name from non-Simple property: " + property + ", value=" + value);
                  continue;
               }
               SimpleValue svalue = (SimpleValue) value;
               String name = id.prefix() + svalue.getValue() + id.suffix();
               log.debug("Created name: "+name+" from property: "+property.getName());
               managedObject.setName(name);
            }
            ManagementRuntimeRef runtimeRef = getAnnotation(ManagementRuntimeRef.class, annotations, metaData);
            if (runtimeRef != null)
View Full Code Here

   public RunState getRunState(ManagedProperty property, MetaValue value)
   {
      RunState state = RunState.UNKNOWN;
      if ( value.getMetaType().isSimple() )
      {
         SimpleValue sv = SimpleValue.class.cast(value);
         String s = sv.getValue().toString();
         String es = valueMapping.get(s);
         if(es != null)
         {
            state = RunState.valueOf(es);
         }
View Full Code Here

    * @param mv - the CompositeValue meta value
    * @return the corresponding MemoryUsage instance
    */
   public static MemoryUsage unwrapMemoryUsage(CompositeValue mv)
   {
      SimpleValue committedSV = SimpleValue.class.cast(mv.get("committed"));
      SimpleValue initSV = SimpleValue.class.cast(mv.get("init"));
      SimpleValue maxSV = SimpleValue.class.cast(mv.get("max"));
      SimpleValue usedSV = SimpleValue.class.cast(mv.get("used"));
      long committed = (Long) committedSV.getValue();
      long init = (Long) initSV.getValue();
      long max = (Long) maxSV.getValue();
      long used = (Long) usedSV.getValue();
      MemoryUsage mu = new MemoryUsage(init, used, committed, max);
      return mu;
   }
View Full Code Here

TOP

Related Classes of org.jboss.metatype.api.values.SimpleValue

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.