Search in sources :

Example 1 with AbstractAttributeDefinitionBuilder

use of org.jboss.as.controller.AbstractAttributeDefinitionBuilder in project wildfly by wildfly.

the class PooledConnectionFactoryDefinition method copy.

private static AttributeDefinition copy(AttributeDefinition attribute, AttributeAccess.Flag flag) {
    AbstractAttributeDefinitionBuilder builder;
    if (attribute instanceof SimpleListAttributeDefinition) {
        builder = new SimpleListAttributeDefinition.Builder((SimpleListAttributeDefinition) attribute);
        // TODO remove once WFCORE-95 is fixed
        ((SimpleListAttributeDefinition.Builder) builder).setListValidator(attribute.getValidator());
    } else if (attribute instanceof SimpleMapAttributeDefinition) {
        builder = new SimpleMapAttributeDefinition.Builder((SimpleMapAttributeDefinition) attribute);
    } else if (attribute instanceof PrimitiveListAttributeDefinition) {
        builder = new PrimitiveListAttributeDefinition.Builder((PrimitiveListAttributeDefinition) attribute);
        // TODO remove once WFCORE-95 is fixed
        ((PrimitiveListAttributeDefinition.Builder) builder).setListValidator(attribute.getValidator());
    } else {
        builder = new SimpleAttributeDefinitionBuilder((SimpleAttributeDefinition) attribute);
    }
    builder.setFlags(flag);
    return builder.build();
}
Also used : SimpleListAttributeDefinition(org.jboss.as.controller.SimpleListAttributeDefinition) AbstractAttributeDefinitionBuilder(org.jboss.as.controller.AbstractAttributeDefinitionBuilder) AbstractAttributeDefinitionBuilder(org.jboss.as.controller.AbstractAttributeDefinitionBuilder) SimpleAttributeDefinitionBuilder(org.jboss.as.controller.SimpleAttributeDefinitionBuilder) SimpleAttributeDefinition(org.jboss.as.controller.SimpleAttributeDefinition) SimpleAttributeDefinitionBuilder(org.jboss.as.controller.SimpleAttributeDefinitionBuilder) SimpleMapAttributeDefinition(org.jboss.as.controller.SimpleMapAttributeDefinition) PrimitiveListAttributeDefinition(org.jboss.as.controller.PrimitiveListAttributeDefinition)

Example 2 with AbstractAttributeDefinitionBuilder

use of org.jboss.as.controller.AbstractAttributeDefinitionBuilder in project wildfly by wildfly.

the class PooledConnectionFactoryDefinition method copy.

private static AttributeDefinition copy(AttributeDefinition attribute, AttributeAccess.Flag flag) {
    AbstractAttributeDefinitionBuilder builder;
    if (attribute instanceof SimpleListAttributeDefinition) {
        builder = new SimpleListAttributeDefinition.Builder((SimpleListAttributeDefinition) attribute);
        // TODO remove once WFCORE-95 is fixed
        ((SimpleListAttributeDefinition.Builder) builder).setListValidator(attribute.getValidator());
    } else if (attribute instanceof SimpleMapAttributeDefinition) {
        builder = new SimpleMapAttributeDefinition.Builder((SimpleMapAttributeDefinition) attribute);
    } else if (attribute instanceof PrimitiveListAttributeDefinition) {
        builder = new PrimitiveListAttributeDefinition.Builder((PrimitiveListAttributeDefinition) attribute);
        // TODO remove once WFCORE-95 is fixed
        ((PrimitiveListAttributeDefinition.Builder) builder).setListValidator(attribute.getValidator());
    } else {
        builder = new SimpleAttributeDefinitionBuilder((SimpleAttributeDefinition) attribute);
    }
    builder.setFlags(flag);
    return builder.build();
}
Also used : SimpleListAttributeDefinition(org.jboss.as.controller.SimpleListAttributeDefinition) AbstractAttributeDefinitionBuilder(org.jboss.as.controller.AbstractAttributeDefinitionBuilder) AbstractAttributeDefinitionBuilder(org.jboss.as.controller.AbstractAttributeDefinitionBuilder) SimpleAttributeDefinitionBuilder(org.jboss.as.controller.SimpleAttributeDefinitionBuilder) SimpleAttributeDefinition(org.jboss.as.controller.SimpleAttributeDefinition) SimpleAttributeDefinitionBuilder(org.jboss.as.controller.SimpleAttributeDefinitionBuilder) SimpleMapAttributeDefinition(org.jboss.as.controller.SimpleMapAttributeDefinition) PrimitiveListAttributeDefinition(org.jboss.as.controller.PrimitiveListAttributeDefinition)

Aggregations

AbstractAttributeDefinitionBuilder (org.jboss.as.controller.AbstractAttributeDefinitionBuilder)2 PrimitiveListAttributeDefinition (org.jboss.as.controller.PrimitiveListAttributeDefinition)2 SimpleAttributeDefinition (org.jboss.as.controller.SimpleAttributeDefinition)2 SimpleAttributeDefinitionBuilder (org.jboss.as.controller.SimpleAttributeDefinitionBuilder)2 SimpleListAttributeDefinition (org.jboss.as.controller.SimpleListAttributeDefinition)2 SimpleMapAttributeDefinition (org.jboss.as.controller.SimpleMapAttributeDefinition)2