Package org.jboss.dmr

Examples of org.jboss.dmr.ModelType


    private void validatePool(ModelNode address, ModelNode resourceDescription, ModelNode resource) {

        for (AttributeDefinition attr : POOL_ATTRIBUTES) {
            final String name = attr.getName();
            final ModelType expectedType = attr.getType();
            assertTrue(resourceDescription.get(ATTRIBUTES, name).isDefined());
            assertEquals(ModelType.STRING, resourceDescription.get(ATTRIBUTES, name, DESCRIPTION).getType());
            assertEquals(expectedType, resourceDescription.get(ATTRIBUTES, name, TYPE).asType());

            assertTrue(name + " is not defined", resource.get(name).isDefined());
View Full Code Here


    }

    public static List<AttributeDefinition> getAttributesFromPlugin(StatisticsPlugin plugin) {
        LinkedList<AttributeDefinition> result = new LinkedList<>();
        for (String name : plugin.getNames()) {
            ModelType modelType = ModelType.STRING;
            if (plugin.getType(name) == int.class) {
                modelType = ModelType.INT;
            }
            if (plugin.getType(name) == long.class) {
                modelType = ModelType.LONG;
View Full Code Here


        ModelNode typeNode = currentDescription.hasDefined(TYPE) ? currentDescription.get(TYPE) : null;
        ModelNode valueTypeNode = currentDescription.hasDefined(VALUE_TYPE) ? currentDescription.get(VALUE_TYPE) : null;

        ModelType type;
        try {
            type = typeNode.asType();
        } catch (Exception e) {
            errors.add(validationElement.createValidationFailure("Invalid type " + currentDescription.asString()));
            return;
View Full Code Here


        ModelNode typeNode = currentDescription.hasDefined(TYPE) ? currentDescription.get(TYPE) : null;
        ModelNode valueTypeNode = currentDescription.hasDefined(VALUE_TYPE) ? currentDescription.get(VALUE_TYPE) : null;

        ModelType type;
        try {
            type = typeNode.asType();
        } catch (Exception e) {
            errors.add(validationElement.createValidationFailure("Invalid type " + currentDescription.asString()));
            return;
View Full Code Here

            Map<String, ModelNode> attributes = new HashMap<String, ModelNode>();
            for (StatisticsPlugin plugin : plugins) {
                for (String name : plugin.getNames()) {
                    ModelNode node = new ModelNode();
                    node.get(DESCRIPTION).set(plugin.getDescription(name));
                    ModelType modelType = ModelType.STRING;
                    if (plugin.getType(name) == int.class) {
                        modelType = ModelType.INT;
                    }
                    if (plugin.getType(name) == long.class) {
                        modelType = ModelType.LONG;
View Full Code Here

                throw MESSAGES.unknownType(modelType);
        }
    }

    TypeConverter getConverter(ModelNode typeNode, ModelNode valueTypeNode) {
        ModelType modelType = getType(typeNode);
        if (modelType == null) {
            return new ComplexTypeConverter(typeNode);
        }
        return getConverter(modelType, valueTypeNode);
    }
View Full Code Here

        final ModelType valueType;
        OpenType<?> openType;

        ObjectTypeConverter(ModelNode valueTypeNode) {
            this.valueTypeNode = nullNodeAsUndefined(valueTypeNode);
            ModelType valueType = getType(valueTypeNode);
            this.valueType = valueType == ModelType.UNDEFINED ? null : valueType;
        }
View Full Code Here

        public boolean isGraphable() {
            return isRuntime() && isNumeric();
        }

        public boolean isNumeric() {
            ModelType type = getType();
            return (type == ModelType.BIG_DECIMAL) ||
                   (type == ModelType.BIG_INTEGER) ||
                   (type == ModelType.DOUBLE) ||
                   (type == ModelType.INT) ||
                   (type == ModelType.LONG);
View Full Code Here

        if(descr.has(Util.REQUEST_PROPERTIES)) {
            args = new HashMap<String,ArgumentWithValue>();
            final List<Property> propList = descr.get(Util.REQUEST_PROPERTIES).asPropertyList();
            for (Property prop : propList) {
                final ModelNode propDescr = prop.getValue();
                ModelType type = null;
                CommandLineCompleter valueCompleter = null;
                ArgumentValueConverter valueConverter = null;
                if(propConverters != null) {
                    valueConverter = propConverters.get(prop.getName());
                }
View Full Code Here

  public static Map<String, Object> getAsMap(final ModelNode node) {
    Map<String, Object> properties = new HashMap<String, Object>();
    for (String key : node.keys()) {
     
      ModelNode value = node.get(key);
      ModelType t = value.getType();
     
      switch (t) {
     
      case BIG_DECIMAL:  properties.put(key, value.asBigDecimal());
                break;
View Full Code Here

TOP

Related Classes of org.jboss.dmr.ModelType

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.