Search in sources :

Example 1 with ObjectListAttributeDefinition

use of org.jboss.as.controller.ObjectListAttributeDefinition in project teiid by teiid.

the class VDBMetadataMapper method getAttributeDefinitions.

public AttributeDefinition[] getAttributeDefinitions() {
    ObjectListAttributeDefinition properties = ObjectListAttributeDefinition.Builder.of(PROPERTIES, PropertyMetaDataMapper.INSTANCE.getAttributeDefinition()).build();
    ObjectListAttributeDefinition vdbimports = ObjectListAttributeDefinition.Builder.of(IMPORT_VDBS, VDBImportMapper.INSTANCE.getAttributeDefinition()).build();
    ObjectListAttributeDefinition models = ObjectListAttributeDefinition.Builder.of(MODELS, ModelMetadataMapper.INSTANCE.getAttributeDefinition()).build();
    ObjectListAttributeDefinition translators = ObjectListAttributeDefinition.Builder.of(OVERRIDE_TRANSLATORS, VDBTranslatorMetaDataMapper.INSTANCE.getAttributeDefinition()).build();
    ObjectListAttributeDefinition policies = ObjectListAttributeDefinition.Builder.of(DATA_POLICIES, DataPolicyMetadataMapper.INSTANCE.getAttributeDefinition()).build();
    return new AttributeDefinition[] { new SimpleAttributeDefinition(VDBNAME, ModelType.STRING, false), new SimpleAttributeDefinition(CONNECTIONTYPE, ModelType.INT, false), new SimpleAttributeDefinition(STATUS, ModelType.BOOLEAN, false), new SimpleAttributeDefinition(VERSION, ModelType.STRING, false), new SimpleAttributeDefinition(VDB_DESCRIPTION, ModelType.BOOLEAN, true), new SimpleAttributeDefinition(XML_DEPLOYMENT, ModelType.BOOLEAN, true), properties, vdbimports, models, translators, policies };
}
Also used : ObjectListAttributeDefinition(org.jboss.as.controller.ObjectListAttributeDefinition) SimpleAttributeDefinition(org.jboss.as.controller.SimpleAttributeDefinition) StringListAttributeDefinition(org.jboss.as.controller.StringListAttributeDefinition) ObjectListAttributeDefinition(org.jboss.as.controller.ObjectListAttributeDefinition) ObjectTypeAttributeDefinition(org.jboss.as.controller.ObjectTypeAttributeDefinition) AttributeDefinition(org.jboss.as.controller.AttributeDefinition) SimpleAttributeDefinition(org.jboss.as.controller.SimpleAttributeDefinition)

Example 2 with ObjectListAttributeDefinition

use of org.jboss.as.controller.ObjectListAttributeDefinition in project camunda-bpm-platform by camunda.

the class CustomMarshaller method getValueType.

/**
 * Obtain the 'valueType' of the ObjectListAttributeDefinition through reflection because they are private in Wildfly 8.
 */
public static AttributeDefinition getValueType(Object instance, Class clazz) {
    try {
        Field valueTypesField = clazz.getDeclaredField("valueType");
        valueTypesField.setAccessible(true);
        Object value = valueTypesField.get(instance);
        if (value != null) {
            if (AttributeDefinition.class.isAssignableFrom(value.getClass())) {
                return (AttributeDefinition) value;
            }
        }
        return (AttributeDefinition) value;
    } catch (Exception e) {
        throw new RuntimeException("Unable to get valueType.", e);
    }
}
Also used : Field(java.lang.reflect.Field) ObjectListAttributeDefinition(org.jboss.as.controller.ObjectListAttributeDefinition) ObjectTypeAttributeDefinition(org.jboss.as.controller.ObjectTypeAttributeDefinition) AttributeDefinition(org.jboss.as.controller.AttributeDefinition) XMLStreamException(javax.xml.stream.XMLStreamException)

Aggregations

AttributeDefinition (org.jboss.as.controller.AttributeDefinition)2 ObjectListAttributeDefinition (org.jboss.as.controller.ObjectListAttributeDefinition)2 ObjectTypeAttributeDefinition (org.jboss.as.controller.ObjectTypeAttributeDefinition)2 Field (java.lang.reflect.Field)1 XMLStreamException (javax.xml.stream.XMLStreamException)1 SimpleAttributeDefinition (org.jboss.as.controller.SimpleAttributeDefinition)1 StringListAttributeDefinition (org.jboss.as.controller.StringListAttributeDefinition)1