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 };
}
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);
}
}
Aggregations