Package org.rhq.core.domain.configuration.definition

Examples of org.rhq.core.domain.configuration.definition.PropertyDefinition


    for (ManagedProperty managedProperty : managedProperties.values()) {
      String propertyName = managedProperty.getName();
      if (prefix != null) {
        propertyName = prefix + "." + propertyName; //$NON-NLS-1$
      }
      PropertyDefinition propertyDefinition = configDefinition.get(propertyName);
      if (propertyDefinition == null) {
        // The managed property is not defined in the configuration
        continue;
      }
      populateManagedPropertyFromProperty(managedProperty,propertyDefinition, configuration);
View Full Code Here


      if (memberPropDefs.isEmpty())
        throw new IllegalStateException(
            "PropertyDefinitionMap doesn't contain any member PropertyDefinitions."); //$NON-NLS-1$
      // NOTE: We assume member prop defs are all of the same type, since
      // for MapCompositeMetaTypes, they have to be.
      PropertyDefinition mapMemberPropDef = memberPropDefs.values()
          .iterator().next();
      MetaType mapMemberMetaType = convertPropertyDefinitionToMetaType(mapMemberPropDef);
      memberMetaType = new MapCompositeMetaType(mapMemberMetaType);
    } else {
      throw new IllegalStateException(
View Full Code Here

            groupDef.setOrder(groupOrderIndex++);
            List<JAXBElement<? extends ConfigurationProperty>> groupProperties = group.getConfigurationProperty();
            int propertyOrderIndex = 0;
            for (JAXBElement<? extends ConfigurationProperty> jaxbProperty : groupProperties) {
                ConfigurationProperty uncastedProperty = jaxbProperty.getValue();
                PropertyDefinition propertyDefinition = parseProperty(uncastedProperty, propertyOrderIndex,
                    defaultConfiguration);
                if (configurationDefinition != null) {
                    propertyDefinition.setPropertyGroupDefinition(groupDef);
                    configurationDefinition.put(propertyDefinition);
                    propertyOrderIndex++;
                }
            }
        }

        int propertyOrderIndex = 0;
        for (JAXBElement<? extends ConfigurationProperty> jaxbProperty : properties) {
            ConfigurationProperty uncastedProperty = jaxbProperty.getValue();
            PropertyDefinition propertyDefinition = parseProperty(uncastedProperty, propertyOrderIndex,
                defaultConfiguration);
            if (configurationDefinition != null) {
                configurationDefinition.put(propertyDefinition);
                propertyOrderIndex++;
            }
View Full Code Here

        return parseProperty(uncastedProperty, orderIndex, null);
    }

    private static PropertyDefinition parseProperty(ConfigurationProperty uncastedProperty, int orderIndex,
        AbstractPropertyMap defaultConfigurationParentMap) throws InvalidPluginDescriptorException {
        PropertyDefinition property = null;
        if (uncastedProperty instanceof SimpleProperty) {
            property = parseSimpleProperty((SimpleProperty) uncastedProperty, defaultConfigurationParentMap);
        } else if (uncastedProperty instanceof ListProperty) {
            property = parseListProperty((ListProperty) uncastedProperty);
        } else if (uncastedProperty instanceof MapProperty) {
            property = parseMapProperty((MapProperty) uncastedProperty, defaultConfigurationParentMap);
        } else if (uncastedProperty instanceof DynamicProperty) {
            property = parseDynamicProperty((DynamicProperty) uncastedProperty);
        }

        if (property != null) {
            property.setOrder(orderIndex);
        }

        return property;
    }
View Full Code Here

    private static PropertyDefinitionList parseListProperty(ListProperty listProperty)
        throws InvalidPluginDescriptorException {
        String description = parseMultiValue(listProperty.getDescription(), listProperty.getLongDescription());
        JAXBElement<? extends ConfigurationProperty> memberProperty = listProperty.getConfigurationProperty();
        PropertyDefinition memberDefinition = (memberProperty != null) ? parseProperty(memberProperty.getValue(), 0)
            : null;

        PropertyDefinitionList list = new PropertyDefinitionList(listProperty.getName().intern(), description,
            listProperty.isRequired(), memberDefinition);
View Full Code Here

        // Process the map's nested properties.
        List<JAXBElement<? extends ConfigurationProperty>> nestedProperties = mapProperty.getConfigurationProperty();
        int propertyOrderIndex = 0;
        for (JAXBElement<? extends ConfigurationProperty> jaxbProperty : nestedProperties) {
            ConfigurationProperty uncastedProperty = jaxbProperty.getValue();
            PropertyDefinition propertyDefinition = parseProperty(uncastedProperty, propertyOrderIndex++, propMap);
            propDefMap.put(propertyDefinition);
        }
        return propDefMap;
    }
View Full Code Here

            propertySwitch(def, prop, replacementCandidates);
        }
    }
   
    private static void traverse(PropertyDefinitionList definition, PropertyList list, List<PropertySimple> replacementCandidates) {
        PropertyDefinition memberDef = definition.getMemberDefinition();
        List<Property> members = list.getList();
        for(Property prop : members) {
            propertySwitch(memberDef, prop, replacementCandidates);
        }
    }
View Full Code Here

        Configuration targetConfig = createDefaultConfiguration(definition);

        if (existingConfiguration != null) {
            for (Map.Entry<String, PropertyDefinition> e : definition.getPropertyDefinitions().entrySet()) {
                String name = e.getKey();
                PropertyDefinition def = e.getValue();

                Property source = existingConfiguration.get(name);
                if (source != null) {
                    Property target = targetConfig.get(name);
                    adaptProperty(source, target, def, targetConfig, adaptReadonlyProperties);
View Full Code Here

                for (PropertyDefinition childPropertyDefinition : childPropertyDefinitions.values()) {
                    createDefaultProperty(childPropertyDefinition, (PropertyMap) property);
                }
            } else if (propertyDefinition instanceof PropertyDefinitionList) {
                property = new PropertyList(propertyDefinition.getName());
                PropertyDefinition listMemberPropertyDefinition = ((PropertyDefinitionList) propertyDefinition)
                    .getMemberDefinition();
                if (listMemberPropertyDefinition.isRequired()) {
                    if (listMemberPropertyDefinition instanceof PropertyDefinitionMap) {
                        // member property is a list-o-maps, create a default child map if appropriate
                        PropertyDefinitionMap listMemberDefinitionMap = (PropertyDefinitionMap) listMemberPropertyDefinition;
                        PropertyMap listMap = new PropertyMap(listMemberDefinitionMap.getName());
                        createDefaultProperty(listMemberDefinitionMap, listMap);
View Full Code Here

                PropertyDefinitionMap propertyDefinitionMap = (PropertyDefinitionMap) propertyDefinition;
                normalizePropertyMap(propertyMap, propertyDefinitionMap, false,
                    false); // TODO do we want to pass normalizeRequired/OptionalDefaults?
            } else if (propertyDefinition instanceof PropertyDefinitionList) {
                PropertyDefinitionList propertyDefinitionList = (PropertyDefinitionList) propertyDefinition;
                PropertyDefinition listMemberPropertyDefinition = propertyDefinitionList.getMemberDefinition();

                // If property is a List of Maps, iterate the list and recurse into each Map and normalize its child properties.
                if (listMemberPropertyDefinition instanceof PropertyDefinitionMap) {
                    PropertyDefinitionMap propertyDefinitionMap = (PropertyDefinitionMap) listMemberPropertyDefinition;
                    PropertyList propertyList = parentPropertyMap.getList(propertyDefinition.getName());
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.configuration.definition.PropertyDefinition

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.