import java.util.Collections;
import java.util.List;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.simantics.db.ReadGraph;
import org.simantics.db.Resource;
import org.simantics.db.WriteGraph;
public class SimpleLinkType implements ILinkType<StructuralResource,IStructuralObject> {
- static Logger LOGGER = Logger.getLogger("org.simantics.objmap");
+ static Logger LOGGER = LoggerFactory.getLogger(SimpleLinkType.class);
public Resource domainType;
public Class<?> rangeType;
public StructuralResource createDomainElement(WriteGraph g, IStructuralObject rangeElement)
throws MappingException {
try {
- if(LOGGER.isInfoEnabled())
- LOGGER.info("SimpleLinkType.createDomainElement " +
+ if(LOGGER.isTraceEnabled())
+ LOGGER.trace("SimpleLinkType.createDomainElement " +
rangeElement.toString()
);
if (rangeElement.getContext().size() == 0) {
public IStructuralObject createRangeElement(ReadGraph g, StructuralResource domainElement)
throws MappingException {
try {
- if(LOGGER.isInfoEnabled())
+ if(LOGGER.isTraceEnabled())
try {
- LOGGER.info("SimpleLinkType.createRangeElement " + NameUtils.getSafeName(g, domainElement.getResource()));
+ LOGGER.trace("SimpleLinkType.createRangeElement " + NameUtils.getSafeName(g, domainElement.getResource()));
} catch(DatabaseException e) {
throw new MappingException(e);
}
}
public boolean updateDomain(WriteGraph g, IBackwardMapping<StructuralResource,IStructuralObject> map, StructuralResource domainElement, IStructuralObject rangeElement) throws MappingException {
- if(LOGGER.isInfoEnabled())
+ if(LOGGER.isTraceEnabled())
try {
- LOGGER.info("SimpleLinkType.updateDomain " +
+ LOGGER.trace("SimpleLinkType.updateDomain " +
NameUtils.getSafeName(g, domainElement.getResource()) + " " +
rangeElement.toString()
);
public boolean updateRange(ReadGraph g, IForwardMapping<StructuralResource, IStructuralObject> map, StructuralResource domainElement, IStructuralObject rangeElement) throws MappingException {
- if(LOGGER.isInfoEnabled())
+ if(LOGGER.isTraceEnabled())
try {
- LOGGER.info("SimpleLinkType.updateRange " +
+ LOGGER.trace("SimpleLinkType.updateRange " +
NameUtils.getSafeName(g, domainElement.getResource()) + " " +
rangeElement.toString()
);