LdapUtils.setLdapAttributeType(targetTreeComponent, node, m.getExpression());
}
targetTreeComponent.setDirty();
}
if (node == null) {
throw new TreeMapperException("Cannot find the target node " + targetDE + " in the target tree.");
}
if (targetDE.charAt(0) == '[') {
String expr = m.getExpression();
String fixed = "Fixed ";
if (expr != null && expr.startsWith(fixed)) {
String expr1 = StringUtils.removeStart(expr, fixed);
Node source_generator = treeMapper.m_sourceTreeComponent.expandTreeAndLookForNode(expr1);
if (source_generator != null) {
addMapping(nodeMapping);
int k1 = fixed.length(), k2 = expr.length();
try {
// remove "Fixed [" and "]" from the expr
node.m_mappingKits.fixGeneratorPath(expr.substring(k1 + 1, k2 - 1));
} catch (Exception e) {
throw new TreeMapperException("Cannot define the fixed multiplicity for the target node "
+ targetDE + ".");
}
}
} else {
node.m_mappingKits.resetGenerator();
}
} else {
String err = checkMapping.checkSource(m.getExpression());
addMapping(nodeMapping);
node.setTargetMappedFlag(true);
treeMapper.updateMapAreaTables(m);
if (node.isLoopNode()) {
node.setSourcePath(m.getExpression());
}
if (err != null && !err.equals("")) {
throw new TreeMapperException("target: " + targetDE + "\nsource: " + m.getExpression()
+ "\nsource expression contains errors\n" + err);
}
if (LdapUtils.isLdapClassEntryCommand(node.getTreeComponent(), node)) {
node.setCmd(m.getExpression());
}