package de.uka.ipd.consensus.impl;

import org.tm4j.topicmap.Association;
import org.tm4j.topicmap.Member;
import org.tm4j.topicmap.Occurrence;
import org.tm4j.topicmap.Topic;
import org.tm4j.topicmap.TopicMapProcessingException;
import org.tm4j.topicmap.utils.WalkerFilterAdapter;

/**
 * 
 * TODO
 * @author Thomas Much
 * @version 2006-06-14
 */
public class XTMExportInternalFilter extends WalkerFilterAdapter {
	
	private OntologyManagerImpl omi;


	public XTMExportInternalFilter(OntologyManagerImpl omi) {
		this.omi = omi;
	}


	public boolean startAssociation(Association ass) throws TopicMapProcessingException {
		if (omi.isInternalTopicType( ass.getType() )) {
			return false;
		}
		else {
			return super.startAssociation(ass);
		}
	}

	
	public boolean startMember(Member member) throws TopicMapProcessingException {
		if (omi.isInternalTopicType( member.getRoleSpec() )) {
			return false;
		}
		else {
			return super.startMember(member);
		}
	}

	
	public boolean startOccurrence(Occurrence occ) throws TopicMapProcessingException {
		if (omi.isInternalTopicType( occ.getType() )) {
			return false;
		}
		else {
			return super.startOccurrence(occ);
		}
	}


	public boolean startTopic(Topic topic) throws TopicMapProcessingException {
		if (omi.isInternalTopicType( topic )) {
			return false;
		}
		else {
			return super.startTopic(topic);
		}
	}

}
