// TODO
}
// validation: check object instance
if(objectInstance == null) {
throw new ObjectBuilderException(
"No object instance has been assigned to this builder; cannot continue with build!");
}
// validation: check object property
if(objectProperty == null) {
throw new ObjectBuilderException(
"No object property has been assigned to this builder; cannot continue with build!");
}
// check if property is a meta-property (i.e., building data for this property actually causes data for other
// properties to be created/built)
// TODO
// check if object data is provided (for building non-meta property data; datum is ignored for meta-properties)
// TODO
if(datum == null) {
throw new ObjectBuilderException("No object datum provided for this builder; cannot continue with build!");
}
// check if property name contains a placeholder
Pattern p = Pattern.compile(".*(\\{\\w+\\}).*");
Matcher m = p.matcher(objectProperty.getName());
if(m.matches()) {
logger.debug("object property name contains a placeholder: " + m.group());
if(StringUtils.stripToNull(placeholderValue) == null) {
throw new ObjectBuilderException(
"Property name contains a placeholder, but no placeholder value was provided!");
}
m.replaceAll(placeholderValue);
}