if (classDef.getParent() instanceof ComponentMapping) {
String compType = getComponentTypeOf((ComponentMapping) classDef.getParent());
ComponentTypeMapping compTypeMapping = styleMapping.getComponentType(compType);
if (compTypeMapping != null) {
ClassType type = compTypeMapping.getClassType(classDef.getType());
if (type == null) {
throw new ArchMapperException("The class type "+ classDef.getType() +
" of class "+ classDef.getClassName() + " is not defined!");
}
return (type.isSingleton() == Boolean.TRUE);
}
} else {
String connType = getConnectorTypeOf((ConnectorMapping) classDef.getParent());
ConnectorTypeMapping connTypeMapping = styleMapping.getConnectorTypeMapping(connType);
if (connTypeMapping != null) {
ClassType type = connTypeMapping.getClassType(classDef.getType());
if (type == null) {
throw new ArchMapperException("The class type "+ classDef.getType() +
" of class "+ classDef.getClassName() + " is not defined!");
}
return (type.isSingleton() == Boolean.TRUE);
}
}
return false;
}