Package org.jboss.metatype.api.types

Examples of org.jboss.metatype.api.types.MetaType


            // Since we want to load the PropertyList with fresh values, we want it cleared out.
            propList.getList().clear();
            if (metaValue != null)
            {
                CollectionValue collectionValue = (CollectionValue)metaValue;
                MetaType listMemberMetaType = collectionValue.getMetaType().getElementType();
                MetaValue[] listMemberValues = collectionValue.getElements();
                PropertyAdapter propertyAdapter = PropertyAdapterFactory.getPropertyAdapter(listMemberMetaType);
                for (MetaValue listMemberValue : listMemberValues)
                {
                    Property listMemberProp = propertyAdapter.convertToProperty(listMemberValue, memberPropDef);
View Full Code Here


            if (propDefMap != null)
            {
                for (PropertyDefinition mapMemberPropDef : propDefMap.getPropertyDefinitions().values())
                {
                    String mapMemberDesc = (propDefMap.getDescription() != null) ? propDefMap.getDescription() : "none";
                    MetaType mapMemberMetaType = ProfileServiceUtil.convertPropertyDefinitionToMetaType(mapMemberPropDef);
                    compositeMetaType.addItem(mapMemberPropDef.getName(), mapMemberDesc, mapMemberMetaType);
                }
            }
        }
        return new CompositeValueSupport(compositeMetaType);
View Full Code Here

        CompositeValue compositeValue = (CompositeValue)metaValue;               
        for (String mapMemberPropName : propMap.getMap().keySet())
        {
            Property mapMemberProp = propMap.get(mapMemberPropName);
            PropertyDefinition mapMemberPropDef = propDefMap.get(mapMemberPropName);
            MetaType mapMemberMetaType = compositeValue.getMetaType().getType(mapMemberPropName);
            if (mapMemberMetaType == null)
            {
                // this will occur when new map properties are added since they are not present
                // in the original metaValue which we are using
                mapMemberMetaType = SimpleMetaType.STRING;
View Full Code Here

        // There won't be any keys when loading a Configuration for the first time.
        for (String mapMemberPropName : mapMemberPropNames)
        {
            Property mapMemberProp = propMap.get(mapMemberPropName);
            MetaValue mapMemberMetaValue = compositeValue.get(mapMemberPropName);
            MetaType mapMemberMetaType = compositeValue.getMetaType().getType(mapMemberPropName);
            PropertyAdapter propertyAdapter = PropertyAdapterFactory.getPropertyAdapter(mapMemberMetaType);
            PropertyDefinition mapMemberPropDef = propDefMap.get(mapMemberPropName);
            if (mapMemberProp == null)
            {
                if (mapMemberPropDef != null)
                    mapMemberProp = propertyAdapter.convertToProperty(mapMemberMetaValue, mapMemberPropDef);
                else
                {
                    // If the member prop has no associated prop def, this is an "open map".
                    if (!mapMemberMetaType.isSimple() && !mapMemberMetaType.isEnum())
                    {
                        log.debug("Map member prop [" + mapMemberMetaType + "] is not a simple type - skipping...");
                        continue;
                    }
                    // Create a PropertySimple and populate it.
View Full Code Here

  }
 
  public static <T> void getTranslatorValues(MetaValue pValue,
      PropertyMap map, PropertyList list) throws Exception {
    MetaType metaType = pValue.getMetaType();
    MapCompositeValueSupport unwrappedvalueMap = null;
    if (metaType.isComposite()) {
      unwrappedvalueMap = (MapCompositeValueSupport) pValue;

      for (String key : unwrappedvalueMap.getMetaType().keySet()) {
        map = new PropertyMap("property");
        map.put(new PropertySimple("name", key));
View Full Code Here

  }


  public static <T> void getTranslatorValues(MetaValue pValue,
      PropertyMap map, PropertyList list) throws Exception {
    MetaType metaType = pValue.getMetaType();
    MapCompositeValueSupport unwrappedvalue = null;
    if (metaType.isComposite()) {
      unwrappedvalue = (MapCompositeValueSupport)pValue;

      for (String key : unwrappedvalue.getMetaType().keySet()) {
        map = new PropertyMap("properties");//$NON-NLS-1$
        map.put(new PropertySimple("name", key));//$NON-NLS-1$
View Full Code Here

   */
  public static <T> void getSourceMappingValue(MetaValue pValue,
      Collection<Map<String, String>> list) {
    Map<String, String> map = new HashMap<String, String>();
    list.add(map);
    MetaType metaType = pValue.getMetaType();
    if (metaType.isCollection()) {
      for (MetaValue value : ((CollectionValueSupport) pValue)
          .getElements()) {
        GenericValueSupport genValue = ((GenericValueSupport) value);
        ManagedObject mo = (ManagedObject) genValue.getValue();
        String sourceName = mo.getName();
View Full Code Here

   */
  public static <T> void getPropertyValues(MetaValue pValue,
      Collection<Map<String, String>> list) {
    Map<String, String> map = new HashMap<String, String>();
    list.add(map);
    MetaType metaType = pValue.getMetaType();
    if (metaType.isCollection()) {
      for (MetaValue value : ((CollectionValueSupport) pValue)
          .getElements()) {
        CompositeValueSupport compValue = ((CompositeValueSupport) value);
        for (MetaValue propValue : compValue.values()) {
          String propertyName = ((CompositeValueSupport) propValue)
View Full Code Here

    return getManagedComponent(connection, DQPTYPE, BUFFERSERVICE);
  }

  public static String stringValue(MetaValue v1) throws Exception {
    if (v1 != null) {
      MetaType type = v1.getMetaType();
      if (type instanceof SimpleMetaType) {
        SimpleValue simple = (SimpleValue) v1;
        return simple.getValue().toString();
      }
      throw new Exception("Failed to convert value to string value"); //$NON-NLS-1$
View Full Code Here

    return null;
  }

  public static Boolean booleanValue(MetaValue v1) throws Exception {
    if (v1 != null) {
      MetaType type = v1.getMetaType();
      if (type instanceof SimpleMetaType) {
        SimpleValue simple = (SimpleValue) v1;
        return Boolean.valueOf(simple.getValue().toString());
      }
      throw new Exception("Failed to convert value to boolean value"); //$NON-NLS-1$
View Full Code Here

TOP

Related Classes of org.jboss.metatype.api.types.MetaType

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.