
de.uni.freiburg.iig.telematik.jagal.ts.serialize.TSSerializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of JAGAL Show documentation
Show all versions of JAGAL Show documentation
JAGAL provides implementations for directed graphs (weighted and unweighted) and various types of transition systems as well as utils for graph traversal and modification.
The newest version!
package de.uni.freiburg.iig.telematik.jagal.ts.serialize;
import de.invation.code.toval.validate.ParameterException;
import de.invation.code.toval.validate.ParameterException.ErrorCode;
import de.invation.code.toval.validate.Validate;
import de.uni.freiburg.iig.telematik.jagal.ts.TSType;
import de.uni.freiburg.iig.telematik.jagal.ts.abstr.AbstractState;
import de.uni.freiburg.iig.telematik.jagal.ts.abstr.AbstractTransitionRelation;
import de.uni.freiburg.iig.telematik.jagal.ts.abstr.AbstractTransitionSystem;
public abstract class TSSerializer< S extends AbstractState,
T extends AbstractTransitionRelation,
O extends Object>{
protected AbstractTransitionSystem transitionSystem = null;
public TSSerializer(AbstractTransitionSystem ts) throws ParameterException{
validateTransitionSystem(ts);
}
private void validateTransitionSystem(AbstractTransitionSystem ts) throws ParameterException{
Validate.notNull(ts);
Class> requiredClassType = TSType.getClassType(acceptedNetType());
if(!(requiredClassType.isAssignableFrom(ts.getClass()))){
throw new ParameterException(ErrorCode.INCOMPATIBILITY, "The serializer requires nets of type \""+requiredClassType+"\"\n The given net is of type \""+ts.getClass()+"\"");
}
this.transitionSystem = ts;
}
public AbstractTransitionSystem getTransitionSystem(){
return transitionSystem;
}
public abstract TSType acceptedNetType();
public abstract String serialize() throws SerializationException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy