public static <T> MutableResourceAttributeDefinition<T> createResourceAttributeDefinition(QName name, QName typeName, PrismContext prismContext) { return new ResourceAttributeDefinitionImpl<T>(name, typeName, prismContext); }
@Override public <X> ResourceAttributeDefinitionImpl<X> createAttributeDefinition(QName name, QName typeName) { ResourceAttributeDefinitionImpl<X> propDef = new ResourceAttributeDefinitionImpl<>(name, typeName, prismContext); add(propDef); return propDef; }
@NotNull @Override public ResourceAttributeDefinitionImpl<T> clone() { ResourceAttributeDefinitionImpl<T> clone = new ResourceAttributeDefinitionImpl<>(getName(), getTypeName(), getPrismContext()); copyDefinitionData(clone); return clone; }
private MutablePrismPropertyDefinition createResourceAttributeDefinition(QName elementName, QName typeName, PrismContext prismContext, XSAnnotation annotation) throws SchemaException { ResourceAttributeDefinitionImpl attrDef = new ResourceAttributeDefinitionImpl(elementName, typeName, prismContext); // nativeAttributeName Element nativeAttrElement = SchemaProcessorUtil.getAnnotationElement(annotation, MidPointConstants.RA_NATIVE_ATTRIBUTE_NAME); String nativeAttributeName = nativeAttrElement == null ? null : nativeAttrElement.getTextContent(); if (!StringUtils.isEmpty(nativeAttributeName)) { attrDef.setNativeAttributeName(nativeAttributeName); } // frameworkAttributeName Element frameworkAttrElement = SchemaProcessorUtil.getAnnotationElement(annotation, MidPointConstants.RA_FRAMEWORK_ATTRIBUTE_NAME); String frameworkAttributeName = frameworkAttrElement == null ? null : frameworkAttrElement.getTextContent(); if (!StringUtils.isEmpty(frameworkAttributeName)) { attrDef.setFrameworkAttributeName(frameworkAttributeName); } // returnedByDefault attrDef.setReturnedByDefault(SchemaProcessorUtil.getAnnotationBoolean(annotation, MidPointConstants.RA_RETURNED_BY_DEFAULT_NAME)); return attrDef; }
private ResourceAttribute<String> createStringAttribute(QName attrName, String value) { ResourceAttributeDefinition testAttrDef = new ResourceAttributeDefinitionImpl(attrName, DOMUtil.XSD_STRING, getPrismContext()); ResourceAttribute<String> testAttr = testAttrDef.instantiate(); testAttr.setRealValue(value); return testAttr; }