repo_name
stringlengths
7
104
file_path
stringlengths
13
198
context
stringlengths
67
7.15k
import_statement
stringlengths
16
4.43k
code
stringlengths
40
6.98k
prompt
stringlengths
227
8.27k
next_line
stringlengths
8
795
maeln/LambdaHindleyMilner
src/test/java/types/TFunctionTest.java
// Path: src/main/java/ast/Variable.java // public class Variable extends Expression { // private String name; // // public Variable(String name) { // this.name = name; // } // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // // // @Override // public Type infer(TypeInferenceEnv env) { // return env.lookup(this).instantiate(env); // } // // // //Object override // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // Variable variable = (Variable) o; // // return name != null ? name.equals(variable.name) : variable.name == null; // // } // // @Override // public int hashCode() { // return name != null ? name.hashCode() : 0; // } // // @Override // public String toString() { // return name; // } // } // // Path: src/main/java/inference/Substitution.java // public class Substitution extends Substitutable<Substitution> { // private HashMap<TVariable, Type> subs = new HashMap<>(); // // public Substitution() {} // // public Substitution(TVariable variable, Type type) { // subs.put(variable, type); // } // // private Substitution(Substitution previous) { // subs.putAll(previous.subs); // } // // public Substitution(List<TVariable> vars, List<Type> substitute) { // if(vars.size() != substitute.size()) // throw new IllegalArgumentException("Number of variables have to match number of types"); // // for (int i = 0; i < vars.size(); i++) subs.put(vars.get(i), substitute.get(i)); // } // // public List<TVariable> variables() { // return new LinkedList<>(subs.keySet()); // } // // public Type substituteOf(TVariable var) { // return subs.get(var); // } // // public Substitution composeWith(Substitution sub) { // Substitution substituted = new Substitution(sub); // substituted.apply(this); // subs.putAll(substituted.subs); // return this; // } // // @Override // public HashSet<TVariable> ftv() { // HashSet<TVariable> freeVars = new HashSet<>(); // for (TVariable var : variables()) freeVars.addAll(substituteOf(var).ftv()); // return freeVars; // } // // @Override // public Substitution substitute(TVariable var, Type t) { // for (TVariable variable : variables()) // subs.replace(variable, substituteOf(variable).substitute(var, t)); // return this; // } // // @Override // public String toString() { // return subs.toString(); // } // // @Override // public Substitution identity() { // return this; // } // } // // Path: src/main/java/types/TFunction.java // public static TFunction function(Type left, Type right) { // int hash = hash(left, right); // TFunction f = instantiated.get(hash); // if(f == null) { // f = new TFunction(left, right); // instantiated.put(hash, f); // } // return f; // } // // Path: src/main/java/types/TVariable.java // public static TVariable variable(String name) { // TVariable var = new TVariable(name); // if(!instantiated.add(var)) System.out.println("Creation avoidable : TVariable(" + name + ")"); // return var; // } // // Path: src/main/java/types/TVariable.java // public static List<TVariable> variables(String... names) { // List<TVariable> variables = new LinkedList<>(); // for (String name : names) variables.add(new TVariable(name)); // return variables; // }
import ast.Variable; import inference.Substitution; import org.junit.Before; import org.junit.Test; import java.util.*; import static org.junit.Assert.*; import static types.TFunction.function; import static types.TVariable.variable; import static types.TVariable.variables;
package types; /** * Created by valentin on 20/10/2016. */ public class TFunctionTest { private static final String name = "TEST"; @Test public void createFunction() throws Exception { Type left = variable(name); Type right = variable(name); TFunction fun = function(left, right); assertEquals("Should create a fresh function with correct left type", left, fun.left()); assertEquals("Should create a fresh function with correct right type", right, fun .right()); } @Test public void applyNotMatching() throws Exception {
// Path: src/main/java/ast/Variable.java // public class Variable extends Expression { // private String name; // // public Variable(String name) { // this.name = name; // } // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // // // @Override // public Type infer(TypeInferenceEnv env) { // return env.lookup(this).instantiate(env); // } // // // //Object override // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // Variable variable = (Variable) o; // // return name != null ? name.equals(variable.name) : variable.name == null; // // } // // @Override // public int hashCode() { // return name != null ? name.hashCode() : 0; // } // // @Override // public String toString() { // return name; // } // } // // Path: src/main/java/inference/Substitution.java // public class Substitution extends Substitutable<Substitution> { // private HashMap<TVariable, Type> subs = new HashMap<>(); // // public Substitution() {} // // public Substitution(TVariable variable, Type type) { // subs.put(variable, type); // } // // private Substitution(Substitution previous) { // subs.putAll(previous.subs); // } // // public Substitution(List<TVariable> vars, List<Type> substitute) { // if(vars.size() != substitute.size()) // throw new IllegalArgumentException("Number of variables have to match number of types"); // // for (int i = 0; i < vars.size(); i++) subs.put(vars.get(i), substitute.get(i)); // } // // public List<TVariable> variables() { // return new LinkedList<>(subs.keySet()); // } // // public Type substituteOf(TVariable var) { // return subs.get(var); // } // // public Substitution composeWith(Substitution sub) { // Substitution substituted = new Substitution(sub); // substituted.apply(this); // subs.putAll(substituted.subs); // return this; // } // // @Override // public HashSet<TVariable> ftv() { // HashSet<TVariable> freeVars = new HashSet<>(); // for (TVariable var : variables()) freeVars.addAll(substituteOf(var).ftv()); // return freeVars; // } // // @Override // public Substitution substitute(TVariable var, Type t) { // for (TVariable variable : variables()) // subs.replace(variable, substituteOf(variable).substitute(var, t)); // return this; // } // // @Override // public String toString() { // return subs.toString(); // } // // @Override // public Substitution identity() { // return this; // } // } // // Path: src/main/java/types/TFunction.java // public static TFunction function(Type left, Type right) { // int hash = hash(left, right); // TFunction f = instantiated.get(hash); // if(f == null) { // f = new TFunction(left, right); // instantiated.put(hash, f); // } // return f; // } // // Path: src/main/java/types/TVariable.java // public static TVariable variable(String name) { // TVariable var = new TVariable(name); // if(!instantiated.add(var)) System.out.println("Creation avoidable : TVariable(" + name + ")"); // return var; // } // // Path: src/main/java/types/TVariable.java // public static List<TVariable> variables(String... names) { // List<TVariable> variables = new LinkedList<>(); // for (String name : names) variables.add(new TVariable(name)); // return variables; // } // Path: src/test/java/types/TFunctionTest.java import ast.Variable; import inference.Substitution; import org.junit.Before; import org.junit.Test; import java.util.*; import static org.junit.Assert.*; import static types.TFunction.function; import static types.TVariable.variable; import static types.TVariable.variables; package types; /** * Created by valentin on 20/10/2016. */ public class TFunctionTest { private static final String name = "TEST"; @Test public void createFunction() throws Exception { Type left = variable(name); Type right = variable(name); TFunction fun = function(left, right); assertEquals("Should create a fresh function with correct left type", left, fun.left()); assertEquals("Should create a fresh function with correct right type", right, fun .right()); } @Test public void applyNotMatching() throws Exception {
Substitution sub = new Substitution(variable("NOT MATCHING"), variable("NOT MATCHING"));
maeln/LambdaHindleyMilner
src/main/java/ast/Application.java
// Path: src/main/java/inference/environements/TypeInferenceEnv.java // public class TypeInferenceEnv { // private TypeGenerator typeGenerator; // private TypeEnv typeEnv; // private List<Constraint> constraints; // // public TypeInferenceEnv() { // typeGenerator = new TypeGenerator(); // typeEnv = new TypeEnv(); // constraints = new LinkedList<>(); // } // // private TypeInferenceEnv(TypeInferenceEnv globalEnv) { // typeGenerator = globalEnv.typeGenerator; // typeEnv = new TypeEnv().mergeWith(globalEnv.typeEnv); // constraints = globalEnv.constraints(); // } // // public TypeInferenceEnv inEnv(Variable var, Scheme scheme) { // TypeInferenceEnv localEnv = new TypeInferenceEnv(this); // localEnv.bind(var, scheme); // return localEnv; // } // // public void bind(Variable var, Scheme scheme) { // typeEnv.extend(var, scheme); // } // // public void unify(Type t1, Type t2) { // constraints.add(new Constraint(t1, t2)); // } // // // public Type instantiate(Scheme scheme) { // // List<Type> freshVars = new LinkedList<>(); // // scheme.variables().forEach(var -> freshVars.add(freshName())); // // // // Type instatiation = scheme.type().duplicate(); // // instatiation.apply(new Substitution(scheme.variables(), freshVars)); // // // // return instatiation; // // } // // public Scheme generalize(Type t) { // HashSet<TVariable> freeVars = t.ftv(); // freeVars.removeAll(typeEnv.ftv()); // return forall(new ArrayList<>(freeVars), t); // } // // public Scheme lookup(Variable variable) { // return typeEnv.lookup(variable); // } // // public TVariable freshName() { // return typeGenerator.freshName(); // } // // public List<Constraint> constraints() { // return constraints; // } // } // // Path: src/main/java/types/TVariable.java // public class TVariable extends Type { // private final String name; // private final static HashSet<TVariable> instantiated = new HashSet<>(); // // private TVariable(String name) { // this.name = name; // } // // public String name() { // return name; // } // // public static TVariable variable(String name) { // TVariable var = new TVariable(name); // if(!instantiated.add(var)) System.out.println("Creation avoidable : TVariable(" + name + ")"); // return var; // } // // public static List<TVariable> variables(String... names) { // List<TVariable> variables = new LinkedList<>(); // for (String name : names) variables.add(new TVariable(name)); // return variables; // } // // @Override // public Type substitute(TVariable var, Type type) { // return this.equals(var) ? type : this; // } // // @Override // public HashSet<TVariable> ftv() { // return new HashSet<>(Collections.singleton(this)); // } // // @Override // protected Substitution unifyWith(TFunction fun) { // return bind(this, fun); // } // // @Override // protected Substitution unifyWith(TConstructor cons) { // return bind(this, cons); // } // // @Override // public Type instantiate(Substitution sub) { // return sub.variables().contains(this) ? sub.substituteOf(this) : this; // } // // @Override // protected Substitution unifyWith(TVariable var) { // return bind(this, var); // } // // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // TVariable tVariable = (TVariable) o; // // return name.equals(tVariable.name); // // } // // @Override // public int hashCode() { // return ("TVariable_" + name).hashCode(); // } // // @Override // public String toString() { // return name(); // } // } // // Path: src/main/java/types/Type.java // public abstract class Type extends Substitutable<Type> implements Unifyable{ // // @Override // public Type identity() { // return this; // } // // @Override // public final Substitution unifyWith(Type type) { // if(this.equals(type)) return new Substitution(); // if(type instanceof TVariable) return unifyWith((TVariable) type); // if(type instanceof TFunction) return unifyWith((TFunction) type); // if(type instanceof TConstructor) return unifyWith((TConstructor) type); // throw new UnificationFailException(this, type); // } // // protected Substitution unifyWith(TVariable var) { // return bind(var, this); // } // // protected Substitution unifyWith(TFunction fun) { // throw new UnificationFailException(this, fun); // } // // protected Substitution unifyWith(TConstructor cons) { // throw new UnificationFailException(this, cons); // } // // public abstract Type instantiate(Substitution sub); // } // // Path: src/main/java/types/TFunction.java // public static TFunction function(Type left, Type right) { // int hash = hash(left, right); // TFunction f = instantiated.get(hash); // if(f == null) { // f = new TFunction(left, right); // instantiated.put(hash, f); // } // return f; // }
import inference.environements.TypeInferenceEnv; import types.TVariable; import types.Type; import java.util.Arrays; import static types.TFunction.function;
package ast; /** * Represent an Application in Lambda calculus. */ public class Application extends Expression { private Expression left; private Expression right; public Application(Expression left, Expression right) { this.left = left; this.right = right; } @Override
// Path: src/main/java/inference/environements/TypeInferenceEnv.java // public class TypeInferenceEnv { // private TypeGenerator typeGenerator; // private TypeEnv typeEnv; // private List<Constraint> constraints; // // public TypeInferenceEnv() { // typeGenerator = new TypeGenerator(); // typeEnv = new TypeEnv(); // constraints = new LinkedList<>(); // } // // private TypeInferenceEnv(TypeInferenceEnv globalEnv) { // typeGenerator = globalEnv.typeGenerator; // typeEnv = new TypeEnv().mergeWith(globalEnv.typeEnv); // constraints = globalEnv.constraints(); // } // // public TypeInferenceEnv inEnv(Variable var, Scheme scheme) { // TypeInferenceEnv localEnv = new TypeInferenceEnv(this); // localEnv.bind(var, scheme); // return localEnv; // } // // public void bind(Variable var, Scheme scheme) { // typeEnv.extend(var, scheme); // } // // public void unify(Type t1, Type t2) { // constraints.add(new Constraint(t1, t2)); // } // // // public Type instantiate(Scheme scheme) { // // List<Type> freshVars = new LinkedList<>(); // // scheme.variables().forEach(var -> freshVars.add(freshName())); // // // // Type instatiation = scheme.type().duplicate(); // // instatiation.apply(new Substitution(scheme.variables(), freshVars)); // // // // return instatiation; // // } // // public Scheme generalize(Type t) { // HashSet<TVariable> freeVars = t.ftv(); // freeVars.removeAll(typeEnv.ftv()); // return forall(new ArrayList<>(freeVars), t); // } // // public Scheme lookup(Variable variable) { // return typeEnv.lookup(variable); // } // // public TVariable freshName() { // return typeGenerator.freshName(); // } // // public List<Constraint> constraints() { // return constraints; // } // } // // Path: src/main/java/types/TVariable.java // public class TVariable extends Type { // private final String name; // private final static HashSet<TVariable> instantiated = new HashSet<>(); // // private TVariable(String name) { // this.name = name; // } // // public String name() { // return name; // } // // public static TVariable variable(String name) { // TVariable var = new TVariable(name); // if(!instantiated.add(var)) System.out.println("Creation avoidable : TVariable(" + name + ")"); // return var; // } // // public static List<TVariable> variables(String... names) { // List<TVariable> variables = new LinkedList<>(); // for (String name : names) variables.add(new TVariable(name)); // return variables; // } // // @Override // public Type substitute(TVariable var, Type type) { // return this.equals(var) ? type : this; // } // // @Override // public HashSet<TVariable> ftv() { // return new HashSet<>(Collections.singleton(this)); // } // // @Override // protected Substitution unifyWith(TFunction fun) { // return bind(this, fun); // } // // @Override // protected Substitution unifyWith(TConstructor cons) { // return bind(this, cons); // } // // @Override // public Type instantiate(Substitution sub) { // return sub.variables().contains(this) ? sub.substituteOf(this) : this; // } // // @Override // protected Substitution unifyWith(TVariable var) { // return bind(this, var); // } // // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // TVariable tVariable = (TVariable) o; // // return name.equals(tVariable.name); // // } // // @Override // public int hashCode() { // return ("TVariable_" + name).hashCode(); // } // // @Override // public String toString() { // return name(); // } // } // // Path: src/main/java/types/Type.java // public abstract class Type extends Substitutable<Type> implements Unifyable{ // // @Override // public Type identity() { // return this; // } // // @Override // public final Substitution unifyWith(Type type) { // if(this.equals(type)) return new Substitution(); // if(type instanceof TVariable) return unifyWith((TVariable) type); // if(type instanceof TFunction) return unifyWith((TFunction) type); // if(type instanceof TConstructor) return unifyWith((TConstructor) type); // throw new UnificationFailException(this, type); // } // // protected Substitution unifyWith(TVariable var) { // return bind(var, this); // } // // protected Substitution unifyWith(TFunction fun) { // throw new UnificationFailException(this, fun); // } // // protected Substitution unifyWith(TConstructor cons) { // throw new UnificationFailException(this, cons); // } // // public abstract Type instantiate(Substitution sub); // } // // Path: src/main/java/types/TFunction.java // public static TFunction function(Type left, Type right) { // int hash = hash(left, right); // TFunction f = instantiated.get(hash); // if(f == null) { // f = new TFunction(left, right); // instantiated.put(hash, f); // } // return f; // } // Path: src/main/java/ast/Application.java import inference.environements.TypeInferenceEnv; import types.TVariable; import types.Type; import java.util.Arrays; import static types.TFunction.function; package ast; /** * Represent an Application in Lambda calculus. */ public class Application extends Expression { private Expression left; private Expression right; public Application(Expression left, Expression right) { this.left = left; this.right = right; } @Override
public Type infer(TypeInferenceEnv env) {
maeln/LambdaHindleyMilner
src/main/java/ast/Application.java
// Path: src/main/java/inference/environements/TypeInferenceEnv.java // public class TypeInferenceEnv { // private TypeGenerator typeGenerator; // private TypeEnv typeEnv; // private List<Constraint> constraints; // // public TypeInferenceEnv() { // typeGenerator = new TypeGenerator(); // typeEnv = new TypeEnv(); // constraints = new LinkedList<>(); // } // // private TypeInferenceEnv(TypeInferenceEnv globalEnv) { // typeGenerator = globalEnv.typeGenerator; // typeEnv = new TypeEnv().mergeWith(globalEnv.typeEnv); // constraints = globalEnv.constraints(); // } // // public TypeInferenceEnv inEnv(Variable var, Scheme scheme) { // TypeInferenceEnv localEnv = new TypeInferenceEnv(this); // localEnv.bind(var, scheme); // return localEnv; // } // // public void bind(Variable var, Scheme scheme) { // typeEnv.extend(var, scheme); // } // // public void unify(Type t1, Type t2) { // constraints.add(new Constraint(t1, t2)); // } // // // public Type instantiate(Scheme scheme) { // // List<Type> freshVars = new LinkedList<>(); // // scheme.variables().forEach(var -> freshVars.add(freshName())); // // // // Type instatiation = scheme.type().duplicate(); // // instatiation.apply(new Substitution(scheme.variables(), freshVars)); // // // // return instatiation; // // } // // public Scheme generalize(Type t) { // HashSet<TVariable> freeVars = t.ftv(); // freeVars.removeAll(typeEnv.ftv()); // return forall(new ArrayList<>(freeVars), t); // } // // public Scheme lookup(Variable variable) { // return typeEnv.lookup(variable); // } // // public TVariable freshName() { // return typeGenerator.freshName(); // } // // public List<Constraint> constraints() { // return constraints; // } // } // // Path: src/main/java/types/TVariable.java // public class TVariable extends Type { // private final String name; // private final static HashSet<TVariable> instantiated = new HashSet<>(); // // private TVariable(String name) { // this.name = name; // } // // public String name() { // return name; // } // // public static TVariable variable(String name) { // TVariable var = new TVariable(name); // if(!instantiated.add(var)) System.out.println("Creation avoidable : TVariable(" + name + ")"); // return var; // } // // public static List<TVariable> variables(String... names) { // List<TVariable> variables = new LinkedList<>(); // for (String name : names) variables.add(new TVariable(name)); // return variables; // } // // @Override // public Type substitute(TVariable var, Type type) { // return this.equals(var) ? type : this; // } // // @Override // public HashSet<TVariable> ftv() { // return new HashSet<>(Collections.singleton(this)); // } // // @Override // protected Substitution unifyWith(TFunction fun) { // return bind(this, fun); // } // // @Override // protected Substitution unifyWith(TConstructor cons) { // return bind(this, cons); // } // // @Override // public Type instantiate(Substitution sub) { // return sub.variables().contains(this) ? sub.substituteOf(this) : this; // } // // @Override // protected Substitution unifyWith(TVariable var) { // return bind(this, var); // } // // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // TVariable tVariable = (TVariable) o; // // return name.equals(tVariable.name); // // } // // @Override // public int hashCode() { // return ("TVariable_" + name).hashCode(); // } // // @Override // public String toString() { // return name(); // } // } // // Path: src/main/java/types/Type.java // public abstract class Type extends Substitutable<Type> implements Unifyable{ // // @Override // public Type identity() { // return this; // } // // @Override // public final Substitution unifyWith(Type type) { // if(this.equals(type)) return new Substitution(); // if(type instanceof TVariable) return unifyWith((TVariable) type); // if(type instanceof TFunction) return unifyWith((TFunction) type); // if(type instanceof TConstructor) return unifyWith((TConstructor) type); // throw new UnificationFailException(this, type); // } // // protected Substitution unifyWith(TVariable var) { // return bind(var, this); // } // // protected Substitution unifyWith(TFunction fun) { // throw new UnificationFailException(this, fun); // } // // protected Substitution unifyWith(TConstructor cons) { // throw new UnificationFailException(this, cons); // } // // public abstract Type instantiate(Substitution sub); // } // // Path: src/main/java/types/TFunction.java // public static TFunction function(Type left, Type right) { // int hash = hash(left, right); // TFunction f = instantiated.get(hash); // if(f == null) { // f = new TFunction(left, right); // instantiated.put(hash, f); // } // return f; // }
import inference.environements.TypeInferenceEnv; import types.TVariable; import types.Type; import java.util.Arrays; import static types.TFunction.function;
package ast; /** * Represent an Application in Lambda calculus. */ public class Application extends Expression { private Expression left; private Expression right; public Application(Expression left, Expression right) { this.left = left; this.right = right; } @Override
// Path: src/main/java/inference/environements/TypeInferenceEnv.java // public class TypeInferenceEnv { // private TypeGenerator typeGenerator; // private TypeEnv typeEnv; // private List<Constraint> constraints; // // public TypeInferenceEnv() { // typeGenerator = new TypeGenerator(); // typeEnv = new TypeEnv(); // constraints = new LinkedList<>(); // } // // private TypeInferenceEnv(TypeInferenceEnv globalEnv) { // typeGenerator = globalEnv.typeGenerator; // typeEnv = new TypeEnv().mergeWith(globalEnv.typeEnv); // constraints = globalEnv.constraints(); // } // // public TypeInferenceEnv inEnv(Variable var, Scheme scheme) { // TypeInferenceEnv localEnv = new TypeInferenceEnv(this); // localEnv.bind(var, scheme); // return localEnv; // } // // public void bind(Variable var, Scheme scheme) { // typeEnv.extend(var, scheme); // } // // public void unify(Type t1, Type t2) { // constraints.add(new Constraint(t1, t2)); // } // // // public Type instantiate(Scheme scheme) { // // List<Type> freshVars = new LinkedList<>(); // // scheme.variables().forEach(var -> freshVars.add(freshName())); // // // // Type instatiation = scheme.type().duplicate(); // // instatiation.apply(new Substitution(scheme.variables(), freshVars)); // // // // return instatiation; // // } // // public Scheme generalize(Type t) { // HashSet<TVariable> freeVars = t.ftv(); // freeVars.removeAll(typeEnv.ftv()); // return forall(new ArrayList<>(freeVars), t); // } // // public Scheme lookup(Variable variable) { // return typeEnv.lookup(variable); // } // // public TVariable freshName() { // return typeGenerator.freshName(); // } // // public List<Constraint> constraints() { // return constraints; // } // } // // Path: src/main/java/types/TVariable.java // public class TVariable extends Type { // private final String name; // private final static HashSet<TVariable> instantiated = new HashSet<>(); // // private TVariable(String name) { // this.name = name; // } // // public String name() { // return name; // } // // public static TVariable variable(String name) { // TVariable var = new TVariable(name); // if(!instantiated.add(var)) System.out.println("Creation avoidable : TVariable(" + name + ")"); // return var; // } // // public static List<TVariable> variables(String... names) { // List<TVariable> variables = new LinkedList<>(); // for (String name : names) variables.add(new TVariable(name)); // return variables; // } // // @Override // public Type substitute(TVariable var, Type type) { // return this.equals(var) ? type : this; // } // // @Override // public HashSet<TVariable> ftv() { // return new HashSet<>(Collections.singleton(this)); // } // // @Override // protected Substitution unifyWith(TFunction fun) { // return bind(this, fun); // } // // @Override // protected Substitution unifyWith(TConstructor cons) { // return bind(this, cons); // } // // @Override // public Type instantiate(Substitution sub) { // return sub.variables().contains(this) ? sub.substituteOf(this) : this; // } // // @Override // protected Substitution unifyWith(TVariable var) { // return bind(this, var); // } // // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // TVariable tVariable = (TVariable) o; // // return name.equals(tVariable.name); // // } // // @Override // public int hashCode() { // return ("TVariable_" + name).hashCode(); // } // // @Override // public String toString() { // return name(); // } // } // // Path: src/main/java/types/Type.java // public abstract class Type extends Substitutable<Type> implements Unifyable{ // // @Override // public Type identity() { // return this; // } // // @Override // public final Substitution unifyWith(Type type) { // if(this.equals(type)) return new Substitution(); // if(type instanceof TVariable) return unifyWith((TVariable) type); // if(type instanceof TFunction) return unifyWith((TFunction) type); // if(type instanceof TConstructor) return unifyWith((TConstructor) type); // throw new UnificationFailException(this, type); // } // // protected Substitution unifyWith(TVariable var) { // return bind(var, this); // } // // protected Substitution unifyWith(TFunction fun) { // throw new UnificationFailException(this, fun); // } // // protected Substitution unifyWith(TConstructor cons) { // throw new UnificationFailException(this, cons); // } // // public abstract Type instantiate(Substitution sub); // } // // Path: src/main/java/types/TFunction.java // public static TFunction function(Type left, Type right) { // int hash = hash(left, right); // TFunction f = instantiated.get(hash); // if(f == null) { // f = new TFunction(left, right); // instantiated.put(hash, f); // } // return f; // } // Path: src/main/java/ast/Application.java import inference.environements.TypeInferenceEnv; import types.TVariable; import types.Type; import java.util.Arrays; import static types.TFunction.function; package ast; /** * Represent an Application in Lambda calculus. */ public class Application extends Expression { private Expression left; private Expression right; public Application(Expression left, Expression right) { this.left = left; this.right = right; } @Override
public Type infer(TypeInferenceEnv env) {
maeln/LambdaHindleyMilner
src/main/java/ast/Application.java
// Path: src/main/java/inference/environements/TypeInferenceEnv.java // public class TypeInferenceEnv { // private TypeGenerator typeGenerator; // private TypeEnv typeEnv; // private List<Constraint> constraints; // // public TypeInferenceEnv() { // typeGenerator = new TypeGenerator(); // typeEnv = new TypeEnv(); // constraints = new LinkedList<>(); // } // // private TypeInferenceEnv(TypeInferenceEnv globalEnv) { // typeGenerator = globalEnv.typeGenerator; // typeEnv = new TypeEnv().mergeWith(globalEnv.typeEnv); // constraints = globalEnv.constraints(); // } // // public TypeInferenceEnv inEnv(Variable var, Scheme scheme) { // TypeInferenceEnv localEnv = new TypeInferenceEnv(this); // localEnv.bind(var, scheme); // return localEnv; // } // // public void bind(Variable var, Scheme scheme) { // typeEnv.extend(var, scheme); // } // // public void unify(Type t1, Type t2) { // constraints.add(new Constraint(t1, t2)); // } // // // public Type instantiate(Scheme scheme) { // // List<Type> freshVars = new LinkedList<>(); // // scheme.variables().forEach(var -> freshVars.add(freshName())); // // // // Type instatiation = scheme.type().duplicate(); // // instatiation.apply(new Substitution(scheme.variables(), freshVars)); // // // // return instatiation; // // } // // public Scheme generalize(Type t) { // HashSet<TVariable> freeVars = t.ftv(); // freeVars.removeAll(typeEnv.ftv()); // return forall(new ArrayList<>(freeVars), t); // } // // public Scheme lookup(Variable variable) { // return typeEnv.lookup(variable); // } // // public TVariable freshName() { // return typeGenerator.freshName(); // } // // public List<Constraint> constraints() { // return constraints; // } // } // // Path: src/main/java/types/TVariable.java // public class TVariable extends Type { // private final String name; // private final static HashSet<TVariable> instantiated = new HashSet<>(); // // private TVariable(String name) { // this.name = name; // } // // public String name() { // return name; // } // // public static TVariable variable(String name) { // TVariable var = new TVariable(name); // if(!instantiated.add(var)) System.out.println("Creation avoidable : TVariable(" + name + ")"); // return var; // } // // public static List<TVariable> variables(String... names) { // List<TVariable> variables = new LinkedList<>(); // for (String name : names) variables.add(new TVariable(name)); // return variables; // } // // @Override // public Type substitute(TVariable var, Type type) { // return this.equals(var) ? type : this; // } // // @Override // public HashSet<TVariable> ftv() { // return new HashSet<>(Collections.singleton(this)); // } // // @Override // protected Substitution unifyWith(TFunction fun) { // return bind(this, fun); // } // // @Override // protected Substitution unifyWith(TConstructor cons) { // return bind(this, cons); // } // // @Override // public Type instantiate(Substitution sub) { // return sub.variables().contains(this) ? sub.substituteOf(this) : this; // } // // @Override // protected Substitution unifyWith(TVariable var) { // return bind(this, var); // } // // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // TVariable tVariable = (TVariable) o; // // return name.equals(tVariable.name); // // } // // @Override // public int hashCode() { // return ("TVariable_" + name).hashCode(); // } // // @Override // public String toString() { // return name(); // } // } // // Path: src/main/java/types/Type.java // public abstract class Type extends Substitutable<Type> implements Unifyable{ // // @Override // public Type identity() { // return this; // } // // @Override // public final Substitution unifyWith(Type type) { // if(this.equals(type)) return new Substitution(); // if(type instanceof TVariable) return unifyWith((TVariable) type); // if(type instanceof TFunction) return unifyWith((TFunction) type); // if(type instanceof TConstructor) return unifyWith((TConstructor) type); // throw new UnificationFailException(this, type); // } // // protected Substitution unifyWith(TVariable var) { // return bind(var, this); // } // // protected Substitution unifyWith(TFunction fun) { // throw new UnificationFailException(this, fun); // } // // protected Substitution unifyWith(TConstructor cons) { // throw new UnificationFailException(this, cons); // } // // public abstract Type instantiate(Substitution sub); // } // // Path: src/main/java/types/TFunction.java // public static TFunction function(Type left, Type right) { // int hash = hash(left, right); // TFunction f = instantiated.get(hash); // if(f == null) { // f = new TFunction(left, right); // instantiated.put(hash, f); // } // return f; // }
import inference.environements.TypeInferenceEnv; import types.TVariable; import types.Type; import java.util.Arrays; import static types.TFunction.function;
package ast; /** * Represent an Application in Lambda calculus. */ public class Application extends Expression { private Expression left; private Expression right; public Application(Expression left, Expression right) { this.left = left; this.right = right; } @Override public Type infer(TypeInferenceEnv env) { Type left = getLeft().infer(env); Type right = getRight().infer(env);
// Path: src/main/java/inference/environements/TypeInferenceEnv.java // public class TypeInferenceEnv { // private TypeGenerator typeGenerator; // private TypeEnv typeEnv; // private List<Constraint> constraints; // // public TypeInferenceEnv() { // typeGenerator = new TypeGenerator(); // typeEnv = new TypeEnv(); // constraints = new LinkedList<>(); // } // // private TypeInferenceEnv(TypeInferenceEnv globalEnv) { // typeGenerator = globalEnv.typeGenerator; // typeEnv = new TypeEnv().mergeWith(globalEnv.typeEnv); // constraints = globalEnv.constraints(); // } // // public TypeInferenceEnv inEnv(Variable var, Scheme scheme) { // TypeInferenceEnv localEnv = new TypeInferenceEnv(this); // localEnv.bind(var, scheme); // return localEnv; // } // // public void bind(Variable var, Scheme scheme) { // typeEnv.extend(var, scheme); // } // // public void unify(Type t1, Type t2) { // constraints.add(new Constraint(t1, t2)); // } // // // public Type instantiate(Scheme scheme) { // // List<Type> freshVars = new LinkedList<>(); // // scheme.variables().forEach(var -> freshVars.add(freshName())); // // // // Type instatiation = scheme.type().duplicate(); // // instatiation.apply(new Substitution(scheme.variables(), freshVars)); // // // // return instatiation; // // } // // public Scheme generalize(Type t) { // HashSet<TVariable> freeVars = t.ftv(); // freeVars.removeAll(typeEnv.ftv()); // return forall(new ArrayList<>(freeVars), t); // } // // public Scheme lookup(Variable variable) { // return typeEnv.lookup(variable); // } // // public TVariable freshName() { // return typeGenerator.freshName(); // } // // public List<Constraint> constraints() { // return constraints; // } // } // // Path: src/main/java/types/TVariable.java // public class TVariable extends Type { // private final String name; // private final static HashSet<TVariable> instantiated = new HashSet<>(); // // private TVariable(String name) { // this.name = name; // } // // public String name() { // return name; // } // // public static TVariable variable(String name) { // TVariable var = new TVariable(name); // if(!instantiated.add(var)) System.out.println("Creation avoidable : TVariable(" + name + ")"); // return var; // } // // public static List<TVariable> variables(String... names) { // List<TVariable> variables = new LinkedList<>(); // for (String name : names) variables.add(new TVariable(name)); // return variables; // } // // @Override // public Type substitute(TVariable var, Type type) { // return this.equals(var) ? type : this; // } // // @Override // public HashSet<TVariable> ftv() { // return new HashSet<>(Collections.singleton(this)); // } // // @Override // protected Substitution unifyWith(TFunction fun) { // return bind(this, fun); // } // // @Override // protected Substitution unifyWith(TConstructor cons) { // return bind(this, cons); // } // // @Override // public Type instantiate(Substitution sub) { // return sub.variables().contains(this) ? sub.substituteOf(this) : this; // } // // @Override // protected Substitution unifyWith(TVariable var) { // return bind(this, var); // } // // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // TVariable tVariable = (TVariable) o; // // return name.equals(tVariable.name); // // } // // @Override // public int hashCode() { // return ("TVariable_" + name).hashCode(); // } // // @Override // public String toString() { // return name(); // } // } // // Path: src/main/java/types/Type.java // public abstract class Type extends Substitutable<Type> implements Unifyable{ // // @Override // public Type identity() { // return this; // } // // @Override // public final Substitution unifyWith(Type type) { // if(this.equals(type)) return new Substitution(); // if(type instanceof TVariable) return unifyWith((TVariable) type); // if(type instanceof TFunction) return unifyWith((TFunction) type); // if(type instanceof TConstructor) return unifyWith((TConstructor) type); // throw new UnificationFailException(this, type); // } // // protected Substitution unifyWith(TVariable var) { // return bind(var, this); // } // // protected Substitution unifyWith(TFunction fun) { // throw new UnificationFailException(this, fun); // } // // protected Substitution unifyWith(TConstructor cons) { // throw new UnificationFailException(this, cons); // } // // public abstract Type instantiate(Substitution sub); // } // // Path: src/main/java/types/TFunction.java // public static TFunction function(Type left, Type right) { // int hash = hash(left, right); // TFunction f = instantiated.get(hash); // if(f == null) { // f = new TFunction(left, right); // instantiated.put(hash, f); // } // return f; // } // Path: src/main/java/ast/Application.java import inference.environements.TypeInferenceEnv; import types.TVariable; import types.Type; import java.util.Arrays; import static types.TFunction.function; package ast; /** * Represent an Application in Lambda calculus. */ public class Application extends Expression { private Expression left; private Expression right; public Application(Expression left, Expression right) { this.left = left; this.right = right; } @Override public Type infer(TypeInferenceEnv env) { Type left = getLeft().infer(env); Type right = getRight().infer(env);
TVariable resultType = env.freshName();
maeln/LambdaHindleyMilner
src/main/java/ast/lit/Bool.java
// Path: src/main/java/ast/Literal.java // public abstract class Literal<T> extends Expression { // private T value; // private Type type; // // public Literal(T value, TConstructor type){ // this.value = value; // this.type = type; // } // // public T value() { // return value; // } // // @Override // public Type infer(TypeInferenceEnv typeInferenceEnv) { // return type; // } // // @Override // public String toString() { // return value.toString(); // } // } // // Path: src/main/java/types/TConstructor.java // public static TConstructor constructor(String name) { // TConstructor cons = instantiated.get(name); // if(cons == null) { // cons = new TConstructor(name); // instantiated.put(name, cons); // } // return cons; // }
import ast.Literal; import static types.TConstructor.constructor;
package ast.lit; /** * Created by valentin on 25/10/2016. */ public class Bool extends Literal<Boolean> { public Bool(Boolean value) {
// Path: src/main/java/ast/Literal.java // public abstract class Literal<T> extends Expression { // private T value; // private Type type; // // public Literal(T value, TConstructor type){ // this.value = value; // this.type = type; // } // // public T value() { // return value; // } // // @Override // public Type infer(TypeInferenceEnv typeInferenceEnv) { // return type; // } // // @Override // public String toString() { // return value.toString(); // } // } // // Path: src/main/java/types/TConstructor.java // public static TConstructor constructor(String name) { // TConstructor cons = instantiated.get(name); // if(cons == null) { // cons = new TConstructor(name); // instantiated.put(name, cons); // } // return cons; // } // Path: src/main/java/ast/lit/Bool.java import ast.Literal; import static types.TConstructor.constructor; package ast.lit; /** * Created by valentin on 25/10/2016. */ public class Bool extends Literal<Boolean> { public Bool(Boolean value) {
super(value, constructor("Bool"));
maeln/LambdaHindleyMilner
src/main/java/ast/lit/Int.java
// Path: src/main/java/ast/Literal.java // public abstract class Literal<T> extends Expression { // private T value; // private Type type; // // public Literal(T value, TConstructor type){ // this.value = value; // this.type = type; // } // // public T value() { // return value; // } // // @Override // public Type infer(TypeInferenceEnv typeInferenceEnv) { // return type; // } // // @Override // public String toString() { // return value.toString(); // } // } // // Path: src/main/java/types/TConstructor.java // public static TConstructor constructor(String name) { // TConstructor cons = instantiated.get(name); // if(cons == null) { // cons = new TConstructor(name); // instantiated.put(name, cons); // } // return cons; // }
import ast.Literal; import static types.TConstructor.constructor;
package ast.lit; /** * Created by valentin on 25/10/2016. */ public class Int extends Literal<Integer> { public Int(Integer value) {
// Path: src/main/java/ast/Literal.java // public abstract class Literal<T> extends Expression { // private T value; // private Type type; // // public Literal(T value, TConstructor type){ // this.value = value; // this.type = type; // } // // public T value() { // return value; // } // // @Override // public Type infer(TypeInferenceEnv typeInferenceEnv) { // return type; // } // // @Override // public String toString() { // return value.toString(); // } // } // // Path: src/main/java/types/TConstructor.java // public static TConstructor constructor(String name) { // TConstructor cons = instantiated.get(name); // if(cons == null) { // cons = new TConstructor(name); // instantiated.put(name, cons); // } // return cons; // } // Path: src/main/java/ast/lit/Int.java import ast.Literal; import static types.TConstructor.constructor; package ast.lit; /** * Created by valentin on 25/10/2016. */ public class Int extends Literal<Integer> { public Int(Integer value) {
super(value, constructor("Int"));
maeln/LambdaHindleyMilner
src/test/java/ast/VariableTest.java
// Path: src/main/java/inference/environements/TypeInferenceEnv.java // public class TypeInferenceEnv { // private TypeGenerator typeGenerator; // private TypeEnv typeEnv; // private List<Constraint> constraints; // // public TypeInferenceEnv() { // typeGenerator = new TypeGenerator(); // typeEnv = new TypeEnv(); // constraints = new LinkedList<>(); // } // // private TypeInferenceEnv(TypeInferenceEnv globalEnv) { // typeGenerator = globalEnv.typeGenerator; // typeEnv = new TypeEnv().mergeWith(globalEnv.typeEnv); // constraints = globalEnv.constraints(); // } // // public TypeInferenceEnv inEnv(Variable var, Scheme scheme) { // TypeInferenceEnv localEnv = new TypeInferenceEnv(this); // localEnv.bind(var, scheme); // return localEnv; // } // // public void bind(Variable var, Scheme scheme) { // typeEnv.extend(var, scheme); // } // // public void unify(Type t1, Type t2) { // constraints.add(new Constraint(t1, t2)); // } // // // public Type instantiate(Scheme scheme) { // // List<Type> freshVars = new LinkedList<>(); // // scheme.variables().forEach(var -> freshVars.add(freshName())); // // // // Type instatiation = scheme.type().duplicate(); // // instatiation.apply(new Substitution(scheme.variables(), freshVars)); // // // // return instatiation; // // } // // public Scheme generalize(Type t) { // HashSet<TVariable> freeVars = t.ftv(); // freeVars.removeAll(typeEnv.ftv()); // return forall(new ArrayList<>(freeVars), t); // } // // public Scheme lookup(Variable variable) { // return typeEnv.lookup(variable); // } // // public TVariable freshName() { // return typeGenerator.freshName(); // } // // public List<Constraint> constraints() { // return constraints; // } // } // // Path: src/main/java/types/TVariable.java // public class TVariable extends Type { // private final String name; // private final static HashSet<TVariable> instantiated = new HashSet<>(); // // private TVariable(String name) { // this.name = name; // } // // public String name() { // return name; // } // // public static TVariable variable(String name) { // TVariable var = new TVariable(name); // if(!instantiated.add(var)) System.out.println("Creation avoidable : TVariable(" + name + ")"); // return var; // } // // public static List<TVariable> variables(String... names) { // List<TVariable> variables = new LinkedList<>(); // for (String name : names) variables.add(new TVariable(name)); // return variables; // } // // @Override // public Type substitute(TVariable var, Type type) { // return this.equals(var) ? type : this; // } // // @Override // public HashSet<TVariable> ftv() { // return new HashSet<>(Collections.singleton(this)); // } // // @Override // protected Substitution unifyWith(TFunction fun) { // return bind(this, fun); // } // // @Override // protected Substitution unifyWith(TConstructor cons) { // return bind(this, cons); // } // // @Override // public Type instantiate(Substitution sub) { // return sub.variables().contains(this) ? sub.substituteOf(this) : this; // } // // @Override // protected Substitution unifyWith(TVariable var) { // return bind(this, var); // } // // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // TVariable tVariable = (TVariable) o; // // return name.equals(tVariable.name); // // } // // @Override // public int hashCode() { // return ("TVariable_" + name).hashCode(); // } // // @Override // public String toString() { // return name(); // } // } // // Path: src/main/java/types/Type.java // public abstract class Type extends Substitutable<Type> implements Unifyable{ // // @Override // public Type identity() { // return this; // } // // @Override // public final Substitution unifyWith(Type type) { // if(this.equals(type)) return new Substitution(); // if(type instanceof TVariable) return unifyWith((TVariable) type); // if(type instanceof TFunction) return unifyWith((TFunction) type); // if(type instanceof TConstructor) return unifyWith((TConstructor) type); // throw new UnificationFailException(this, type); // } // // protected Substitution unifyWith(TVariable var) { // return bind(var, this); // } // // protected Substitution unifyWith(TFunction fun) { // throw new UnificationFailException(this, fun); // } // // protected Substitution unifyWith(TConstructor cons) { // throw new UnificationFailException(this, cons); // } // // public abstract Type instantiate(Substitution sub); // } // // Path: src/main/java/types/Scheme.java // public static Scheme forall(Type type) { // return forall(Collections.emptyList(), type); // } // // Path: src/main/java/types/TVariable.java // public static TVariable variable(String name) { // TVariable var = new TVariable(name); // if(!instantiated.add(var)) System.out.println("Creation avoidable : TVariable(" + name + ")"); // return var; // }
import inference.environements.TypeInferenceEnv; import org.junit.Test; import types.TVariable; import types.Type; import static types.Scheme.forall; import static org.junit.Assert.*; import static types.TVariable.variable;
package ast; /** * Created by maeln on 20/10/16. */ public class VariableTest { @Test public void infer() throws Exception { final String name = "x"; Expression var = new Variable(name);
// Path: src/main/java/inference/environements/TypeInferenceEnv.java // public class TypeInferenceEnv { // private TypeGenerator typeGenerator; // private TypeEnv typeEnv; // private List<Constraint> constraints; // // public TypeInferenceEnv() { // typeGenerator = new TypeGenerator(); // typeEnv = new TypeEnv(); // constraints = new LinkedList<>(); // } // // private TypeInferenceEnv(TypeInferenceEnv globalEnv) { // typeGenerator = globalEnv.typeGenerator; // typeEnv = new TypeEnv().mergeWith(globalEnv.typeEnv); // constraints = globalEnv.constraints(); // } // // public TypeInferenceEnv inEnv(Variable var, Scheme scheme) { // TypeInferenceEnv localEnv = new TypeInferenceEnv(this); // localEnv.bind(var, scheme); // return localEnv; // } // // public void bind(Variable var, Scheme scheme) { // typeEnv.extend(var, scheme); // } // // public void unify(Type t1, Type t2) { // constraints.add(new Constraint(t1, t2)); // } // // // public Type instantiate(Scheme scheme) { // // List<Type> freshVars = new LinkedList<>(); // // scheme.variables().forEach(var -> freshVars.add(freshName())); // // // // Type instatiation = scheme.type().duplicate(); // // instatiation.apply(new Substitution(scheme.variables(), freshVars)); // // // // return instatiation; // // } // // public Scheme generalize(Type t) { // HashSet<TVariable> freeVars = t.ftv(); // freeVars.removeAll(typeEnv.ftv()); // return forall(new ArrayList<>(freeVars), t); // } // // public Scheme lookup(Variable variable) { // return typeEnv.lookup(variable); // } // // public TVariable freshName() { // return typeGenerator.freshName(); // } // // public List<Constraint> constraints() { // return constraints; // } // } // // Path: src/main/java/types/TVariable.java // public class TVariable extends Type { // private final String name; // private final static HashSet<TVariable> instantiated = new HashSet<>(); // // private TVariable(String name) { // this.name = name; // } // // public String name() { // return name; // } // // public static TVariable variable(String name) { // TVariable var = new TVariable(name); // if(!instantiated.add(var)) System.out.println("Creation avoidable : TVariable(" + name + ")"); // return var; // } // // public static List<TVariable> variables(String... names) { // List<TVariable> variables = new LinkedList<>(); // for (String name : names) variables.add(new TVariable(name)); // return variables; // } // // @Override // public Type substitute(TVariable var, Type type) { // return this.equals(var) ? type : this; // } // // @Override // public HashSet<TVariable> ftv() { // return new HashSet<>(Collections.singleton(this)); // } // // @Override // protected Substitution unifyWith(TFunction fun) { // return bind(this, fun); // } // // @Override // protected Substitution unifyWith(TConstructor cons) { // return bind(this, cons); // } // // @Override // public Type instantiate(Substitution sub) { // return sub.variables().contains(this) ? sub.substituteOf(this) : this; // } // // @Override // protected Substitution unifyWith(TVariable var) { // return bind(this, var); // } // // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // TVariable tVariable = (TVariable) o; // // return name.equals(tVariable.name); // // } // // @Override // public int hashCode() { // return ("TVariable_" + name).hashCode(); // } // // @Override // public String toString() { // return name(); // } // } // // Path: src/main/java/types/Type.java // public abstract class Type extends Substitutable<Type> implements Unifyable{ // // @Override // public Type identity() { // return this; // } // // @Override // public final Substitution unifyWith(Type type) { // if(this.equals(type)) return new Substitution(); // if(type instanceof TVariable) return unifyWith((TVariable) type); // if(type instanceof TFunction) return unifyWith((TFunction) type); // if(type instanceof TConstructor) return unifyWith((TConstructor) type); // throw new UnificationFailException(this, type); // } // // protected Substitution unifyWith(TVariable var) { // return bind(var, this); // } // // protected Substitution unifyWith(TFunction fun) { // throw new UnificationFailException(this, fun); // } // // protected Substitution unifyWith(TConstructor cons) { // throw new UnificationFailException(this, cons); // } // // public abstract Type instantiate(Substitution sub); // } // // Path: src/main/java/types/Scheme.java // public static Scheme forall(Type type) { // return forall(Collections.emptyList(), type); // } // // Path: src/main/java/types/TVariable.java // public static TVariable variable(String name) { // TVariable var = new TVariable(name); // if(!instantiated.add(var)) System.out.println("Creation avoidable : TVariable(" + name + ")"); // return var; // } // Path: src/test/java/ast/VariableTest.java import inference.environements.TypeInferenceEnv; import org.junit.Test; import types.TVariable; import types.Type; import static types.Scheme.forall; import static org.junit.Assert.*; import static types.TVariable.variable; package ast; /** * Created by maeln on 20/10/16. */ public class VariableTest { @Test public void infer() throws Exception { final String name = "x"; Expression var = new Variable(name);
TypeInferenceEnv env = new TypeInferenceEnv();
maeln/LambdaHindleyMilner
src/test/java/ast/LetTest.java
// Path: src/main/java/types/TFunction.java // public class TFunction extends Type { // private Type left; // private Type right; // private final static HashMap<Integer, TFunction> instantiated = new HashMap<>(); // // private TFunction(Type left, Type right) { // this.left = left; // this.right = right; // } // // public Type left() { // return left; // } // // public Type right() { // return right; // } // // public static TFunction function(Type left, Type right) { // int hash = hash(left, right); // TFunction f = instantiated.get(hash); // if(f == null) { // f = new TFunction(left, right); // instantiated.put(hash, f); // } // return f; // } // // private static int hash(Type left, Type right) { // int result = left.hashCode(); // result = 31 * result + right.hashCode(); // return result; // } // // // Substitutable - Begin // @Override // public Type substitute(TVariable var, Type type) { // TFunction result; // String before = this.toString(); // //* // left = left.substitute(var, type); // right = right.substitute(var, type); // result = this; // /*/ // result = function(left.substitute(var, type), right.substitute(var, type)); // //*/ // // System.out.println(var + " => " + type + " \n\t" + before + " => " + result + "\n"); // return result; // } // // @Override // public HashSet<TVariable> ftv() { // HashSet<TVariable> set = new HashSet<>(left.ftv()); // set.addAll(right.ftv()); // return set; // } // //Substitutable - End // // // @Override // protected Substitution unifyWith(TFunction fun) { // Substitution sub1 = left.unifyWith(fun.left); // Substitution sub2 = right.apply(sub1).unifyWith(fun.right.apply(sub1)); // Substitution sub = sub2.composeWith(sub1); // System.out.println("Unifyed " + this + " with " + fun + " : "); // System.out.println(sub); // return sub; // } // // @Override // public Type instantiate(Substitution sub) { // return function(left.instantiate(sub), right.instantiate(sub)); // } // // // Object override - Begin // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // TFunction tFunction = (TFunction) o; // // return left.equals(tFunction.left) && right.equals(tFunction.right); // // } // // @Override // public int hashCode() { // return hash(left, right); // } // // @Override // public String toString() { // return "(" + left + " → " + right + ")"; // } // // //Object override - End // } // // Path: src/main/java/types/Type.java // public abstract class Type extends Substitutable<Type> implements Unifyable{ // // @Override // public Type identity() { // return this; // } // // @Override // public final Substitution unifyWith(Type type) { // if(this.equals(type)) return new Substitution(); // if(type instanceof TVariable) return unifyWith((TVariable) type); // if(type instanceof TFunction) return unifyWith((TFunction) type); // if(type instanceof TConstructor) return unifyWith((TConstructor) type); // throw new UnificationFailException(this, type); // } // // protected Substitution unifyWith(TVariable var) { // return bind(var, this); // } // // protected Substitution unifyWith(TFunction fun) { // throw new UnificationFailException(this, fun); // } // // protected Substitution unifyWith(TConstructor cons) { // throw new UnificationFailException(this, cons); // } // // public abstract Type instantiate(Substitution sub); // }
import org.junit.Test; import types.TFunction; import types.Type; import static org.junit.Assert.*;
package ast; /** * Created by maeln on 20/10/16. */ public class LetTest { @Test public void infer() throws Exception { final String name = "x"; Expression exp = new Let(new Variable(name), new Lambda(new Variable(name), new Variable(name)), new Variable(name));
// Path: src/main/java/types/TFunction.java // public class TFunction extends Type { // private Type left; // private Type right; // private final static HashMap<Integer, TFunction> instantiated = new HashMap<>(); // // private TFunction(Type left, Type right) { // this.left = left; // this.right = right; // } // // public Type left() { // return left; // } // // public Type right() { // return right; // } // // public static TFunction function(Type left, Type right) { // int hash = hash(left, right); // TFunction f = instantiated.get(hash); // if(f == null) { // f = new TFunction(left, right); // instantiated.put(hash, f); // } // return f; // } // // private static int hash(Type left, Type right) { // int result = left.hashCode(); // result = 31 * result + right.hashCode(); // return result; // } // // // Substitutable - Begin // @Override // public Type substitute(TVariable var, Type type) { // TFunction result; // String before = this.toString(); // //* // left = left.substitute(var, type); // right = right.substitute(var, type); // result = this; // /*/ // result = function(left.substitute(var, type), right.substitute(var, type)); // //*/ // // System.out.println(var + " => " + type + " \n\t" + before + " => " + result + "\n"); // return result; // } // // @Override // public HashSet<TVariable> ftv() { // HashSet<TVariable> set = new HashSet<>(left.ftv()); // set.addAll(right.ftv()); // return set; // } // //Substitutable - End // // // @Override // protected Substitution unifyWith(TFunction fun) { // Substitution sub1 = left.unifyWith(fun.left); // Substitution sub2 = right.apply(sub1).unifyWith(fun.right.apply(sub1)); // Substitution sub = sub2.composeWith(sub1); // System.out.println("Unifyed " + this + " with " + fun + " : "); // System.out.println(sub); // return sub; // } // // @Override // public Type instantiate(Substitution sub) { // return function(left.instantiate(sub), right.instantiate(sub)); // } // // // Object override - Begin // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // TFunction tFunction = (TFunction) o; // // return left.equals(tFunction.left) && right.equals(tFunction.right); // // } // // @Override // public int hashCode() { // return hash(left, right); // } // // @Override // public String toString() { // return "(" + left + " → " + right + ")"; // } // // //Object override - End // } // // Path: src/main/java/types/Type.java // public abstract class Type extends Substitutable<Type> implements Unifyable{ // // @Override // public Type identity() { // return this; // } // // @Override // public final Substitution unifyWith(Type type) { // if(this.equals(type)) return new Substitution(); // if(type instanceof TVariable) return unifyWith((TVariable) type); // if(type instanceof TFunction) return unifyWith((TFunction) type); // if(type instanceof TConstructor) return unifyWith((TConstructor) type); // throw new UnificationFailException(this, type); // } // // protected Substitution unifyWith(TVariable var) { // return bind(var, this); // } // // protected Substitution unifyWith(TFunction fun) { // throw new UnificationFailException(this, fun); // } // // protected Substitution unifyWith(TConstructor cons) { // throw new UnificationFailException(this, cons); // } // // public abstract Type instantiate(Substitution sub); // } // Path: src/test/java/ast/LetTest.java import org.junit.Test; import types.TFunction; import types.Type; import static org.junit.Assert.*; package ast; /** * Created by maeln on 20/10/16. */ public class LetTest { @Test public void infer() throws Exception { final String name = "x"; Expression exp = new Let(new Variable(name), new Lambda(new Variable(name), new Variable(name)), new Variable(name));
Type t = exp.infer();
maeln/LambdaHindleyMilner
src/test/java/ast/LetTest.java
// Path: src/main/java/types/TFunction.java // public class TFunction extends Type { // private Type left; // private Type right; // private final static HashMap<Integer, TFunction> instantiated = new HashMap<>(); // // private TFunction(Type left, Type right) { // this.left = left; // this.right = right; // } // // public Type left() { // return left; // } // // public Type right() { // return right; // } // // public static TFunction function(Type left, Type right) { // int hash = hash(left, right); // TFunction f = instantiated.get(hash); // if(f == null) { // f = new TFunction(left, right); // instantiated.put(hash, f); // } // return f; // } // // private static int hash(Type left, Type right) { // int result = left.hashCode(); // result = 31 * result + right.hashCode(); // return result; // } // // // Substitutable - Begin // @Override // public Type substitute(TVariable var, Type type) { // TFunction result; // String before = this.toString(); // //* // left = left.substitute(var, type); // right = right.substitute(var, type); // result = this; // /*/ // result = function(left.substitute(var, type), right.substitute(var, type)); // //*/ // // System.out.println(var + " => " + type + " \n\t" + before + " => " + result + "\n"); // return result; // } // // @Override // public HashSet<TVariable> ftv() { // HashSet<TVariable> set = new HashSet<>(left.ftv()); // set.addAll(right.ftv()); // return set; // } // //Substitutable - End // // // @Override // protected Substitution unifyWith(TFunction fun) { // Substitution sub1 = left.unifyWith(fun.left); // Substitution sub2 = right.apply(sub1).unifyWith(fun.right.apply(sub1)); // Substitution sub = sub2.composeWith(sub1); // System.out.println("Unifyed " + this + " with " + fun + " : "); // System.out.println(sub); // return sub; // } // // @Override // public Type instantiate(Substitution sub) { // return function(left.instantiate(sub), right.instantiate(sub)); // } // // // Object override - Begin // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // TFunction tFunction = (TFunction) o; // // return left.equals(tFunction.left) && right.equals(tFunction.right); // // } // // @Override // public int hashCode() { // return hash(left, right); // } // // @Override // public String toString() { // return "(" + left + " → " + right + ")"; // } // // //Object override - End // } // // Path: src/main/java/types/Type.java // public abstract class Type extends Substitutable<Type> implements Unifyable{ // // @Override // public Type identity() { // return this; // } // // @Override // public final Substitution unifyWith(Type type) { // if(this.equals(type)) return new Substitution(); // if(type instanceof TVariable) return unifyWith((TVariable) type); // if(type instanceof TFunction) return unifyWith((TFunction) type); // if(type instanceof TConstructor) return unifyWith((TConstructor) type); // throw new UnificationFailException(this, type); // } // // protected Substitution unifyWith(TVariable var) { // return bind(var, this); // } // // protected Substitution unifyWith(TFunction fun) { // throw new UnificationFailException(this, fun); // } // // protected Substitution unifyWith(TConstructor cons) { // throw new UnificationFailException(this, cons); // } // // public abstract Type instantiate(Substitution sub); // }
import org.junit.Test; import types.TFunction; import types.Type; import static org.junit.Assert.*;
package ast; /** * Created by maeln on 20/10/16. */ public class LetTest { @Test public void infer() throws Exception { final String name = "x"; Expression exp = new Let(new Variable(name), new Lambda(new Variable(name), new Variable(name)), new Variable(name)); Type t = exp.infer();
// Path: src/main/java/types/TFunction.java // public class TFunction extends Type { // private Type left; // private Type right; // private final static HashMap<Integer, TFunction> instantiated = new HashMap<>(); // // private TFunction(Type left, Type right) { // this.left = left; // this.right = right; // } // // public Type left() { // return left; // } // // public Type right() { // return right; // } // // public static TFunction function(Type left, Type right) { // int hash = hash(left, right); // TFunction f = instantiated.get(hash); // if(f == null) { // f = new TFunction(left, right); // instantiated.put(hash, f); // } // return f; // } // // private static int hash(Type left, Type right) { // int result = left.hashCode(); // result = 31 * result + right.hashCode(); // return result; // } // // // Substitutable - Begin // @Override // public Type substitute(TVariable var, Type type) { // TFunction result; // String before = this.toString(); // //* // left = left.substitute(var, type); // right = right.substitute(var, type); // result = this; // /*/ // result = function(left.substitute(var, type), right.substitute(var, type)); // //*/ // // System.out.println(var + " => " + type + " \n\t" + before + " => " + result + "\n"); // return result; // } // // @Override // public HashSet<TVariable> ftv() { // HashSet<TVariable> set = new HashSet<>(left.ftv()); // set.addAll(right.ftv()); // return set; // } // //Substitutable - End // // // @Override // protected Substitution unifyWith(TFunction fun) { // Substitution sub1 = left.unifyWith(fun.left); // Substitution sub2 = right.apply(sub1).unifyWith(fun.right.apply(sub1)); // Substitution sub = sub2.composeWith(sub1); // System.out.println("Unifyed " + this + " with " + fun + " : "); // System.out.println(sub); // return sub; // } // // @Override // public Type instantiate(Substitution sub) { // return function(left.instantiate(sub), right.instantiate(sub)); // } // // // Object override - Begin // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // TFunction tFunction = (TFunction) o; // // return left.equals(tFunction.left) && right.equals(tFunction.right); // // } // // @Override // public int hashCode() { // return hash(left, right); // } // // @Override // public String toString() { // return "(" + left + " → " + right + ")"; // } // // //Object override - End // } // // Path: src/main/java/types/Type.java // public abstract class Type extends Substitutable<Type> implements Unifyable{ // // @Override // public Type identity() { // return this; // } // // @Override // public final Substitution unifyWith(Type type) { // if(this.equals(type)) return new Substitution(); // if(type instanceof TVariable) return unifyWith((TVariable) type); // if(type instanceof TFunction) return unifyWith((TFunction) type); // if(type instanceof TConstructor) return unifyWith((TConstructor) type); // throw new UnificationFailException(this, type); // } // // protected Substitution unifyWith(TVariable var) { // return bind(var, this); // } // // protected Substitution unifyWith(TFunction fun) { // throw new UnificationFailException(this, fun); // } // // protected Substitution unifyWith(TConstructor cons) { // throw new UnificationFailException(this, cons); // } // // public abstract Type instantiate(Substitution sub); // } // Path: src/test/java/ast/LetTest.java import org.junit.Test; import types.TFunction; import types.Type; import static org.junit.Assert.*; package ast; /** * Created by maeln on 20/10/16. */ public class LetTest { @Test public void infer() throws Exception { final String name = "x"; Expression exp = new Let(new Variable(name), new Lambda(new Variable(name), new Variable(name)), new Variable(name)); Type t = exp.infer();
assertTrue("Should return a TFunction", t instanceof TFunction);
maeln/LambdaHindleyMilner
src/test/java/ast/LambdaTest.java
// Path: src/main/java/types/TFunction.java // public class TFunction extends Type { // private Type left; // private Type right; // private final static HashMap<Integer, TFunction> instantiated = new HashMap<>(); // // private TFunction(Type left, Type right) { // this.left = left; // this.right = right; // } // // public Type left() { // return left; // } // // public Type right() { // return right; // } // // public static TFunction function(Type left, Type right) { // int hash = hash(left, right); // TFunction f = instantiated.get(hash); // if(f == null) { // f = new TFunction(left, right); // instantiated.put(hash, f); // } // return f; // } // // private static int hash(Type left, Type right) { // int result = left.hashCode(); // result = 31 * result + right.hashCode(); // return result; // } // // // Substitutable - Begin // @Override // public Type substitute(TVariable var, Type type) { // TFunction result; // String before = this.toString(); // //* // left = left.substitute(var, type); // right = right.substitute(var, type); // result = this; // /*/ // result = function(left.substitute(var, type), right.substitute(var, type)); // //*/ // // System.out.println(var + " => " + type + " \n\t" + before + " => " + result + "\n"); // return result; // } // // @Override // public HashSet<TVariable> ftv() { // HashSet<TVariable> set = new HashSet<>(left.ftv()); // set.addAll(right.ftv()); // return set; // } // //Substitutable - End // // // @Override // protected Substitution unifyWith(TFunction fun) { // Substitution sub1 = left.unifyWith(fun.left); // Substitution sub2 = right.apply(sub1).unifyWith(fun.right.apply(sub1)); // Substitution sub = sub2.composeWith(sub1); // System.out.println("Unifyed " + this + " with " + fun + " : "); // System.out.println(sub); // return sub; // } // // @Override // public Type instantiate(Substitution sub) { // return function(left.instantiate(sub), right.instantiate(sub)); // } // // // Object override - Begin // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // TFunction tFunction = (TFunction) o; // // return left.equals(tFunction.left) && right.equals(tFunction.right); // // } // // @Override // public int hashCode() { // return hash(left, right); // } // // @Override // public String toString() { // return "(" + left + " → " + right + ")"; // } // // //Object override - End // } // // Path: src/main/java/types/Type.java // public abstract class Type extends Substitutable<Type> implements Unifyable{ // // @Override // public Type identity() { // return this; // } // // @Override // public final Substitution unifyWith(Type type) { // if(this.equals(type)) return new Substitution(); // if(type instanceof TVariable) return unifyWith((TVariable) type); // if(type instanceof TFunction) return unifyWith((TFunction) type); // if(type instanceof TConstructor) return unifyWith((TConstructor) type); // throw new UnificationFailException(this, type); // } // // protected Substitution unifyWith(TVariable var) { // return bind(var, this); // } // // protected Substitution unifyWith(TFunction fun) { // throw new UnificationFailException(this, fun); // } // // protected Substitution unifyWith(TConstructor cons) { // throw new UnificationFailException(this, cons); // } // // public abstract Type instantiate(Substitution sub); // }
import org.junit.Test; import types.TFunction; import types.Type; import static org.junit.Assert.*;
package ast; /** * Created by maeln on 20/10/16. */ public class LambdaTest { @Test public void infer() throws Exception { final String name = "x"; Expression exp = new Lambda(new Variable(name), new Variable(name));
// Path: src/main/java/types/TFunction.java // public class TFunction extends Type { // private Type left; // private Type right; // private final static HashMap<Integer, TFunction> instantiated = new HashMap<>(); // // private TFunction(Type left, Type right) { // this.left = left; // this.right = right; // } // // public Type left() { // return left; // } // // public Type right() { // return right; // } // // public static TFunction function(Type left, Type right) { // int hash = hash(left, right); // TFunction f = instantiated.get(hash); // if(f == null) { // f = new TFunction(left, right); // instantiated.put(hash, f); // } // return f; // } // // private static int hash(Type left, Type right) { // int result = left.hashCode(); // result = 31 * result + right.hashCode(); // return result; // } // // // Substitutable - Begin // @Override // public Type substitute(TVariable var, Type type) { // TFunction result; // String before = this.toString(); // //* // left = left.substitute(var, type); // right = right.substitute(var, type); // result = this; // /*/ // result = function(left.substitute(var, type), right.substitute(var, type)); // //*/ // // System.out.println(var + " => " + type + " \n\t" + before + " => " + result + "\n"); // return result; // } // // @Override // public HashSet<TVariable> ftv() { // HashSet<TVariable> set = new HashSet<>(left.ftv()); // set.addAll(right.ftv()); // return set; // } // //Substitutable - End // // // @Override // protected Substitution unifyWith(TFunction fun) { // Substitution sub1 = left.unifyWith(fun.left); // Substitution sub2 = right.apply(sub1).unifyWith(fun.right.apply(sub1)); // Substitution sub = sub2.composeWith(sub1); // System.out.println("Unifyed " + this + " with " + fun + " : "); // System.out.println(sub); // return sub; // } // // @Override // public Type instantiate(Substitution sub) { // return function(left.instantiate(sub), right.instantiate(sub)); // } // // // Object override - Begin // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // TFunction tFunction = (TFunction) o; // // return left.equals(tFunction.left) && right.equals(tFunction.right); // // } // // @Override // public int hashCode() { // return hash(left, right); // } // // @Override // public String toString() { // return "(" + left + " → " + right + ")"; // } // // //Object override - End // } // // Path: src/main/java/types/Type.java // public abstract class Type extends Substitutable<Type> implements Unifyable{ // // @Override // public Type identity() { // return this; // } // // @Override // public final Substitution unifyWith(Type type) { // if(this.equals(type)) return new Substitution(); // if(type instanceof TVariable) return unifyWith((TVariable) type); // if(type instanceof TFunction) return unifyWith((TFunction) type); // if(type instanceof TConstructor) return unifyWith((TConstructor) type); // throw new UnificationFailException(this, type); // } // // protected Substitution unifyWith(TVariable var) { // return bind(var, this); // } // // protected Substitution unifyWith(TFunction fun) { // throw new UnificationFailException(this, fun); // } // // protected Substitution unifyWith(TConstructor cons) { // throw new UnificationFailException(this, cons); // } // // public abstract Type instantiate(Substitution sub); // } // Path: src/test/java/ast/LambdaTest.java import org.junit.Test; import types.TFunction; import types.Type; import static org.junit.Assert.*; package ast; /** * Created by maeln on 20/10/16. */ public class LambdaTest { @Test public void infer() throws Exception { final String name = "x"; Expression exp = new Lambda(new Variable(name), new Variable(name));
Type t = exp.infer();
maeln/LambdaHindleyMilner
src/test/java/ast/LambdaTest.java
// Path: src/main/java/types/TFunction.java // public class TFunction extends Type { // private Type left; // private Type right; // private final static HashMap<Integer, TFunction> instantiated = new HashMap<>(); // // private TFunction(Type left, Type right) { // this.left = left; // this.right = right; // } // // public Type left() { // return left; // } // // public Type right() { // return right; // } // // public static TFunction function(Type left, Type right) { // int hash = hash(left, right); // TFunction f = instantiated.get(hash); // if(f == null) { // f = new TFunction(left, right); // instantiated.put(hash, f); // } // return f; // } // // private static int hash(Type left, Type right) { // int result = left.hashCode(); // result = 31 * result + right.hashCode(); // return result; // } // // // Substitutable - Begin // @Override // public Type substitute(TVariable var, Type type) { // TFunction result; // String before = this.toString(); // //* // left = left.substitute(var, type); // right = right.substitute(var, type); // result = this; // /*/ // result = function(left.substitute(var, type), right.substitute(var, type)); // //*/ // // System.out.println(var + " => " + type + " \n\t" + before + " => " + result + "\n"); // return result; // } // // @Override // public HashSet<TVariable> ftv() { // HashSet<TVariable> set = new HashSet<>(left.ftv()); // set.addAll(right.ftv()); // return set; // } // //Substitutable - End // // // @Override // protected Substitution unifyWith(TFunction fun) { // Substitution sub1 = left.unifyWith(fun.left); // Substitution sub2 = right.apply(sub1).unifyWith(fun.right.apply(sub1)); // Substitution sub = sub2.composeWith(sub1); // System.out.println("Unifyed " + this + " with " + fun + " : "); // System.out.println(sub); // return sub; // } // // @Override // public Type instantiate(Substitution sub) { // return function(left.instantiate(sub), right.instantiate(sub)); // } // // // Object override - Begin // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // TFunction tFunction = (TFunction) o; // // return left.equals(tFunction.left) && right.equals(tFunction.right); // // } // // @Override // public int hashCode() { // return hash(left, right); // } // // @Override // public String toString() { // return "(" + left + " → " + right + ")"; // } // // //Object override - End // } // // Path: src/main/java/types/Type.java // public abstract class Type extends Substitutable<Type> implements Unifyable{ // // @Override // public Type identity() { // return this; // } // // @Override // public final Substitution unifyWith(Type type) { // if(this.equals(type)) return new Substitution(); // if(type instanceof TVariable) return unifyWith((TVariable) type); // if(type instanceof TFunction) return unifyWith((TFunction) type); // if(type instanceof TConstructor) return unifyWith((TConstructor) type); // throw new UnificationFailException(this, type); // } // // protected Substitution unifyWith(TVariable var) { // return bind(var, this); // } // // protected Substitution unifyWith(TFunction fun) { // throw new UnificationFailException(this, fun); // } // // protected Substitution unifyWith(TConstructor cons) { // throw new UnificationFailException(this, cons); // } // // public abstract Type instantiate(Substitution sub); // }
import org.junit.Test; import types.TFunction; import types.Type; import static org.junit.Assert.*;
package ast; /** * Created by maeln on 20/10/16. */ public class LambdaTest { @Test public void infer() throws Exception { final String name = "x"; Expression exp = new Lambda(new Variable(name), new Variable(name)); Type t = exp.infer();
// Path: src/main/java/types/TFunction.java // public class TFunction extends Type { // private Type left; // private Type right; // private final static HashMap<Integer, TFunction> instantiated = new HashMap<>(); // // private TFunction(Type left, Type right) { // this.left = left; // this.right = right; // } // // public Type left() { // return left; // } // // public Type right() { // return right; // } // // public static TFunction function(Type left, Type right) { // int hash = hash(left, right); // TFunction f = instantiated.get(hash); // if(f == null) { // f = new TFunction(left, right); // instantiated.put(hash, f); // } // return f; // } // // private static int hash(Type left, Type right) { // int result = left.hashCode(); // result = 31 * result + right.hashCode(); // return result; // } // // // Substitutable - Begin // @Override // public Type substitute(TVariable var, Type type) { // TFunction result; // String before = this.toString(); // //* // left = left.substitute(var, type); // right = right.substitute(var, type); // result = this; // /*/ // result = function(left.substitute(var, type), right.substitute(var, type)); // //*/ // // System.out.println(var + " => " + type + " \n\t" + before + " => " + result + "\n"); // return result; // } // // @Override // public HashSet<TVariable> ftv() { // HashSet<TVariable> set = new HashSet<>(left.ftv()); // set.addAll(right.ftv()); // return set; // } // //Substitutable - End // // // @Override // protected Substitution unifyWith(TFunction fun) { // Substitution sub1 = left.unifyWith(fun.left); // Substitution sub2 = right.apply(sub1).unifyWith(fun.right.apply(sub1)); // Substitution sub = sub2.composeWith(sub1); // System.out.println("Unifyed " + this + " with " + fun + " : "); // System.out.println(sub); // return sub; // } // // @Override // public Type instantiate(Substitution sub) { // return function(left.instantiate(sub), right.instantiate(sub)); // } // // // Object override - Begin // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // TFunction tFunction = (TFunction) o; // // return left.equals(tFunction.left) && right.equals(tFunction.right); // // } // // @Override // public int hashCode() { // return hash(left, right); // } // // @Override // public String toString() { // return "(" + left + " → " + right + ")"; // } // // //Object override - End // } // // Path: src/main/java/types/Type.java // public abstract class Type extends Substitutable<Type> implements Unifyable{ // // @Override // public Type identity() { // return this; // } // // @Override // public final Substitution unifyWith(Type type) { // if(this.equals(type)) return new Substitution(); // if(type instanceof TVariable) return unifyWith((TVariable) type); // if(type instanceof TFunction) return unifyWith((TFunction) type); // if(type instanceof TConstructor) return unifyWith((TConstructor) type); // throw new UnificationFailException(this, type); // } // // protected Substitution unifyWith(TVariable var) { // return bind(var, this); // } // // protected Substitution unifyWith(TFunction fun) { // throw new UnificationFailException(this, fun); // } // // protected Substitution unifyWith(TConstructor cons) { // throw new UnificationFailException(this, cons); // } // // public abstract Type instantiate(Substitution sub); // } // Path: src/test/java/ast/LambdaTest.java import org.junit.Test; import types.TFunction; import types.Type; import static org.junit.Assert.*; package ast; /** * Created by maeln on 20/10/16. */ public class LambdaTest { @Test public void infer() throws Exception { final String name = "x"; Expression exp = new Lambda(new Variable(name), new Variable(name)); Type t = exp.infer();
assertTrue("Should return a TFunction", t instanceof TFunction);
maeln/LambdaHindleyMilner
src/test/java/types/TVariableTest.java
// Path: src/main/java/inference/Substitution.java // public class Substitution extends Substitutable<Substitution> { // private HashMap<TVariable, Type> subs = new HashMap<>(); // // public Substitution() {} // // public Substitution(TVariable variable, Type type) { // subs.put(variable, type); // } // // private Substitution(Substitution previous) { // subs.putAll(previous.subs); // } // // public Substitution(List<TVariable> vars, List<Type> substitute) { // if(vars.size() != substitute.size()) // throw new IllegalArgumentException("Number of variables have to match number of types"); // // for (int i = 0; i < vars.size(); i++) subs.put(vars.get(i), substitute.get(i)); // } // // public List<TVariable> variables() { // return new LinkedList<>(subs.keySet()); // } // // public Type substituteOf(TVariable var) { // return subs.get(var); // } // // public Substitution composeWith(Substitution sub) { // Substitution substituted = new Substitution(sub); // substituted.apply(this); // subs.putAll(substituted.subs); // return this; // } // // @Override // public HashSet<TVariable> ftv() { // HashSet<TVariable> freeVars = new HashSet<>(); // for (TVariable var : variables()) freeVars.addAll(substituteOf(var).ftv()); // return freeVars; // } // // @Override // public Substitution substitute(TVariable var, Type t) { // for (TVariable variable : variables()) // subs.replace(variable, substituteOf(variable).substitute(var, t)); // return this; // } // // @Override // public String toString() { // return subs.toString(); // } // // @Override // public Substitution identity() { // return this; // } // } // // Path: src/main/java/types/TVariable.java // public static TVariable variable(String name) { // TVariable var = new TVariable(name); // if(!instantiated.add(var)) System.out.println("Creation avoidable : TVariable(" + name + ")"); // return var; // } // // Path: src/main/java/types/TVariable.java // public static List<TVariable> variables(String... names) { // List<TVariable> variables = new LinkedList<>(); // for (String name : names) variables.add(new TVariable(name)); // return variables; // }
import inference.Substitution; import org.junit.Test; import java.util.*; import static org.junit.Assert.assertEquals; import static types.TVariable.variable; import static types.TVariable.variables;
package types; /** * Created by valentin on 20/10/2016. */ public class TVariableTest { private static final String name = "TEST" ; private static final int n = 10; @Test public void createVariable() throws Exception {
// Path: src/main/java/inference/Substitution.java // public class Substitution extends Substitutable<Substitution> { // private HashMap<TVariable, Type> subs = new HashMap<>(); // // public Substitution() {} // // public Substitution(TVariable variable, Type type) { // subs.put(variable, type); // } // // private Substitution(Substitution previous) { // subs.putAll(previous.subs); // } // // public Substitution(List<TVariable> vars, List<Type> substitute) { // if(vars.size() != substitute.size()) // throw new IllegalArgumentException("Number of variables have to match number of types"); // // for (int i = 0; i < vars.size(); i++) subs.put(vars.get(i), substitute.get(i)); // } // // public List<TVariable> variables() { // return new LinkedList<>(subs.keySet()); // } // // public Type substituteOf(TVariable var) { // return subs.get(var); // } // // public Substitution composeWith(Substitution sub) { // Substitution substituted = new Substitution(sub); // substituted.apply(this); // subs.putAll(substituted.subs); // return this; // } // // @Override // public HashSet<TVariable> ftv() { // HashSet<TVariable> freeVars = new HashSet<>(); // for (TVariable var : variables()) freeVars.addAll(substituteOf(var).ftv()); // return freeVars; // } // // @Override // public Substitution substitute(TVariable var, Type t) { // for (TVariable variable : variables()) // subs.replace(variable, substituteOf(variable).substitute(var, t)); // return this; // } // // @Override // public String toString() { // return subs.toString(); // } // // @Override // public Substitution identity() { // return this; // } // } // // Path: src/main/java/types/TVariable.java // public static TVariable variable(String name) { // TVariable var = new TVariable(name); // if(!instantiated.add(var)) System.out.println("Creation avoidable : TVariable(" + name + ")"); // return var; // } // // Path: src/main/java/types/TVariable.java // public static List<TVariable> variables(String... names) { // List<TVariable> variables = new LinkedList<>(); // for (String name : names) variables.add(new TVariable(name)); // return variables; // } // Path: src/test/java/types/TVariableTest.java import inference.Substitution; import org.junit.Test; import java.util.*; import static org.junit.Assert.assertEquals; import static types.TVariable.variable; import static types.TVariable.variables; package types; /** * Created by valentin on 20/10/2016. */ public class TVariableTest { private static final String name = "TEST" ; private static final int n = 10; @Test public void createVariable() throws Exception {
TVariable var = variable(name);
maeln/LambdaHindleyMilner
src/test/java/types/TVariableTest.java
// Path: src/main/java/inference/Substitution.java // public class Substitution extends Substitutable<Substitution> { // private HashMap<TVariable, Type> subs = new HashMap<>(); // // public Substitution() {} // // public Substitution(TVariable variable, Type type) { // subs.put(variable, type); // } // // private Substitution(Substitution previous) { // subs.putAll(previous.subs); // } // // public Substitution(List<TVariable> vars, List<Type> substitute) { // if(vars.size() != substitute.size()) // throw new IllegalArgumentException("Number of variables have to match number of types"); // // for (int i = 0; i < vars.size(); i++) subs.put(vars.get(i), substitute.get(i)); // } // // public List<TVariable> variables() { // return new LinkedList<>(subs.keySet()); // } // // public Type substituteOf(TVariable var) { // return subs.get(var); // } // // public Substitution composeWith(Substitution sub) { // Substitution substituted = new Substitution(sub); // substituted.apply(this); // subs.putAll(substituted.subs); // return this; // } // // @Override // public HashSet<TVariable> ftv() { // HashSet<TVariable> freeVars = new HashSet<>(); // for (TVariable var : variables()) freeVars.addAll(substituteOf(var).ftv()); // return freeVars; // } // // @Override // public Substitution substitute(TVariable var, Type t) { // for (TVariable variable : variables()) // subs.replace(variable, substituteOf(variable).substitute(var, t)); // return this; // } // // @Override // public String toString() { // return subs.toString(); // } // // @Override // public Substitution identity() { // return this; // } // } // // Path: src/main/java/types/TVariable.java // public static TVariable variable(String name) { // TVariable var = new TVariable(name); // if(!instantiated.add(var)) System.out.println("Creation avoidable : TVariable(" + name + ")"); // return var; // } // // Path: src/main/java/types/TVariable.java // public static List<TVariable> variables(String... names) { // List<TVariable> variables = new LinkedList<>(); // for (String name : names) variables.add(new TVariable(name)); // return variables; // }
import inference.Substitution; import org.junit.Test; import java.util.*; import static org.junit.Assert.assertEquals; import static types.TVariable.variable; import static types.TVariable.variables;
package types; /** * Created by valentin on 20/10/2016. */ public class TVariableTest { private static final String name = "TEST" ; private static final int n = 10; @Test public void createVariable() throws Exception { TVariable var = variable(name); assertEquals("Should create a variable with the correct name", name, var.name()); } @Test public void createVariables() throws Exception { String[] names = new String[n]; for (int i = 0; i < n; i++) names[i] = name + i;
// Path: src/main/java/inference/Substitution.java // public class Substitution extends Substitutable<Substitution> { // private HashMap<TVariable, Type> subs = new HashMap<>(); // // public Substitution() {} // // public Substitution(TVariable variable, Type type) { // subs.put(variable, type); // } // // private Substitution(Substitution previous) { // subs.putAll(previous.subs); // } // // public Substitution(List<TVariable> vars, List<Type> substitute) { // if(vars.size() != substitute.size()) // throw new IllegalArgumentException("Number of variables have to match number of types"); // // for (int i = 0; i < vars.size(); i++) subs.put(vars.get(i), substitute.get(i)); // } // // public List<TVariable> variables() { // return new LinkedList<>(subs.keySet()); // } // // public Type substituteOf(TVariable var) { // return subs.get(var); // } // // public Substitution composeWith(Substitution sub) { // Substitution substituted = new Substitution(sub); // substituted.apply(this); // subs.putAll(substituted.subs); // return this; // } // // @Override // public HashSet<TVariable> ftv() { // HashSet<TVariable> freeVars = new HashSet<>(); // for (TVariable var : variables()) freeVars.addAll(substituteOf(var).ftv()); // return freeVars; // } // // @Override // public Substitution substitute(TVariable var, Type t) { // for (TVariable variable : variables()) // subs.replace(variable, substituteOf(variable).substitute(var, t)); // return this; // } // // @Override // public String toString() { // return subs.toString(); // } // // @Override // public Substitution identity() { // return this; // } // } // // Path: src/main/java/types/TVariable.java // public static TVariable variable(String name) { // TVariable var = new TVariable(name); // if(!instantiated.add(var)) System.out.println("Creation avoidable : TVariable(" + name + ")"); // return var; // } // // Path: src/main/java/types/TVariable.java // public static List<TVariable> variables(String... names) { // List<TVariable> variables = new LinkedList<>(); // for (String name : names) variables.add(new TVariable(name)); // return variables; // } // Path: src/test/java/types/TVariableTest.java import inference.Substitution; import org.junit.Test; import java.util.*; import static org.junit.Assert.assertEquals; import static types.TVariable.variable; import static types.TVariable.variables; package types; /** * Created by valentin on 20/10/2016. */ public class TVariableTest { private static final String name = "TEST" ; private static final int n = 10; @Test public void createVariable() throws Exception { TVariable var = variable(name); assertEquals("Should create a variable with the correct name", name, var.name()); } @Test public void createVariables() throws Exception { String[] names = new String[n]; for (int i = 0; i < n; i++) names[i] = name + i;
List<TVariable> vars = variables(names);
maeln/LambdaHindleyMilner
src/test/java/types/TVariableTest.java
// Path: src/main/java/inference/Substitution.java // public class Substitution extends Substitutable<Substitution> { // private HashMap<TVariable, Type> subs = new HashMap<>(); // // public Substitution() {} // // public Substitution(TVariable variable, Type type) { // subs.put(variable, type); // } // // private Substitution(Substitution previous) { // subs.putAll(previous.subs); // } // // public Substitution(List<TVariable> vars, List<Type> substitute) { // if(vars.size() != substitute.size()) // throw new IllegalArgumentException("Number of variables have to match number of types"); // // for (int i = 0; i < vars.size(); i++) subs.put(vars.get(i), substitute.get(i)); // } // // public List<TVariable> variables() { // return new LinkedList<>(subs.keySet()); // } // // public Type substituteOf(TVariable var) { // return subs.get(var); // } // // public Substitution composeWith(Substitution sub) { // Substitution substituted = new Substitution(sub); // substituted.apply(this); // subs.putAll(substituted.subs); // return this; // } // // @Override // public HashSet<TVariable> ftv() { // HashSet<TVariable> freeVars = new HashSet<>(); // for (TVariable var : variables()) freeVars.addAll(substituteOf(var).ftv()); // return freeVars; // } // // @Override // public Substitution substitute(TVariable var, Type t) { // for (TVariable variable : variables()) // subs.replace(variable, substituteOf(variable).substitute(var, t)); // return this; // } // // @Override // public String toString() { // return subs.toString(); // } // // @Override // public Substitution identity() { // return this; // } // } // // Path: src/main/java/types/TVariable.java // public static TVariable variable(String name) { // TVariable var = new TVariable(name); // if(!instantiated.add(var)) System.out.println("Creation avoidable : TVariable(" + name + ")"); // return var; // } // // Path: src/main/java/types/TVariable.java // public static List<TVariable> variables(String... names) { // List<TVariable> variables = new LinkedList<>(); // for (String name : names) variables.add(new TVariable(name)); // return variables; // }
import inference.Substitution; import org.junit.Test; import java.util.*; import static org.junit.Assert.assertEquals; import static types.TVariable.variable; import static types.TVariable.variables;
package types; /** * Created by valentin on 20/10/2016. */ public class TVariableTest { private static final String name = "TEST" ; private static final int n = 10; @Test public void createVariable() throws Exception { TVariable var = variable(name); assertEquals("Should create a variable with the correct name", name, var.name()); } @Test public void createVariables() throws Exception { String[] names = new String[n]; for (int i = 0; i < n; i++) names[i] = name + i; List<TVariable> vars = variables(names); assertEquals("Should create 10 variables", n, vars.size()); for (int i = 0; i < n; i++) { assertEquals("Should create variables with correct name", names[i], vars.get(i).name()); } } @Test public void applyNotMatching() throws Exception {
// Path: src/main/java/inference/Substitution.java // public class Substitution extends Substitutable<Substitution> { // private HashMap<TVariable, Type> subs = new HashMap<>(); // // public Substitution() {} // // public Substitution(TVariable variable, Type type) { // subs.put(variable, type); // } // // private Substitution(Substitution previous) { // subs.putAll(previous.subs); // } // // public Substitution(List<TVariable> vars, List<Type> substitute) { // if(vars.size() != substitute.size()) // throw new IllegalArgumentException("Number of variables have to match number of types"); // // for (int i = 0; i < vars.size(); i++) subs.put(vars.get(i), substitute.get(i)); // } // // public List<TVariable> variables() { // return new LinkedList<>(subs.keySet()); // } // // public Type substituteOf(TVariable var) { // return subs.get(var); // } // // public Substitution composeWith(Substitution sub) { // Substitution substituted = new Substitution(sub); // substituted.apply(this); // subs.putAll(substituted.subs); // return this; // } // // @Override // public HashSet<TVariable> ftv() { // HashSet<TVariable> freeVars = new HashSet<>(); // for (TVariable var : variables()) freeVars.addAll(substituteOf(var).ftv()); // return freeVars; // } // // @Override // public Substitution substitute(TVariable var, Type t) { // for (TVariable variable : variables()) // subs.replace(variable, substituteOf(variable).substitute(var, t)); // return this; // } // // @Override // public String toString() { // return subs.toString(); // } // // @Override // public Substitution identity() { // return this; // } // } // // Path: src/main/java/types/TVariable.java // public static TVariable variable(String name) { // TVariable var = new TVariable(name); // if(!instantiated.add(var)) System.out.println("Creation avoidable : TVariable(" + name + ")"); // return var; // } // // Path: src/main/java/types/TVariable.java // public static List<TVariable> variables(String... names) { // List<TVariable> variables = new LinkedList<>(); // for (String name : names) variables.add(new TVariable(name)); // return variables; // } // Path: src/test/java/types/TVariableTest.java import inference.Substitution; import org.junit.Test; import java.util.*; import static org.junit.Assert.assertEquals; import static types.TVariable.variable; import static types.TVariable.variables; package types; /** * Created by valentin on 20/10/2016. */ public class TVariableTest { private static final String name = "TEST" ; private static final int n = 10; @Test public void createVariable() throws Exception { TVariable var = variable(name); assertEquals("Should create a variable with the correct name", name, var.name()); } @Test public void createVariables() throws Exception { String[] names = new String[n]; for (int i = 0; i < n; i++) names[i] = name + i; List<TVariable> vars = variables(names); assertEquals("Should create 10 variables", n, vars.size()); for (int i = 0; i < n; i++) { assertEquals("Should create variables with correct name", names[i], vars.get(i).name()); } } @Test public void applyNotMatching() throws Exception {
Substitution sub = new Substitution(variable("NOT MATCHING"), variable("NOT MATCHING"));
maeln/LambdaHindleyMilner
src/main/java/app/InferenceApp.java
// Path: src/main/java/ast/Expression.java // public abstract class Expression implements Inferable<TypeInferenceEnv, Type> { // // @Override // public final Type infer() { // TypeInferenceEnv typeInferenceEnv = new TypeInferenceEnv(); // Type t = infer(typeInferenceEnv); // // Substitution s = new Substitution(); // // for (Constraint constraint : typeInferenceEnv.constraints()) { // s = constraint.apply(s).unify().composeWith(s); // } // // return t.apply(s); // } // } // // Path: src/main/java/exceptions/InfiniteTypeException.java // public class InfiniteTypeException extends RuntimeException { // public InfiniteTypeException(Unifyable t1, Unifyable t2) { // super("This expression require an infinite type. (Trying to unify " + t1 + " and " +t2); // } // } // // Path: src/main/java/exceptions/UnboundVariableException.java // public class UnboundVariableException extends RuntimeException { // public UnboundVariableException(Variable var) { // super("The variable '" + var.getName() + "' is not bound."); // } // } // // Path: src/main/java/exceptions/UnificationFailException.java // public class UnificationFailException extends RuntimeException { // public UnificationFailException(Unifyable first, Unifyable second) { // super("The unification of inferred type for this expression has failed : " + first + " <=/=> " + second); // } // } // // Path: src/main/java/types/Type.java // public abstract class Type extends Substitutable<Type> implements Unifyable{ // // @Override // public Type identity() { // return this; // } // // @Override // public final Substitution unifyWith(Type type) { // if(this.equals(type)) return new Substitution(); // if(type instanceof TVariable) return unifyWith((TVariable) type); // if(type instanceof TFunction) return unifyWith((TFunction) type); // if(type instanceof TConstructor) return unifyWith((TConstructor) type); // throw new UnificationFailException(this, type); // } // // protected Substitution unifyWith(TVariable var) { // return bind(var, this); // } // // protected Substitution unifyWith(TFunction fun) { // throw new UnificationFailException(this, fun); // } // // protected Substitution unifyWith(TConstructor cons) { // throw new UnificationFailException(this, cons); // } // // public abstract Type instantiate(Substitution sub); // }
import ast.Expression; import exceptions.InfiniteTypeException; import exceptions.UnboundVariableException; import exceptions.UnificationFailException; import types.Type;
package app; /** * Created by valentin on 25/10/2016. */ public class InferenceApp { static void infer(Expression exp) { try {
// Path: src/main/java/ast/Expression.java // public abstract class Expression implements Inferable<TypeInferenceEnv, Type> { // // @Override // public final Type infer() { // TypeInferenceEnv typeInferenceEnv = new TypeInferenceEnv(); // Type t = infer(typeInferenceEnv); // // Substitution s = new Substitution(); // // for (Constraint constraint : typeInferenceEnv.constraints()) { // s = constraint.apply(s).unify().composeWith(s); // } // // return t.apply(s); // } // } // // Path: src/main/java/exceptions/InfiniteTypeException.java // public class InfiniteTypeException extends RuntimeException { // public InfiniteTypeException(Unifyable t1, Unifyable t2) { // super("This expression require an infinite type. (Trying to unify " + t1 + " and " +t2); // } // } // // Path: src/main/java/exceptions/UnboundVariableException.java // public class UnboundVariableException extends RuntimeException { // public UnboundVariableException(Variable var) { // super("The variable '" + var.getName() + "' is not bound."); // } // } // // Path: src/main/java/exceptions/UnificationFailException.java // public class UnificationFailException extends RuntimeException { // public UnificationFailException(Unifyable first, Unifyable second) { // super("The unification of inferred type for this expression has failed : " + first + " <=/=> " + second); // } // } // // Path: src/main/java/types/Type.java // public abstract class Type extends Substitutable<Type> implements Unifyable{ // // @Override // public Type identity() { // return this; // } // // @Override // public final Substitution unifyWith(Type type) { // if(this.equals(type)) return new Substitution(); // if(type instanceof TVariable) return unifyWith((TVariable) type); // if(type instanceof TFunction) return unifyWith((TFunction) type); // if(type instanceof TConstructor) return unifyWith((TConstructor) type); // throw new UnificationFailException(this, type); // } // // protected Substitution unifyWith(TVariable var) { // return bind(var, this); // } // // protected Substitution unifyWith(TFunction fun) { // throw new UnificationFailException(this, fun); // } // // protected Substitution unifyWith(TConstructor cons) { // throw new UnificationFailException(this, cons); // } // // public abstract Type instantiate(Substitution sub); // } // Path: src/main/java/app/InferenceApp.java import ast.Expression; import exceptions.InfiniteTypeException; import exceptions.UnboundVariableException; import exceptions.UnificationFailException; import types.Type; package app; /** * Created by valentin on 25/10/2016. */ public class InferenceApp { static void infer(Expression exp) { try {
Type t = exp.infer();
maeln/LambdaHindleyMilner
src/main/java/app/InferenceApp.java
// Path: src/main/java/ast/Expression.java // public abstract class Expression implements Inferable<TypeInferenceEnv, Type> { // // @Override // public final Type infer() { // TypeInferenceEnv typeInferenceEnv = new TypeInferenceEnv(); // Type t = infer(typeInferenceEnv); // // Substitution s = new Substitution(); // // for (Constraint constraint : typeInferenceEnv.constraints()) { // s = constraint.apply(s).unify().composeWith(s); // } // // return t.apply(s); // } // } // // Path: src/main/java/exceptions/InfiniteTypeException.java // public class InfiniteTypeException extends RuntimeException { // public InfiniteTypeException(Unifyable t1, Unifyable t2) { // super("This expression require an infinite type. (Trying to unify " + t1 + " and " +t2); // } // } // // Path: src/main/java/exceptions/UnboundVariableException.java // public class UnboundVariableException extends RuntimeException { // public UnboundVariableException(Variable var) { // super("The variable '" + var.getName() + "' is not bound."); // } // } // // Path: src/main/java/exceptions/UnificationFailException.java // public class UnificationFailException extends RuntimeException { // public UnificationFailException(Unifyable first, Unifyable second) { // super("The unification of inferred type for this expression has failed : " + first + " <=/=> " + second); // } // } // // Path: src/main/java/types/Type.java // public abstract class Type extends Substitutable<Type> implements Unifyable{ // // @Override // public Type identity() { // return this; // } // // @Override // public final Substitution unifyWith(Type type) { // if(this.equals(type)) return new Substitution(); // if(type instanceof TVariable) return unifyWith((TVariable) type); // if(type instanceof TFunction) return unifyWith((TFunction) type); // if(type instanceof TConstructor) return unifyWith((TConstructor) type); // throw new UnificationFailException(this, type); // } // // protected Substitution unifyWith(TVariable var) { // return bind(var, this); // } // // protected Substitution unifyWith(TFunction fun) { // throw new UnificationFailException(this, fun); // } // // protected Substitution unifyWith(TConstructor cons) { // throw new UnificationFailException(this, cons); // } // // public abstract Type instantiate(Substitution sub); // }
import ast.Expression; import exceptions.InfiniteTypeException; import exceptions.UnboundVariableException; import exceptions.UnificationFailException; import types.Type;
package app; /** * Created by valentin on 25/10/2016. */ public class InferenceApp { static void infer(Expression exp) { try { Type t = exp.infer(); System.out.println(exp + " :: " + t); }
// Path: src/main/java/ast/Expression.java // public abstract class Expression implements Inferable<TypeInferenceEnv, Type> { // // @Override // public final Type infer() { // TypeInferenceEnv typeInferenceEnv = new TypeInferenceEnv(); // Type t = infer(typeInferenceEnv); // // Substitution s = new Substitution(); // // for (Constraint constraint : typeInferenceEnv.constraints()) { // s = constraint.apply(s).unify().composeWith(s); // } // // return t.apply(s); // } // } // // Path: src/main/java/exceptions/InfiniteTypeException.java // public class InfiniteTypeException extends RuntimeException { // public InfiniteTypeException(Unifyable t1, Unifyable t2) { // super("This expression require an infinite type. (Trying to unify " + t1 + " and " +t2); // } // } // // Path: src/main/java/exceptions/UnboundVariableException.java // public class UnboundVariableException extends RuntimeException { // public UnboundVariableException(Variable var) { // super("The variable '" + var.getName() + "' is not bound."); // } // } // // Path: src/main/java/exceptions/UnificationFailException.java // public class UnificationFailException extends RuntimeException { // public UnificationFailException(Unifyable first, Unifyable second) { // super("The unification of inferred type for this expression has failed : " + first + " <=/=> " + second); // } // } // // Path: src/main/java/types/Type.java // public abstract class Type extends Substitutable<Type> implements Unifyable{ // // @Override // public Type identity() { // return this; // } // // @Override // public final Substitution unifyWith(Type type) { // if(this.equals(type)) return new Substitution(); // if(type instanceof TVariable) return unifyWith((TVariable) type); // if(type instanceof TFunction) return unifyWith((TFunction) type); // if(type instanceof TConstructor) return unifyWith((TConstructor) type); // throw new UnificationFailException(this, type); // } // // protected Substitution unifyWith(TVariable var) { // return bind(var, this); // } // // protected Substitution unifyWith(TFunction fun) { // throw new UnificationFailException(this, fun); // } // // protected Substitution unifyWith(TConstructor cons) { // throw new UnificationFailException(this, cons); // } // // public abstract Type instantiate(Substitution sub); // } // Path: src/main/java/app/InferenceApp.java import ast.Expression; import exceptions.InfiniteTypeException; import exceptions.UnboundVariableException; import exceptions.UnificationFailException; import types.Type; package app; /** * Created by valentin on 25/10/2016. */ public class InferenceApp { static void infer(Expression exp) { try { Type t = exp.infer(); System.out.println(exp + " :: " + t); }
catch (InfiniteTypeException | UnboundVariableException | UnificationFailException e) {
maeln/LambdaHindleyMilner
src/main/java/app/InferenceApp.java
// Path: src/main/java/ast/Expression.java // public abstract class Expression implements Inferable<TypeInferenceEnv, Type> { // // @Override // public final Type infer() { // TypeInferenceEnv typeInferenceEnv = new TypeInferenceEnv(); // Type t = infer(typeInferenceEnv); // // Substitution s = new Substitution(); // // for (Constraint constraint : typeInferenceEnv.constraints()) { // s = constraint.apply(s).unify().composeWith(s); // } // // return t.apply(s); // } // } // // Path: src/main/java/exceptions/InfiniteTypeException.java // public class InfiniteTypeException extends RuntimeException { // public InfiniteTypeException(Unifyable t1, Unifyable t2) { // super("This expression require an infinite type. (Trying to unify " + t1 + " and " +t2); // } // } // // Path: src/main/java/exceptions/UnboundVariableException.java // public class UnboundVariableException extends RuntimeException { // public UnboundVariableException(Variable var) { // super("The variable '" + var.getName() + "' is not bound."); // } // } // // Path: src/main/java/exceptions/UnificationFailException.java // public class UnificationFailException extends RuntimeException { // public UnificationFailException(Unifyable first, Unifyable second) { // super("The unification of inferred type for this expression has failed : " + first + " <=/=> " + second); // } // } // // Path: src/main/java/types/Type.java // public abstract class Type extends Substitutable<Type> implements Unifyable{ // // @Override // public Type identity() { // return this; // } // // @Override // public final Substitution unifyWith(Type type) { // if(this.equals(type)) return new Substitution(); // if(type instanceof TVariable) return unifyWith((TVariable) type); // if(type instanceof TFunction) return unifyWith((TFunction) type); // if(type instanceof TConstructor) return unifyWith((TConstructor) type); // throw new UnificationFailException(this, type); // } // // protected Substitution unifyWith(TVariable var) { // return bind(var, this); // } // // protected Substitution unifyWith(TFunction fun) { // throw new UnificationFailException(this, fun); // } // // protected Substitution unifyWith(TConstructor cons) { // throw new UnificationFailException(this, cons); // } // // public abstract Type instantiate(Substitution sub); // }
import ast.Expression; import exceptions.InfiniteTypeException; import exceptions.UnboundVariableException; import exceptions.UnificationFailException; import types.Type;
package app; /** * Created by valentin on 25/10/2016. */ public class InferenceApp { static void infer(Expression exp) { try { Type t = exp.infer(); System.out.println(exp + " :: " + t); }
// Path: src/main/java/ast/Expression.java // public abstract class Expression implements Inferable<TypeInferenceEnv, Type> { // // @Override // public final Type infer() { // TypeInferenceEnv typeInferenceEnv = new TypeInferenceEnv(); // Type t = infer(typeInferenceEnv); // // Substitution s = new Substitution(); // // for (Constraint constraint : typeInferenceEnv.constraints()) { // s = constraint.apply(s).unify().composeWith(s); // } // // return t.apply(s); // } // } // // Path: src/main/java/exceptions/InfiniteTypeException.java // public class InfiniteTypeException extends RuntimeException { // public InfiniteTypeException(Unifyable t1, Unifyable t2) { // super("This expression require an infinite type. (Trying to unify " + t1 + " and " +t2); // } // } // // Path: src/main/java/exceptions/UnboundVariableException.java // public class UnboundVariableException extends RuntimeException { // public UnboundVariableException(Variable var) { // super("The variable '" + var.getName() + "' is not bound."); // } // } // // Path: src/main/java/exceptions/UnificationFailException.java // public class UnificationFailException extends RuntimeException { // public UnificationFailException(Unifyable first, Unifyable second) { // super("The unification of inferred type for this expression has failed : " + first + " <=/=> " + second); // } // } // // Path: src/main/java/types/Type.java // public abstract class Type extends Substitutable<Type> implements Unifyable{ // // @Override // public Type identity() { // return this; // } // // @Override // public final Substitution unifyWith(Type type) { // if(this.equals(type)) return new Substitution(); // if(type instanceof TVariable) return unifyWith((TVariable) type); // if(type instanceof TFunction) return unifyWith((TFunction) type); // if(type instanceof TConstructor) return unifyWith((TConstructor) type); // throw new UnificationFailException(this, type); // } // // protected Substitution unifyWith(TVariable var) { // return bind(var, this); // } // // protected Substitution unifyWith(TFunction fun) { // throw new UnificationFailException(this, fun); // } // // protected Substitution unifyWith(TConstructor cons) { // throw new UnificationFailException(this, cons); // } // // public abstract Type instantiate(Substitution sub); // } // Path: src/main/java/app/InferenceApp.java import ast.Expression; import exceptions.InfiniteTypeException; import exceptions.UnboundVariableException; import exceptions.UnificationFailException; import types.Type; package app; /** * Created by valentin on 25/10/2016. */ public class InferenceApp { static void infer(Expression exp) { try { Type t = exp.infer(); System.out.println(exp + " :: " + t); }
catch (InfiniteTypeException | UnboundVariableException | UnificationFailException e) {
maeln/LambdaHindleyMilner
src/main/java/app/InferenceApp.java
// Path: src/main/java/ast/Expression.java // public abstract class Expression implements Inferable<TypeInferenceEnv, Type> { // // @Override // public final Type infer() { // TypeInferenceEnv typeInferenceEnv = new TypeInferenceEnv(); // Type t = infer(typeInferenceEnv); // // Substitution s = new Substitution(); // // for (Constraint constraint : typeInferenceEnv.constraints()) { // s = constraint.apply(s).unify().composeWith(s); // } // // return t.apply(s); // } // } // // Path: src/main/java/exceptions/InfiniteTypeException.java // public class InfiniteTypeException extends RuntimeException { // public InfiniteTypeException(Unifyable t1, Unifyable t2) { // super("This expression require an infinite type. (Trying to unify " + t1 + " and " +t2); // } // } // // Path: src/main/java/exceptions/UnboundVariableException.java // public class UnboundVariableException extends RuntimeException { // public UnboundVariableException(Variable var) { // super("The variable '" + var.getName() + "' is not bound."); // } // } // // Path: src/main/java/exceptions/UnificationFailException.java // public class UnificationFailException extends RuntimeException { // public UnificationFailException(Unifyable first, Unifyable second) { // super("The unification of inferred type for this expression has failed : " + first + " <=/=> " + second); // } // } // // Path: src/main/java/types/Type.java // public abstract class Type extends Substitutable<Type> implements Unifyable{ // // @Override // public Type identity() { // return this; // } // // @Override // public final Substitution unifyWith(Type type) { // if(this.equals(type)) return new Substitution(); // if(type instanceof TVariable) return unifyWith((TVariable) type); // if(type instanceof TFunction) return unifyWith((TFunction) type); // if(type instanceof TConstructor) return unifyWith((TConstructor) type); // throw new UnificationFailException(this, type); // } // // protected Substitution unifyWith(TVariable var) { // return bind(var, this); // } // // protected Substitution unifyWith(TFunction fun) { // throw new UnificationFailException(this, fun); // } // // protected Substitution unifyWith(TConstructor cons) { // throw new UnificationFailException(this, cons); // } // // public abstract Type instantiate(Substitution sub); // }
import ast.Expression; import exceptions.InfiniteTypeException; import exceptions.UnboundVariableException; import exceptions.UnificationFailException; import types.Type;
package app; /** * Created by valentin on 25/10/2016. */ public class InferenceApp { static void infer(Expression exp) { try { Type t = exp.infer(); System.out.println(exp + " :: " + t); }
// Path: src/main/java/ast/Expression.java // public abstract class Expression implements Inferable<TypeInferenceEnv, Type> { // // @Override // public final Type infer() { // TypeInferenceEnv typeInferenceEnv = new TypeInferenceEnv(); // Type t = infer(typeInferenceEnv); // // Substitution s = new Substitution(); // // for (Constraint constraint : typeInferenceEnv.constraints()) { // s = constraint.apply(s).unify().composeWith(s); // } // // return t.apply(s); // } // } // // Path: src/main/java/exceptions/InfiniteTypeException.java // public class InfiniteTypeException extends RuntimeException { // public InfiniteTypeException(Unifyable t1, Unifyable t2) { // super("This expression require an infinite type. (Trying to unify " + t1 + " and " +t2); // } // } // // Path: src/main/java/exceptions/UnboundVariableException.java // public class UnboundVariableException extends RuntimeException { // public UnboundVariableException(Variable var) { // super("The variable '" + var.getName() + "' is not bound."); // } // } // // Path: src/main/java/exceptions/UnificationFailException.java // public class UnificationFailException extends RuntimeException { // public UnificationFailException(Unifyable first, Unifyable second) { // super("The unification of inferred type for this expression has failed : " + first + " <=/=> " + second); // } // } // // Path: src/main/java/types/Type.java // public abstract class Type extends Substitutable<Type> implements Unifyable{ // // @Override // public Type identity() { // return this; // } // // @Override // public final Substitution unifyWith(Type type) { // if(this.equals(type)) return new Substitution(); // if(type instanceof TVariable) return unifyWith((TVariable) type); // if(type instanceof TFunction) return unifyWith((TFunction) type); // if(type instanceof TConstructor) return unifyWith((TConstructor) type); // throw new UnificationFailException(this, type); // } // // protected Substitution unifyWith(TVariable var) { // return bind(var, this); // } // // protected Substitution unifyWith(TFunction fun) { // throw new UnificationFailException(this, fun); // } // // protected Substitution unifyWith(TConstructor cons) { // throw new UnificationFailException(this, cons); // } // // public abstract Type instantiate(Substitution sub); // } // Path: src/main/java/app/InferenceApp.java import ast.Expression; import exceptions.InfiniteTypeException; import exceptions.UnboundVariableException; import exceptions.UnificationFailException; import types.Type; package app; /** * Created by valentin on 25/10/2016. */ public class InferenceApp { static void infer(Expression exp) { try { Type t = exp.infer(); System.out.println(exp + " :: " + t); }
catch (InfiniteTypeException | UnboundVariableException | UnificationFailException e) {
maeln/LambdaHindleyMilner
src/main/java/types/Scheme.java
// Path: src/main/java/inference/Substitution.java // public class Substitution extends Substitutable<Substitution> { // private HashMap<TVariable, Type> subs = new HashMap<>(); // // public Substitution() {} // // public Substitution(TVariable variable, Type type) { // subs.put(variable, type); // } // // private Substitution(Substitution previous) { // subs.putAll(previous.subs); // } // // public Substitution(List<TVariable> vars, List<Type> substitute) { // if(vars.size() != substitute.size()) // throw new IllegalArgumentException("Number of variables have to match number of types"); // // for (int i = 0; i < vars.size(); i++) subs.put(vars.get(i), substitute.get(i)); // } // // public List<TVariable> variables() { // return new LinkedList<>(subs.keySet()); // } // // public Type substituteOf(TVariable var) { // return subs.get(var); // } // // public Substitution composeWith(Substitution sub) { // Substitution substituted = new Substitution(sub); // substituted.apply(this); // subs.putAll(substituted.subs); // return this; // } // // @Override // public HashSet<TVariable> ftv() { // HashSet<TVariable> freeVars = new HashSet<>(); // for (TVariable var : variables()) freeVars.addAll(substituteOf(var).ftv()); // return freeVars; // } // // @Override // public Substitution substitute(TVariable var, Type t) { // for (TVariable variable : variables()) // subs.replace(variable, substituteOf(variable).substitute(var, t)); // return this; // } // // @Override // public String toString() { // return subs.toString(); // } // // @Override // public Substitution identity() { // return this; // } // } // // Path: src/main/java/inference/environements/TypeInferenceEnv.java // public class TypeInferenceEnv { // private TypeGenerator typeGenerator; // private TypeEnv typeEnv; // private List<Constraint> constraints; // // public TypeInferenceEnv() { // typeGenerator = new TypeGenerator(); // typeEnv = new TypeEnv(); // constraints = new LinkedList<>(); // } // // private TypeInferenceEnv(TypeInferenceEnv globalEnv) { // typeGenerator = globalEnv.typeGenerator; // typeEnv = new TypeEnv().mergeWith(globalEnv.typeEnv); // constraints = globalEnv.constraints(); // } // // public TypeInferenceEnv inEnv(Variable var, Scheme scheme) { // TypeInferenceEnv localEnv = new TypeInferenceEnv(this); // localEnv.bind(var, scheme); // return localEnv; // } // // public void bind(Variable var, Scheme scheme) { // typeEnv.extend(var, scheme); // } // // public void unify(Type t1, Type t2) { // constraints.add(new Constraint(t1, t2)); // } // // // public Type instantiate(Scheme scheme) { // // List<Type> freshVars = new LinkedList<>(); // // scheme.variables().forEach(var -> freshVars.add(freshName())); // // // // Type instatiation = scheme.type().duplicate(); // // instatiation.apply(new Substitution(scheme.variables(), freshVars)); // // // // return instatiation; // // } // // public Scheme generalize(Type t) { // HashSet<TVariable> freeVars = t.ftv(); // freeVars.removeAll(typeEnv.ftv()); // return forall(new ArrayList<>(freeVars), t); // } // // public Scheme lookup(Variable variable) { // return typeEnv.lookup(variable); // } // // public TVariable freshName() { // return typeGenerator.freshName(); // } // // public List<Constraint> constraints() { // return constraints; // } // } // // Path: src/main/java/inference/interfaces/Substitutable.java // public abstract class Substitutable<T extends Substitutable<T>> { // public T apply(Substitution s) { // T result = identity(); // for (TVariable var : s.variables()) { // result = result.substitute(var, s.substituteOf(var)); // } // return result; // } // abstract public HashSet<TVariable> ftv(); // // abstract public T substitute(TVariable var, Type t); // // abstract public T identity(); // }
import inference.Substitution; import inference.environements.TypeInferenceEnv; import inference.interfaces.Substitutable; import java.util.Collections; import java.util.HashSet; import java.util.LinkedList; import java.util.List;
package types; /** * Created by valentin on 18/10/2016. */ public class Scheme extends Substitutable<Scheme> { private final List<TVariable> variables; private Type type; private final static HashSet<Scheme> instantiated = new HashSet<>();
// Path: src/main/java/inference/Substitution.java // public class Substitution extends Substitutable<Substitution> { // private HashMap<TVariable, Type> subs = new HashMap<>(); // // public Substitution() {} // // public Substitution(TVariable variable, Type type) { // subs.put(variable, type); // } // // private Substitution(Substitution previous) { // subs.putAll(previous.subs); // } // // public Substitution(List<TVariable> vars, List<Type> substitute) { // if(vars.size() != substitute.size()) // throw new IllegalArgumentException("Number of variables have to match number of types"); // // for (int i = 0; i < vars.size(); i++) subs.put(vars.get(i), substitute.get(i)); // } // // public List<TVariable> variables() { // return new LinkedList<>(subs.keySet()); // } // // public Type substituteOf(TVariable var) { // return subs.get(var); // } // // public Substitution composeWith(Substitution sub) { // Substitution substituted = new Substitution(sub); // substituted.apply(this); // subs.putAll(substituted.subs); // return this; // } // // @Override // public HashSet<TVariable> ftv() { // HashSet<TVariable> freeVars = new HashSet<>(); // for (TVariable var : variables()) freeVars.addAll(substituteOf(var).ftv()); // return freeVars; // } // // @Override // public Substitution substitute(TVariable var, Type t) { // for (TVariable variable : variables()) // subs.replace(variable, substituteOf(variable).substitute(var, t)); // return this; // } // // @Override // public String toString() { // return subs.toString(); // } // // @Override // public Substitution identity() { // return this; // } // } // // Path: src/main/java/inference/environements/TypeInferenceEnv.java // public class TypeInferenceEnv { // private TypeGenerator typeGenerator; // private TypeEnv typeEnv; // private List<Constraint> constraints; // // public TypeInferenceEnv() { // typeGenerator = new TypeGenerator(); // typeEnv = new TypeEnv(); // constraints = new LinkedList<>(); // } // // private TypeInferenceEnv(TypeInferenceEnv globalEnv) { // typeGenerator = globalEnv.typeGenerator; // typeEnv = new TypeEnv().mergeWith(globalEnv.typeEnv); // constraints = globalEnv.constraints(); // } // // public TypeInferenceEnv inEnv(Variable var, Scheme scheme) { // TypeInferenceEnv localEnv = new TypeInferenceEnv(this); // localEnv.bind(var, scheme); // return localEnv; // } // // public void bind(Variable var, Scheme scheme) { // typeEnv.extend(var, scheme); // } // // public void unify(Type t1, Type t2) { // constraints.add(new Constraint(t1, t2)); // } // // // public Type instantiate(Scheme scheme) { // // List<Type> freshVars = new LinkedList<>(); // // scheme.variables().forEach(var -> freshVars.add(freshName())); // // // // Type instatiation = scheme.type().duplicate(); // // instatiation.apply(new Substitution(scheme.variables(), freshVars)); // // // // return instatiation; // // } // // public Scheme generalize(Type t) { // HashSet<TVariable> freeVars = t.ftv(); // freeVars.removeAll(typeEnv.ftv()); // return forall(new ArrayList<>(freeVars), t); // } // // public Scheme lookup(Variable variable) { // return typeEnv.lookup(variable); // } // // public TVariable freshName() { // return typeGenerator.freshName(); // } // // public List<Constraint> constraints() { // return constraints; // } // } // // Path: src/main/java/inference/interfaces/Substitutable.java // public abstract class Substitutable<T extends Substitutable<T>> { // public T apply(Substitution s) { // T result = identity(); // for (TVariable var : s.variables()) { // result = result.substitute(var, s.substituteOf(var)); // } // return result; // } // abstract public HashSet<TVariable> ftv(); // // abstract public T substitute(TVariable var, Type t); // // abstract public T identity(); // } // Path: src/main/java/types/Scheme.java import inference.Substitution; import inference.environements.TypeInferenceEnv; import inference.interfaces.Substitutable; import java.util.Collections; import java.util.HashSet; import java.util.LinkedList; import java.util.List; package types; /** * Created by valentin on 18/10/2016. */ public class Scheme extends Substitutable<Scheme> { private final List<TVariable> variables; private Type type; private final static HashSet<Scheme> instantiated = new HashSet<>();
private final HashSet<Substitution> applyedSubs = new HashSet<>();
maeln/LambdaHindleyMilner
src/main/java/types/Scheme.java
// Path: src/main/java/inference/Substitution.java // public class Substitution extends Substitutable<Substitution> { // private HashMap<TVariable, Type> subs = new HashMap<>(); // // public Substitution() {} // // public Substitution(TVariable variable, Type type) { // subs.put(variable, type); // } // // private Substitution(Substitution previous) { // subs.putAll(previous.subs); // } // // public Substitution(List<TVariable> vars, List<Type> substitute) { // if(vars.size() != substitute.size()) // throw new IllegalArgumentException("Number of variables have to match number of types"); // // for (int i = 0; i < vars.size(); i++) subs.put(vars.get(i), substitute.get(i)); // } // // public List<TVariable> variables() { // return new LinkedList<>(subs.keySet()); // } // // public Type substituteOf(TVariable var) { // return subs.get(var); // } // // public Substitution composeWith(Substitution sub) { // Substitution substituted = new Substitution(sub); // substituted.apply(this); // subs.putAll(substituted.subs); // return this; // } // // @Override // public HashSet<TVariable> ftv() { // HashSet<TVariable> freeVars = new HashSet<>(); // for (TVariable var : variables()) freeVars.addAll(substituteOf(var).ftv()); // return freeVars; // } // // @Override // public Substitution substitute(TVariable var, Type t) { // for (TVariable variable : variables()) // subs.replace(variable, substituteOf(variable).substitute(var, t)); // return this; // } // // @Override // public String toString() { // return subs.toString(); // } // // @Override // public Substitution identity() { // return this; // } // } // // Path: src/main/java/inference/environements/TypeInferenceEnv.java // public class TypeInferenceEnv { // private TypeGenerator typeGenerator; // private TypeEnv typeEnv; // private List<Constraint> constraints; // // public TypeInferenceEnv() { // typeGenerator = new TypeGenerator(); // typeEnv = new TypeEnv(); // constraints = new LinkedList<>(); // } // // private TypeInferenceEnv(TypeInferenceEnv globalEnv) { // typeGenerator = globalEnv.typeGenerator; // typeEnv = new TypeEnv().mergeWith(globalEnv.typeEnv); // constraints = globalEnv.constraints(); // } // // public TypeInferenceEnv inEnv(Variable var, Scheme scheme) { // TypeInferenceEnv localEnv = new TypeInferenceEnv(this); // localEnv.bind(var, scheme); // return localEnv; // } // // public void bind(Variable var, Scheme scheme) { // typeEnv.extend(var, scheme); // } // // public void unify(Type t1, Type t2) { // constraints.add(new Constraint(t1, t2)); // } // // // public Type instantiate(Scheme scheme) { // // List<Type> freshVars = new LinkedList<>(); // // scheme.variables().forEach(var -> freshVars.add(freshName())); // // // // Type instatiation = scheme.type().duplicate(); // // instatiation.apply(new Substitution(scheme.variables(), freshVars)); // // // // return instatiation; // // } // // public Scheme generalize(Type t) { // HashSet<TVariable> freeVars = t.ftv(); // freeVars.removeAll(typeEnv.ftv()); // return forall(new ArrayList<>(freeVars), t); // } // // public Scheme lookup(Variable variable) { // return typeEnv.lookup(variable); // } // // public TVariable freshName() { // return typeGenerator.freshName(); // } // // public List<Constraint> constraints() { // return constraints; // } // } // // Path: src/main/java/inference/interfaces/Substitutable.java // public abstract class Substitutable<T extends Substitutable<T>> { // public T apply(Substitution s) { // T result = identity(); // for (TVariable var : s.variables()) { // result = result.substitute(var, s.substituteOf(var)); // } // return result; // } // abstract public HashSet<TVariable> ftv(); // // abstract public T substitute(TVariable var, Type t); // // abstract public T identity(); // }
import inference.Substitution; import inference.environements.TypeInferenceEnv; import inference.interfaces.Substitutable; import java.util.Collections; import java.util.HashSet; import java.util.LinkedList; import java.util.List;
// Object override - Begin @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Scheme scheme = (Scheme) o; return variables.equals(scheme.variables) && type.equals(scheme.type); } @Override public int hashCode() { int result = variables.hashCode(); result = 31 * result + type.hashCode(); return result; } @Override public String toString() { String res = "∀"; if(!variables.isEmpty()){ res += variables.get(0).name(); for (int i = 1; i < variables.size(); i++) res += variables.get(i).name(); } return res + "." + type; }
// Path: src/main/java/inference/Substitution.java // public class Substitution extends Substitutable<Substitution> { // private HashMap<TVariable, Type> subs = new HashMap<>(); // // public Substitution() {} // // public Substitution(TVariable variable, Type type) { // subs.put(variable, type); // } // // private Substitution(Substitution previous) { // subs.putAll(previous.subs); // } // // public Substitution(List<TVariable> vars, List<Type> substitute) { // if(vars.size() != substitute.size()) // throw new IllegalArgumentException("Number of variables have to match number of types"); // // for (int i = 0; i < vars.size(); i++) subs.put(vars.get(i), substitute.get(i)); // } // // public List<TVariable> variables() { // return new LinkedList<>(subs.keySet()); // } // // public Type substituteOf(TVariable var) { // return subs.get(var); // } // // public Substitution composeWith(Substitution sub) { // Substitution substituted = new Substitution(sub); // substituted.apply(this); // subs.putAll(substituted.subs); // return this; // } // // @Override // public HashSet<TVariable> ftv() { // HashSet<TVariable> freeVars = new HashSet<>(); // for (TVariable var : variables()) freeVars.addAll(substituteOf(var).ftv()); // return freeVars; // } // // @Override // public Substitution substitute(TVariable var, Type t) { // for (TVariable variable : variables()) // subs.replace(variable, substituteOf(variable).substitute(var, t)); // return this; // } // // @Override // public String toString() { // return subs.toString(); // } // // @Override // public Substitution identity() { // return this; // } // } // // Path: src/main/java/inference/environements/TypeInferenceEnv.java // public class TypeInferenceEnv { // private TypeGenerator typeGenerator; // private TypeEnv typeEnv; // private List<Constraint> constraints; // // public TypeInferenceEnv() { // typeGenerator = new TypeGenerator(); // typeEnv = new TypeEnv(); // constraints = new LinkedList<>(); // } // // private TypeInferenceEnv(TypeInferenceEnv globalEnv) { // typeGenerator = globalEnv.typeGenerator; // typeEnv = new TypeEnv().mergeWith(globalEnv.typeEnv); // constraints = globalEnv.constraints(); // } // // public TypeInferenceEnv inEnv(Variable var, Scheme scheme) { // TypeInferenceEnv localEnv = new TypeInferenceEnv(this); // localEnv.bind(var, scheme); // return localEnv; // } // // public void bind(Variable var, Scheme scheme) { // typeEnv.extend(var, scheme); // } // // public void unify(Type t1, Type t2) { // constraints.add(new Constraint(t1, t2)); // } // // // public Type instantiate(Scheme scheme) { // // List<Type> freshVars = new LinkedList<>(); // // scheme.variables().forEach(var -> freshVars.add(freshName())); // // // // Type instatiation = scheme.type().duplicate(); // // instatiation.apply(new Substitution(scheme.variables(), freshVars)); // // // // return instatiation; // // } // // public Scheme generalize(Type t) { // HashSet<TVariable> freeVars = t.ftv(); // freeVars.removeAll(typeEnv.ftv()); // return forall(new ArrayList<>(freeVars), t); // } // // public Scheme lookup(Variable variable) { // return typeEnv.lookup(variable); // } // // public TVariable freshName() { // return typeGenerator.freshName(); // } // // public List<Constraint> constraints() { // return constraints; // } // } // // Path: src/main/java/inference/interfaces/Substitutable.java // public abstract class Substitutable<T extends Substitutable<T>> { // public T apply(Substitution s) { // T result = identity(); // for (TVariable var : s.variables()) { // result = result.substitute(var, s.substituteOf(var)); // } // return result; // } // abstract public HashSet<TVariable> ftv(); // // abstract public T substitute(TVariable var, Type t); // // abstract public T identity(); // } // Path: src/main/java/types/Scheme.java import inference.Substitution; import inference.environements.TypeInferenceEnv; import inference.interfaces.Substitutable; import java.util.Collections; import java.util.HashSet; import java.util.LinkedList; import java.util.List; // Object override - Begin @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Scheme scheme = (Scheme) o; return variables.equals(scheme.variables) && type.equals(scheme.type); } @Override public int hashCode() { int result = variables.hashCode(); result = 31 * result + type.hashCode(); return result; } @Override public String toString() { String res = "∀"; if(!variables.isEmpty()){ res += variables.get(0).name(); for (int i = 1; i < variables.size(); i++) res += variables.get(i).name(); } return res + "." + type; }
public Type instantiate(TypeInferenceEnv env) {
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/xhtml/XhtmlBuilder.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/ImageRefDTO.java // public final class ImageRefDTO { // // private String uri; // // public void setUri(String uri) { // this.uri = uri; // } // // public String getUri() { // return this.uri; // } // // public static ImageRefDTO newInstance() { // return new ImageRefDTO(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/TextDTO.java // public final class TextDTO { // // private String value; // // public void setValue(final String value) { // this.value = value; // } // // public String getText() { // return value; // } // // public static TextDTO newInstance() { // return new TextDTO(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/XhtmlUlDTO.java // public final class XhtmlUlDTO { // private final XhtmlUlType ul = XhtmlFactory.eINSTANCE.createXhtmlUlType(); // private String title; // // public void addEntry(final String entry) { // XhtmlLiType li = XhtmlFactory.eINSTANCE.createXhtmlLiType(); // li.getXhtmlFlowMix().add(FeatureMapUtil.createTextEntry(entry)); // getUl().getLi().add(li); // } // // public void add(XhtmlUlDTO dto) { // if (dto.getTitle() != null) { // XhtmlLiType li = XhtmlFactory.eINSTANCE.createXhtmlLiType(); // li.getXhtmlFlowMix().add( // FeatureMapUtil.createTextEntry(dto.getTitle())); // li.getUl().add(dto.getUl()); // getUl().getLi().add(li); // } // } // // private String getTitle() { // return title; // } // // public void setTitle(String title) { // this.title = title; // } // // public XhtmlUlType getUl() { // return ul; // } // // public static XhtmlUlDTO newInstance() { // return new XhtmlUlDTO(); // } // }
import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import org.eclipse.emf.ecore.util.FeatureMapUtil; import org.eclipse.rmf.reqif10.xhtml.XhtmlDivType; import org.eclipse.rmf.reqif10.xhtml.XhtmlFactory; import org.eclipse.rmf.reqif10.xhtml.XhtmlObjectType; import org.eclipse.rmf.reqif10.xhtml.XhtmlPType; import de.kay_muench.imageinformationprovider.ImageDataUriProvider; import de.kay_muench.imageinformationprovider.ImageInformation; import de.kay_muench.imageinformationprovider.ImageInformationProvider; import de.kay_muench.reqif10.reqifcompiler.dto.ImageRefDTO; import de.kay_muench.reqif10.reqifcompiler.dto.TextDTO; import de.kay_muench.reqif10.reqifcompiler.dto.XhtmlUlDTO;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.xhtml; public class XhtmlBuilder { private Collection<XhtmlDivType> collection = new ArrayList<XhtmlDivType>();
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/ImageRefDTO.java // public final class ImageRefDTO { // // private String uri; // // public void setUri(String uri) { // this.uri = uri; // } // // public String getUri() { // return this.uri; // } // // public static ImageRefDTO newInstance() { // return new ImageRefDTO(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/TextDTO.java // public final class TextDTO { // // private String value; // // public void setValue(final String value) { // this.value = value; // } // // public String getText() { // return value; // } // // public static TextDTO newInstance() { // return new TextDTO(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/XhtmlUlDTO.java // public final class XhtmlUlDTO { // private final XhtmlUlType ul = XhtmlFactory.eINSTANCE.createXhtmlUlType(); // private String title; // // public void addEntry(final String entry) { // XhtmlLiType li = XhtmlFactory.eINSTANCE.createXhtmlLiType(); // li.getXhtmlFlowMix().add(FeatureMapUtil.createTextEntry(entry)); // getUl().getLi().add(li); // } // // public void add(XhtmlUlDTO dto) { // if (dto.getTitle() != null) { // XhtmlLiType li = XhtmlFactory.eINSTANCE.createXhtmlLiType(); // li.getXhtmlFlowMix().add( // FeatureMapUtil.createTextEntry(dto.getTitle())); // li.getUl().add(dto.getUl()); // getUl().getLi().add(li); // } // } // // private String getTitle() { // return title; // } // // public void setTitle(String title) { // this.title = title; // } // // public XhtmlUlType getUl() { // return ul; // } // // public static XhtmlUlDTO newInstance() { // return new XhtmlUlDTO(); // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/xhtml/XhtmlBuilder.java import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import org.eclipse.emf.ecore.util.FeatureMapUtil; import org.eclipse.rmf.reqif10.xhtml.XhtmlDivType; import org.eclipse.rmf.reqif10.xhtml.XhtmlFactory; import org.eclipse.rmf.reqif10.xhtml.XhtmlObjectType; import org.eclipse.rmf.reqif10.xhtml.XhtmlPType; import de.kay_muench.imageinformationprovider.ImageDataUriProvider; import de.kay_muench.imageinformationprovider.ImageInformation; import de.kay_muench.imageinformationprovider.ImageInformationProvider; import de.kay_muench.reqif10.reqifcompiler.dto.ImageRefDTO; import de.kay_muench.reqif10.reqifcompiler.dto.TextDTO; import de.kay_muench.reqif10.reqifcompiler.dto.XhtmlUlDTO; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.xhtml; public class XhtmlBuilder { private Collection<XhtmlDivType> collection = new ArrayList<XhtmlDivType>();
public XhtmlBuilder append(ImageRefDTO ref) {
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/xhtml/XhtmlBuilder.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/ImageRefDTO.java // public final class ImageRefDTO { // // private String uri; // // public void setUri(String uri) { // this.uri = uri; // } // // public String getUri() { // return this.uri; // } // // public static ImageRefDTO newInstance() { // return new ImageRefDTO(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/TextDTO.java // public final class TextDTO { // // private String value; // // public void setValue(final String value) { // this.value = value; // } // // public String getText() { // return value; // } // // public static TextDTO newInstance() { // return new TextDTO(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/XhtmlUlDTO.java // public final class XhtmlUlDTO { // private final XhtmlUlType ul = XhtmlFactory.eINSTANCE.createXhtmlUlType(); // private String title; // // public void addEntry(final String entry) { // XhtmlLiType li = XhtmlFactory.eINSTANCE.createXhtmlLiType(); // li.getXhtmlFlowMix().add(FeatureMapUtil.createTextEntry(entry)); // getUl().getLi().add(li); // } // // public void add(XhtmlUlDTO dto) { // if (dto.getTitle() != null) { // XhtmlLiType li = XhtmlFactory.eINSTANCE.createXhtmlLiType(); // li.getXhtmlFlowMix().add( // FeatureMapUtil.createTextEntry(dto.getTitle())); // li.getUl().add(dto.getUl()); // getUl().getLi().add(li); // } // } // // private String getTitle() { // return title; // } // // public void setTitle(String title) { // this.title = title; // } // // public XhtmlUlType getUl() { // return ul; // } // // public static XhtmlUlDTO newInstance() { // return new XhtmlUlDTO(); // } // }
import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import org.eclipse.emf.ecore.util.FeatureMapUtil; import org.eclipse.rmf.reqif10.xhtml.XhtmlDivType; import org.eclipse.rmf.reqif10.xhtml.XhtmlFactory; import org.eclipse.rmf.reqif10.xhtml.XhtmlObjectType; import org.eclipse.rmf.reqif10.xhtml.XhtmlPType; import de.kay_muench.imageinformationprovider.ImageDataUriProvider; import de.kay_muench.imageinformationprovider.ImageInformation; import de.kay_muench.imageinformationprovider.ImageInformationProvider; import de.kay_muench.reqif10.reqifcompiler.dto.ImageRefDTO; import de.kay_muench.reqif10.reqifcompiler.dto.TextDTO; import de.kay_muench.reqif10.reqifcompiler.dto.XhtmlUlDTO;
try { ImageInformation info = provider.provideFor(ref.getUri()); ImageDataUriProvider dataUriProvider = new ImageDataUriProvider(); XhtmlObjectType o = XhtmlFactory.eINSTANCE.createXhtmlObjectType(); o.setClass("figure"); o.setData(dataUriProvider.provideFor(info)); o.setType(info.getMimeType()); o.setWidth(Integer.valueOf(info.getWidth()).toString()); o.setHeight(Integer.valueOf(info.getHeight()).toString()); o.getBr().add(XhtmlFactory.eINSTANCE.createXhtmlBrType()); d.getObject().add(o); } catch (RuntimeException e) { XhtmlPType p = XhtmlFactory.eINSTANCE.createXhtmlPType(); p.getXhtmlInlineMix().add( FeatureMapUtil.createTextEntry(e.getMessage())); d.getP().add(p); } catch (IOException e) { XhtmlPType p = XhtmlFactory.eINSTANCE.createXhtmlPType(); p.getXhtmlInlineMix().add( FeatureMapUtil.createTextEntry(e.getMessage())); d.getP().add(p); } this.collection.add(d); return this; }
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/ImageRefDTO.java // public final class ImageRefDTO { // // private String uri; // // public void setUri(String uri) { // this.uri = uri; // } // // public String getUri() { // return this.uri; // } // // public static ImageRefDTO newInstance() { // return new ImageRefDTO(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/TextDTO.java // public final class TextDTO { // // private String value; // // public void setValue(final String value) { // this.value = value; // } // // public String getText() { // return value; // } // // public static TextDTO newInstance() { // return new TextDTO(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/XhtmlUlDTO.java // public final class XhtmlUlDTO { // private final XhtmlUlType ul = XhtmlFactory.eINSTANCE.createXhtmlUlType(); // private String title; // // public void addEntry(final String entry) { // XhtmlLiType li = XhtmlFactory.eINSTANCE.createXhtmlLiType(); // li.getXhtmlFlowMix().add(FeatureMapUtil.createTextEntry(entry)); // getUl().getLi().add(li); // } // // public void add(XhtmlUlDTO dto) { // if (dto.getTitle() != null) { // XhtmlLiType li = XhtmlFactory.eINSTANCE.createXhtmlLiType(); // li.getXhtmlFlowMix().add( // FeatureMapUtil.createTextEntry(dto.getTitle())); // li.getUl().add(dto.getUl()); // getUl().getLi().add(li); // } // } // // private String getTitle() { // return title; // } // // public void setTitle(String title) { // this.title = title; // } // // public XhtmlUlType getUl() { // return ul; // } // // public static XhtmlUlDTO newInstance() { // return new XhtmlUlDTO(); // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/xhtml/XhtmlBuilder.java import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import org.eclipse.emf.ecore.util.FeatureMapUtil; import org.eclipse.rmf.reqif10.xhtml.XhtmlDivType; import org.eclipse.rmf.reqif10.xhtml.XhtmlFactory; import org.eclipse.rmf.reqif10.xhtml.XhtmlObjectType; import org.eclipse.rmf.reqif10.xhtml.XhtmlPType; import de.kay_muench.imageinformationprovider.ImageDataUriProvider; import de.kay_muench.imageinformationprovider.ImageInformation; import de.kay_muench.imageinformationprovider.ImageInformationProvider; import de.kay_muench.reqif10.reqifcompiler.dto.ImageRefDTO; import de.kay_muench.reqif10.reqifcompiler.dto.TextDTO; import de.kay_muench.reqif10.reqifcompiler.dto.XhtmlUlDTO; try { ImageInformation info = provider.provideFor(ref.getUri()); ImageDataUriProvider dataUriProvider = new ImageDataUriProvider(); XhtmlObjectType o = XhtmlFactory.eINSTANCE.createXhtmlObjectType(); o.setClass("figure"); o.setData(dataUriProvider.provideFor(info)); o.setType(info.getMimeType()); o.setWidth(Integer.valueOf(info.getWidth()).toString()); o.setHeight(Integer.valueOf(info.getHeight()).toString()); o.getBr().add(XhtmlFactory.eINSTANCE.createXhtmlBrType()); d.getObject().add(o); } catch (RuntimeException e) { XhtmlPType p = XhtmlFactory.eINSTANCE.createXhtmlPType(); p.getXhtmlInlineMix().add( FeatureMapUtil.createTextEntry(e.getMessage())); d.getP().add(p); } catch (IOException e) { XhtmlPType p = XhtmlFactory.eINSTANCE.createXhtmlPType(); p.getXhtmlInlineMix().add( FeatureMapUtil.createTextEntry(e.getMessage())); d.getP().add(p); } this.collection.add(d); return this; }
public XhtmlBuilder append(final TextDTO txt) {
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/xhtml/XhtmlBuilder.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/ImageRefDTO.java // public final class ImageRefDTO { // // private String uri; // // public void setUri(String uri) { // this.uri = uri; // } // // public String getUri() { // return this.uri; // } // // public static ImageRefDTO newInstance() { // return new ImageRefDTO(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/TextDTO.java // public final class TextDTO { // // private String value; // // public void setValue(final String value) { // this.value = value; // } // // public String getText() { // return value; // } // // public static TextDTO newInstance() { // return new TextDTO(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/XhtmlUlDTO.java // public final class XhtmlUlDTO { // private final XhtmlUlType ul = XhtmlFactory.eINSTANCE.createXhtmlUlType(); // private String title; // // public void addEntry(final String entry) { // XhtmlLiType li = XhtmlFactory.eINSTANCE.createXhtmlLiType(); // li.getXhtmlFlowMix().add(FeatureMapUtil.createTextEntry(entry)); // getUl().getLi().add(li); // } // // public void add(XhtmlUlDTO dto) { // if (dto.getTitle() != null) { // XhtmlLiType li = XhtmlFactory.eINSTANCE.createXhtmlLiType(); // li.getXhtmlFlowMix().add( // FeatureMapUtil.createTextEntry(dto.getTitle())); // li.getUl().add(dto.getUl()); // getUl().getLi().add(li); // } // } // // private String getTitle() { // return title; // } // // public void setTitle(String title) { // this.title = title; // } // // public XhtmlUlType getUl() { // return ul; // } // // public static XhtmlUlDTO newInstance() { // return new XhtmlUlDTO(); // } // }
import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import org.eclipse.emf.ecore.util.FeatureMapUtil; import org.eclipse.rmf.reqif10.xhtml.XhtmlDivType; import org.eclipse.rmf.reqif10.xhtml.XhtmlFactory; import org.eclipse.rmf.reqif10.xhtml.XhtmlObjectType; import org.eclipse.rmf.reqif10.xhtml.XhtmlPType; import de.kay_muench.imageinformationprovider.ImageDataUriProvider; import de.kay_muench.imageinformationprovider.ImageInformation; import de.kay_muench.imageinformationprovider.ImageInformationProvider; import de.kay_muench.reqif10.reqifcompiler.dto.ImageRefDTO; import de.kay_muench.reqif10.reqifcompiler.dto.TextDTO; import de.kay_muench.reqif10.reqifcompiler.dto.XhtmlUlDTO;
} catch (RuntimeException e) { XhtmlPType p = XhtmlFactory.eINSTANCE.createXhtmlPType(); p.getXhtmlInlineMix().add( FeatureMapUtil.createTextEntry(e.getMessage())); d.getP().add(p); } catch (IOException e) { XhtmlPType p = XhtmlFactory.eINSTANCE.createXhtmlPType(); p.getXhtmlInlineMix().add( FeatureMapUtil.createTextEntry(e.getMessage())); d.getP().add(p); } this.collection.add(d); return this; } public XhtmlBuilder append(final TextDTO txt) { XhtmlDivType d = XhtmlFactory.eINSTANCE.createXhtmlDivType(); XhtmlPType p = XhtmlFactory.eINSTANCE.createXhtmlPType(); final String[] lines = txt.getText().split("\n"); for (int i = 0; i < lines.length; i++) { p.getXhtmlInlineMix().add(FeatureMapUtil.createTextEntry(lines[i])); if (i < lines.length - 1) p.getBr().add(XhtmlFactory.eINSTANCE.createXhtmlBrType()); } d.getP().add(p); this.collection.add(d); return this; }
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/ImageRefDTO.java // public final class ImageRefDTO { // // private String uri; // // public void setUri(String uri) { // this.uri = uri; // } // // public String getUri() { // return this.uri; // } // // public static ImageRefDTO newInstance() { // return new ImageRefDTO(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/TextDTO.java // public final class TextDTO { // // private String value; // // public void setValue(final String value) { // this.value = value; // } // // public String getText() { // return value; // } // // public static TextDTO newInstance() { // return new TextDTO(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/XhtmlUlDTO.java // public final class XhtmlUlDTO { // private final XhtmlUlType ul = XhtmlFactory.eINSTANCE.createXhtmlUlType(); // private String title; // // public void addEntry(final String entry) { // XhtmlLiType li = XhtmlFactory.eINSTANCE.createXhtmlLiType(); // li.getXhtmlFlowMix().add(FeatureMapUtil.createTextEntry(entry)); // getUl().getLi().add(li); // } // // public void add(XhtmlUlDTO dto) { // if (dto.getTitle() != null) { // XhtmlLiType li = XhtmlFactory.eINSTANCE.createXhtmlLiType(); // li.getXhtmlFlowMix().add( // FeatureMapUtil.createTextEntry(dto.getTitle())); // li.getUl().add(dto.getUl()); // getUl().getLi().add(li); // } // } // // private String getTitle() { // return title; // } // // public void setTitle(String title) { // this.title = title; // } // // public XhtmlUlType getUl() { // return ul; // } // // public static XhtmlUlDTO newInstance() { // return new XhtmlUlDTO(); // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/xhtml/XhtmlBuilder.java import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import org.eclipse.emf.ecore.util.FeatureMapUtil; import org.eclipse.rmf.reqif10.xhtml.XhtmlDivType; import org.eclipse.rmf.reqif10.xhtml.XhtmlFactory; import org.eclipse.rmf.reqif10.xhtml.XhtmlObjectType; import org.eclipse.rmf.reqif10.xhtml.XhtmlPType; import de.kay_muench.imageinformationprovider.ImageDataUriProvider; import de.kay_muench.imageinformationprovider.ImageInformation; import de.kay_muench.imageinformationprovider.ImageInformationProvider; import de.kay_muench.reqif10.reqifcompiler.dto.ImageRefDTO; import de.kay_muench.reqif10.reqifcompiler.dto.TextDTO; import de.kay_muench.reqif10.reqifcompiler.dto.XhtmlUlDTO; } catch (RuntimeException e) { XhtmlPType p = XhtmlFactory.eINSTANCE.createXhtmlPType(); p.getXhtmlInlineMix().add( FeatureMapUtil.createTextEntry(e.getMessage())); d.getP().add(p); } catch (IOException e) { XhtmlPType p = XhtmlFactory.eINSTANCE.createXhtmlPType(); p.getXhtmlInlineMix().add( FeatureMapUtil.createTextEntry(e.getMessage())); d.getP().add(p); } this.collection.add(d); return this; } public XhtmlBuilder append(final TextDTO txt) { XhtmlDivType d = XhtmlFactory.eINSTANCE.createXhtmlDivType(); XhtmlPType p = XhtmlFactory.eINSTANCE.createXhtmlPType(); final String[] lines = txt.getText().split("\n"); for (int i = 0; i < lines.length; i++) { p.getXhtmlInlineMix().add(FeatureMapUtil.createTextEntry(lines[i])); if (i < lines.length - 1) p.getBr().add(XhtmlFactory.eINSTANCE.createXhtmlBrType()); } d.getP().add(p); this.collection.add(d); return this; }
public XhtmlBuilder append(final XhtmlUlDTO dto) {
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/SpecTypesRegistry.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/SimpleTypesRegistry.java // public class SimpleTypesRegistry { // public SimpleTypesRegistry() throws Exception { // } // // private String32k reqifString = new String32k(); // private DateType reqifDate = new DateType(); // private XhtmlType reqifXhtml = new XhtmlType(); // private Headline reqifHeadline = new Headline(); // private RequirementStatus reqifRequirementStatus = new RequirementStatus(); // private RequirementRanking reqifRequirementRanking = new RequirementRanking(); // // public String32k getReqIFString32kType() { // return this.reqifString; // } // // public DateType getReqIFDateType() { // return this.reqifDate; // } // // public XhtmlType getReqIFXhtmlType() { // return this.reqifXhtml; // } // // public Headline getReqIFHeadlineType() { // return this.reqifHeadline; // } // // public RequirementStatus getReqIFRequirementStatusType() { // return reqifRequirementStatus; // } // // public RequirementRanking getReqIFRequirementRankingType() { // return this.reqifRequirementRanking; // } // // public List<DatatypeDefinition> getDatatypes() { // List<DatatypeDefinition> definitions = new LinkedList<DatatypeDefinition>(); // definitions.add(this.reqifString.getDef()); // definitions.add(this.reqifDate.getDef()); // definitions.add(this.reqifXhtml.getDef()); // definitions.add(this.reqifHeadline.getDef()); // definitions.add(this.reqifRequirementStatus.getDef()); // definitions.add(this.reqifRequirementRanking.getDef()); // return definitions; // } // }
import java.util.LinkedList; import java.util.List; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecType; import org.eclipse.rmf.reqif10.SpecificationType; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.SimpleTypesRegistry;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class SpecTypesRegistry { private HeadlineType headlineType; private SpecificationType specificationType; private AttributesRegistry attributesRegistry; private BaselineSpecObjectType specObjectTypeWithDate; private ConfigurationSpecObjectType specObjectTypeWithoutDate; private SpecRelationTypeWithRelationKind specRelationType; public AttributesRegistry getAttributesRegistry() { return attributesRegistry; }
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/SimpleTypesRegistry.java // public class SimpleTypesRegistry { // public SimpleTypesRegistry() throws Exception { // } // // private String32k reqifString = new String32k(); // private DateType reqifDate = new DateType(); // private XhtmlType reqifXhtml = new XhtmlType(); // private Headline reqifHeadline = new Headline(); // private RequirementStatus reqifRequirementStatus = new RequirementStatus(); // private RequirementRanking reqifRequirementRanking = new RequirementRanking(); // // public String32k getReqIFString32kType() { // return this.reqifString; // } // // public DateType getReqIFDateType() { // return this.reqifDate; // } // // public XhtmlType getReqIFXhtmlType() { // return this.reqifXhtml; // } // // public Headline getReqIFHeadlineType() { // return this.reqifHeadline; // } // // public RequirementStatus getReqIFRequirementStatusType() { // return reqifRequirementStatus; // } // // public RequirementRanking getReqIFRequirementRankingType() { // return this.reqifRequirementRanking; // } // // public List<DatatypeDefinition> getDatatypes() { // List<DatatypeDefinition> definitions = new LinkedList<DatatypeDefinition>(); // definitions.add(this.reqifString.getDef()); // definitions.add(this.reqifDate.getDef()); // definitions.add(this.reqifXhtml.getDef()); // definitions.add(this.reqifHeadline.getDef()); // definitions.add(this.reqifRequirementStatus.getDef()); // definitions.add(this.reqifRequirementRanking.getDef()); // return definitions; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/SpecTypesRegistry.java import java.util.LinkedList; import java.util.List; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecType; import org.eclipse.rmf.reqif10.SpecificationType; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.SimpleTypesRegistry; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class SpecTypesRegistry { private HeadlineType headlineType; private SpecificationType specificationType; private AttributesRegistry attributesRegistry; private BaselineSpecObjectType specObjectTypeWithDate; private ConfigurationSpecObjectType specObjectTypeWithoutDate; private SpecRelationTypeWithRelationKind specRelationType; public AttributesRegistry getAttributesRegistry() { return attributesRegistry; }
public SpecTypesRegistry(SimpleTypesRegistry registry) throws Exception {
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/SpecTypesRegistry.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/SimpleTypesRegistry.java // public class SimpleTypesRegistry { // public SimpleTypesRegistry() throws Exception { // } // // private String32k reqifString = new String32k(); // private DateType reqifDate = new DateType(); // private XhtmlType reqifXhtml = new XhtmlType(); // private Headline reqifHeadline = new Headline(); // private RequirementStatus reqifRequirementStatus = new RequirementStatus(); // private RequirementRanking reqifRequirementRanking = new RequirementRanking(); // // public String32k getReqIFString32kType() { // return this.reqifString; // } // // public DateType getReqIFDateType() { // return this.reqifDate; // } // // public XhtmlType getReqIFXhtmlType() { // return this.reqifXhtml; // } // // public Headline getReqIFHeadlineType() { // return this.reqifHeadline; // } // // public RequirementStatus getReqIFRequirementStatusType() { // return reqifRequirementStatus; // } // // public RequirementRanking getReqIFRequirementRankingType() { // return this.reqifRequirementRanking; // } // // public List<DatatypeDefinition> getDatatypes() { // List<DatatypeDefinition> definitions = new LinkedList<DatatypeDefinition>(); // definitions.add(this.reqifString.getDef()); // definitions.add(this.reqifDate.getDef()); // definitions.add(this.reqifXhtml.getDef()); // definitions.add(this.reqifHeadline.getDef()); // definitions.add(this.reqifRequirementStatus.getDef()); // definitions.add(this.reqifRequirementRanking.getDef()); // return definitions; // } // }
import java.util.LinkedList; import java.util.List; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecType; import org.eclipse.rmf.reqif10.SpecificationType; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.SimpleTypesRegistry;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class SpecTypesRegistry { private HeadlineType headlineType; private SpecificationType specificationType; private AttributesRegistry attributesRegistry; private BaselineSpecObjectType specObjectTypeWithDate; private ConfigurationSpecObjectType specObjectTypeWithoutDate; private SpecRelationTypeWithRelationKind specRelationType; public AttributesRegistry getAttributesRegistry() { return attributesRegistry; } public SpecTypesRegistry(SimpleTypesRegistry registry) throws Exception { attributesRegistry = new AttributesRegistry(registry); headlineType = new HeadlineType(registry.getReqIFHeadlineType()); specificationType = ReqIF10Factory.eINSTANCE.createSpecificationType();
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/SimpleTypesRegistry.java // public class SimpleTypesRegistry { // public SimpleTypesRegistry() throws Exception { // } // // private String32k reqifString = new String32k(); // private DateType reqifDate = new DateType(); // private XhtmlType reqifXhtml = new XhtmlType(); // private Headline reqifHeadline = new Headline(); // private RequirementStatus reqifRequirementStatus = new RequirementStatus(); // private RequirementRanking reqifRequirementRanking = new RequirementRanking(); // // public String32k getReqIFString32kType() { // return this.reqifString; // } // // public DateType getReqIFDateType() { // return this.reqifDate; // } // // public XhtmlType getReqIFXhtmlType() { // return this.reqifXhtml; // } // // public Headline getReqIFHeadlineType() { // return this.reqifHeadline; // } // // public RequirementStatus getReqIFRequirementStatusType() { // return reqifRequirementStatus; // } // // public RequirementRanking getReqIFRequirementRankingType() { // return this.reqifRequirementRanking; // } // // public List<DatatypeDefinition> getDatatypes() { // List<DatatypeDefinition> definitions = new LinkedList<DatatypeDefinition>(); // definitions.add(this.reqifString.getDef()); // definitions.add(this.reqifDate.getDef()); // definitions.add(this.reqifXhtml.getDef()); // definitions.add(this.reqifHeadline.getDef()); // definitions.add(this.reqifRequirementStatus.getDef()); // definitions.add(this.reqifRequirementRanking.getDef()); // return definitions; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/SpecTypesRegistry.java import java.util.LinkedList; import java.util.List; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecType; import org.eclipse.rmf.reqif10.SpecificationType; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.SimpleTypesRegistry; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class SpecTypesRegistry { private HeadlineType headlineType; private SpecificationType specificationType; private AttributesRegistry attributesRegistry; private BaselineSpecObjectType specObjectTypeWithDate; private ConfigurationSpecObjectType specObjectTypeWithoutDate; private SpecRelationTypeWithRelationKind specRelationType; public AttributesRegistry getAttributesRegistry() { return attributesRegistry; } public SpecTypesRegistry(SimpleTypesRegistry registry) throws Exception { attributesRegistry = new AttributesRegistry(registry); headlineType = new HeadlineType(registry.getReqIFHeadlineType()); specificationType = ReqIF10Factory.eINSTANCE.createSpecificationType();
specificationType.setIdentifier(IdentifierManager.generateIdentifier());
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/CommonSpecObjectTypeDefinitions.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; final class CommonSpecObjectTypeDefinitions { final static String PRIORITY = "Priority"; final static String RISK = "Risk"; private SpecObjectType objectType; private IdentifierAttribute idAttribute; private DescriptionAttribute descAttribute; private ScheduledByAttribute scheduledByAttribute; private RequirementStatusAttribute statusAttribute; private RequirementRankingAttribute priorityAttribute; private RequirementRankingAttribute riskAttribute;
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/CommonSpecObjectTypeDefinitions.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; final class CommonSpecObjectTypeDefinitions { final static String PRIORITY = "Priority"; final static String RISK = "Risk"; private SpecObjectType objectType; private IdentifierAttribute idAttribute; private DescriptionAttribute descAttribute; private ScheduledByAttribute scheduledByAttribute; private RequirementStatusAttribute statusAttribute; private RequirementRankingAttribute priorityAttribute; private RequirementRankingAttribute riskAttribute;
public CommonSpecObjectTypeDefinitions(String32k typeId,
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/CommonSpecObjectTypeDefinitions.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; final class CommonSpecObjectTypeDefinitions { final static String PRIORITY = "Priority"; final static String RISK = "Risk"; private SpecObjectType objectType; private IdentifierAttribute idAttribute; private DescriptionAttribute descAttribute; private ScheduledByAttribute scheduledByAttribute; private RequirementStatusAttribute statusAttribute; private RequirementRankingAttribute priorityAttribute; private RequirementRankingAttribute riskAttribute; public CommonSpecObjectTypeDefinitions(String32k typeId,
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/CommonSpecObjectTypeDefinitions.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; final class CommonSpecObjectTypeDefinitions { final static String PRIORITY = "Priority"; final static String RISK = "Risk"; private SpecObjectType objectType; private IdentifierAttribute idAttribute; private DescriptionAttribute descAttribute; private ScheduledByAttribute scheduledByAttribute; private RequirementStatusAttribute statusAttribute; private RequirementRankingAttribute priorityAttribute; private RequirementRankingAttribute riskAttribute; public CommonSpecObjectTypeDefinitions(String32k typeId,
XhtmlType reqifXhtml, DateType typeDate,
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/CommonSpecObjectTypeDefinitions.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; final class CommonSpecObjectTypeDefinitions { final static String PRIORITY = "Priority"; final static String RISK = "Risk"; private SpecObjectType objectType; private IdentifierAttribute idAttribute; private DescriptionAttribute descAttribute; private ScheduledByAttribute scheduledByAttribute; private RequirementStatusAttribute statusAttribute; private RequirementRankingAttribute priorityAttribute; private RequirementRankingAttribute riskAttribute; public CommonSpecObjectTypeDefinitions(String32k typeId,
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/CommonSpecObjectTypeDefinitions.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; final class CommonSpecObjectTypeDefinitions { final static String PRIORITY = "Priority"; final static String RISK = "Risk"; private SpecObjectType objectType; private IdentifierAttribute idAttribute; private DescriptionAttribute descAttribute; private ScheduledByAttribute scheduledByAttribute; private RequirementStatusAttribute statusAttribute; private RequirementRankingAttribute priorityAttribute; private RequirementRankingAttribute riskAttribute; public CommonSpecObjectTypeDefinitions(String32k typeId,
XhtmlType reqifXhtml, DateType typeDate,
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/CommonSpecObjectTypeDefinitions.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; final class CommonSpecObjectTypeDefinitions { final static String PRIORITY = "Priority"; final static String RISK = "Risk"; private SpecObjectType objectType; private IdentifierAttribute idAttribute; private DescriptionAttribute descAttribute; private ScheduledByAttribute scheduledByAttribute; private RequirementStatusAttribute statusAttribute; private RequirementRankingAttribute priorityAttribute; private RequirementRankingAttribute riskAttribute; public CommonSpecObjectTypeDefinitions(String32k typeId, XhtmlType reqifXhtml, DateType typeDate,
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/CommonSpecObjectTypeDefinitions.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; final class CommonSpecObjectTypeDefinitions { final static String PRIORITY = "Priority"; final static String RISK = "Risk"; private SpecObjectType objectType; private IdentifierAttribute idAttribute; private DescriptionAttribute descAttribute; private ScheduledByAttribute scheduledByAttribute; private RequirementStatusAttribute statusAttribute; private RequirementRankingAttribute priorityAttribute; private RequirementRankingAttribute riskAttribute; public CommonSpecObjectTypeDefinitions(String32k typeId, XhtmlType reqifXhtml, DateType typeDate,
RequirementStatus typeStatus,
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/CommonSpecObjectTypeDefinitions.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; final class CommonSpecObjectTypeDefinitions { final static String PRIORITY = "Priority"; final static String RISK = "Risk"; private SpecObjectType objectType; private IdentifierAttribute idAttribute; private DescriptionAttribute descAttribute; private ScheduledByAttribute scheduledByAttribute; private RequirementStatusAttribute statusAttribute; private RequirementRankingAttribute priorityAttribute; private RequirementRankingAttribute riskAttribute; public CommonSpecObjectTypeDefinitions(String32k typeId, XhtmlType reqifXhtml, DateType typeDate, RequirementStatus typeStatus,
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/CommonSpecObjectTypeDefinitions.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; final class CommonSpecObjectTypeDefinitions { final static String PRIORITY = "Priority"; final static String RISK = "Risk"; private SpecObjectType objectType; private IdentifierAttribute idAttribute; private DescriptionAttribute descAttribute; private ScheduledByAttribute scheduledByAttribute; private RequirementStatusAttribute statusAttribute; private RequirementRankingAttribute priorityAttribute; private RequirementRankingAttribute riskAttribute; public CommonSpecObjectTypeDefinitions(String32k typeId, XhtmlType reqifXhtml, DateType typeDate, RequirementStatus typeStatus,
RequirementRanking typeRanking)
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/IdentifierAttribute.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/Headline.java // public class Headline { // private DatatypeDefinitionString def; // // Headline() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Headline"); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionString; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.Headline; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class IdentifierAttribute { public static String NAME = "ID"; private AttributeDefinitionString def;
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/Headline.java // public class Headline { // private DatatypeDefinitionString def; // // Headline() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Headline"); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/IdentifierAttribute.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionString; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.Headline; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class IdentifierAttribute { public static String NAME = "ID"; private AttributeDefinitionString def;
IdentifierAttribute(String32k type) throws DatatypeConfigurationException {
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/IdentifierAttribute.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/Headline.java // public class Headline { // private DatatypeDefinitionString def; // // Headline() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Headline"); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionString; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.Headline; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class IdentifierAttribute { public static String NAME = "ID"; private AttributeDefinitionString def; IdentifierAttribute(String32k type) throws DatatypeConfigurationException { def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionString();
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/Headline.java // public class Headline { // private DatatypeDefinitionString def; // // Headline() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Headline"); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/IdentifierAttribute.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionString; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.Headline; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class IdentifierAttribute { public static String NAME = "ID"; private AttributeDefinitionString def; IdentifierAttribute(String32k type) throws DatatypeConfigurationException { def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionString();
def.setIdentifier(IdentifierManager.generateIdentifier());
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/IdentifierAttribute.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/Headline.java // public class Headline { // private DatatypeDefinitionString def; // // Headline() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Headline"); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionString; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.Headline; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class IdentifierAttribute { public static String NAME = "ID"; private AttributeDefinitionString def; IdentifierAttribute(String32k type) throws DatatypeConfigurationException { def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionString(); def.setIdentifier(IdentifierManager.generateIdentifier()); def.setLongName(IdentifierAttribute.NAME); def.setType(type.getDef());
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/Headline.java // public class Headline { // private DatatypeDefinitionString def; // // Headline() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Headline"); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/IdentifierAttribute.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionString; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.Headline; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class IdentifierAttribute { public static String NAME = "ID"; private AttributeDefinitionString def; IdentifierAttribute(String32k type) throws DatatypeConfigurationException { def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionString(); def.setIdentifier(IdentifierManager.generateIdentifier()); def.setLongName(IdentifierAttribute.NAME); def.setType(type.getDef());
def.setLastChange(DateManager.getCurrentDate());
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/IdentifierAttribute.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/Headline.java // public class Headline { // private DatatypeDefinitionString def; // // Headline() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Headline"); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionString; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.Headline; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class IdentifierAttribute { public static String NAME = "ID"; private AttributeDefinitionString def; IdentifierAttribute(String32k type) throws DatatypeConfigurationException { def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionString(); def.setIdentifier(IdentifierManager.generateIdentifier()); def.setLongName(IdentifierAttribute.NAME); def.setType(type.getDef()); def.setLastChange(DateManager.getCurrentDate()); }
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/Headline.java // public class Headline { // private DatatypeDefinitionString def; // // Headline() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Headline"); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/IdentifierAttribute.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionString; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.Headline; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class IdentifierAttribute { public static String NAME = "ID"; private AttributeDefinitionString def; IdentifierAttribute(String32k type) throws DatatypeConfigurationException { def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionString(); def.setIdentifier(IdentifierManager.generateIdentifier()); def.setLongName(IdentifierAttribute.NAME); def.setType(type.getDef()); def.setLastChange(DateManager.getCurrentDate()); }
IdentifierAttribute(Headline type) throws DatatypeConfigurationException {
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/Headline.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // }
import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import org.eclipse.rmf.reqif10.DatatypeDefinitionString; import org.eclipse.rmf.reqif10.ReqIF10Factory;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.simple; public class Headline { private DatatypeDefinitionString def; Headline() { def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString();
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/Headline.java import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import org.eclipse.rmf.reqif10.DatatypeDefinitionString; import org.eclipse.rmf.reqif10.ReqIF10Factory; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.simple; public class Headline { private DatatypeDefinitionString def; Headline() { def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString();
def.setIdentifier(IdentifierManager.generateIdentifier());
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/ScheduledByAttribute.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionDate; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class ScheduledByAttribute { private static final String SCHEDULEDBY = "Scheduled by"; private AttributeDefinitionDate def;
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/ScheduledByAttribute.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionDate; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class ScheduledByAttribute { private static final String SCHEDULEDBY = "Scheduled by"; private AttributeDefinitionDate def;
ScheduledByAttribute(DateType type)
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/ScheduledByAttribute.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionDate; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class ScheduledByAttribute { private static final String SCHEDULEDBY = "Scheduled by"; private AttributeDefinitionDate def; ScheduledByAttribute(DateType type) throws DatatypeConfigurationException { def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionDate();
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/ScheduledByAttribute.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionDate; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class ScheduledByAttribute { private static final String SCHEDULEDBY = "Scheduled by"; private AttributeDefinitionDate def; ScheduledByAttribute(DateType type) throws DatatypeConfigurationException { def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionDate();
def.setIdentifier(IdentifierManager.generateIdentifier());
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/ScheduledByAttribute.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionDate; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class ScheduledByAttribute { private static final String SCHEDULEDBY = "Scheduled by"; private AttributeDefinitionDate def; ScheduledByAttribute(DateType type) throws DatatypeConfigurationException { def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionDate(); def.setIdentifier(IdentifierManager.generateIdentifier()); def.setLongName(SCHEDULEDBY); def.setType(type.getDef());
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/ScheduledByAttribute.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionDate; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class ScheduledByAttribute { private static final String SCHEDULEDBY = "Scheduled by"; private AttributeDefinitionDate def; ScheduledByAttribute(DateType type) throws DatatypeConfigurationException { def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionDate(); def.setIdentifier(IdentifierManager.generateIdentifier()); def.setLongName(SCHEDULEDBY); def.setType(type.getDef());
def.setLastChange(DateManager.getCurrentDate());
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/SpecRelationTypeWithRelationKind.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RelationTypeDTO.java // public final class RelationTypeDTO { // public static Enumerator DEFAULT; // // private Enumerator enumerator; // // public void fromEnumerator(Enumerator enumerator) { // this.enumerator = enumerator; // } // @Override // public String toString() { // return enumerator.toString(); // } // // public String name() { // return enumerator.getName(); // } // // public static RelationTypeDTO newInstance() { // return new RelationTypeDTO(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionString; import org.eclipse.rmf.reqif10.AttributeValueString; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecRelationType; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.RelationTypeDTO; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class SpecRelationTypeWithRelationKind { private SpecRelationType def; private IdentifierAttribute id; private AttributeDefinitionString specRelationTypeAttributeDefinitionString;
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RelationTypeDTO.java // public final class RelationTypeDTO { // public static Enumerator DEFAULT; // // private Enumerator enumerator; // // public void fromEnumerator(Enumerator enumerator) { // this.enumerator = enumerator; // } // @Override // public String toString() { // return enumerator.toString(); // } // // public String name() { // return enumerator.getName(); // } // // public static RelationTypeDTO newInstance() { // return new RelationTypeDTO(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/SpecRelationTypeWithRelationKind.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionString; import org.eclipse.rmf.reqif10.AttributeValueString; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecRelationType; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.RelationTypeDTO; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class SpecRelationTypeWithRelationKind { private SpecRelationType def; private IdentifierAttribute id; private AttributeDefinitionString specRelationTypeAttributeDefinitionString;
public SpecRelationTypeWithRelationKind(String32k typeId)
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/SpecRelationTypeWithRelationKind.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RelationTypeDTO.java // public final class RelationTypeDTO { // public static Enumerator DEFAULT; // // private Enumerator enumerator; // // public void fromEnumerator(Enumerator enumerator) { // this.enumerator = enumerator; // } // @Override // public String toString() { // return enumerator.toString(); // } // // public String name() { // return enumerator.getName(); // } // // public static RelationTypeDTO newInstance() { // return new RelationTypeDTO(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionString; import org.eclipse.rmf.reqif10.AttributeValueString; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecRelationType; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.RelationTypeDTO; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class SpecRelationTypeWithRelationKind { private SpecRelationType def; private IdentifierAttribute id; private AttributeDefinitionString specRelationTypeAttributeDefinitionString; public SpecRelationTypeWithRelationKind(String32k typeId) throws DatatypeConfigurationException { id = new IdentifierAttribute(typeId); specRelationTypeAttributeDefinitionString = ReqIF10Factory.eINSTANCE .createAttributeDefinitionString(); specRelationTypeAttributeDefinitionString
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RelationTypeDTO.java // public final class RelationTypeDTO { // public static Enumerator DEFAULT; // // private Enumerator enumerator; // // public void fromEnumerator(Enumerator enumerator) { // this.enumerator = enumerator; // } // @Override // public String toString() { // return enumerator.toString(); // } // // public String name() { // return enumerator.getName(); // } // // public static RelationTypeDTO newInstance() { // return new RelationTypeDTO(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/SpecRelationTypeWithRelationKind.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionString; import org.eclipse.rmf.reqif10.AttributeValueString; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecRelationType; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.RelationTypeDTO; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class SpecRelationTypeWithRelationKind { private SpecRelationType def; private IdentifierAttribute id; private AttributeDefinitionString specRelationTypeAttributeDefinitionString; public SpecRelationTypeWithRelationKind(String32k typeId) throws DatatypeConfigurationException { id = new IdentifierAttribute(typeId); specRelationTypeAttributeDefinitionString = ReqIF10Factory.eINSTANCE .createAttributeDefinitionString(); specRelationTypeAttributeDefinitionString
.setIdentifier(IdentifierManager.generateIdentifier());
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/SpecRelationTypeWithRelationKind.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RelationTypeDTO.java // public final class RelationTypeDTO { // public static Enumerator DEFAULT; // // private Enumerator enumerator; // // public void fromEnumerator(Enumerator enumerator) { // this.enumerator = enumerator; // } // @Override // public String toString() { // return enumerator.toString(); // } // // public String name() { // return enumerator.getName(); // } // // public static RelationTypeDTO newInstance() { // return new RelationTypeDTO(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionString; import org.eclipse.rmf.reqif10.AttributeValueString; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecRelationType; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.RelationTypeDTO; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class SpecRelationTypeWithRelationKind { private SpecRelationType def; private IdentifierAttribute id; private AttributeDefinitionString specRelationTypeAttributeDefinitionString; public SpecRelationTypeWithRelationKind(String32k typeId) throws DatatypeConfigurationException { id = new IdentifierAttribute(typeId); specRelationTypeAttributeDefinitionString = ReqIF10Factory.eINSTANCE .createAttributeDefinitionString(); specRelationTypeAttributeDefinitionString .setIdentifier(IdentifierManager.generateIdentifier()); specRelationTypeAttributeDefinitionString.setLongName("Relation");
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RelationTypeDTO.java // public final class RelationTypeDTO { // public static Enumerator DEFAULT; // // private Enumerator enumerator; // // public void fromEnumerator(Enumerator enumerator) { // this.enumerator = enumerator; // } // @Override // public String toString() { // return enumerator.toString(); // } // // public String name() { // return enumerator.getName(); // } // // public static RelationTypeDTO newInstance() { // return new RelationTypeDTO(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/SpecRelationTypeWithRelationKind.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionString; import org.eclipse.rmf.reqif10.AttributeValueString; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecRelationType; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.RelationTypeDTO; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class SpecRelationTypeWithRelationKind { private SpecRelationType def; private IdentifierAttribute id; private AttributeDefinitionString specRelationTypeAttributeDefinitionString; public SpecRelationTypeWithRelationKind(String32k typeId) throws DatatypeConfigurationException { id = new IdentifierAttribute(typeId); specRelationTypeAttributeDefinitionString = ReqIF10Factory.eINSTANCE .createAttributeDefinitionString(); specRelationTypeAttributeDefinitionString .setIdentifier(IdentifierManager.generateIdentifier()); specRelationTypeAttributeDefinitionString.setLongName("Relation");
specRelationTypeAttributeDefinitionString.setLastChange(DateManager
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/SpecRelationTypeWithRelationKind.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RelationTypeDTO.java // public final class RelationTypeDTO { // public static Enumerator DEFAULT; // // private Enumerator enumerator; // // public void fromEnumerator(Enumerator enumerator) { // this.enumerator = enumerator; // } // @Override // public String toString() { // return enumerator.toString(); // } // // public String name() { // return enumerator.getName(); // } // // public static RelationTypeDTO newInstance() { // return new RelationTypeDTO(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionString; import org.eclipse.rmf.reqif10.AttributeValueString; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecRelationType; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.RelationTypeDTO; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class SpecRelationTypeWithRelationKind { private SpecRelationType def; private IdentifierAttribute id; private AttributeDefinitionString specRelationTypeAttributeDefinitionString; public SpecRelationTypeWithRelationKind(String32k typeId) throws DatatypeConfigurationException { id = new IdentifierAttribute(typeId); specRelationTypeAttributeDefinitionString = ReqIF10Factory.eINSTANCE .createAttributeDefinitionString(); specRelationTypeAttributeDefinitionString .setIdentifier(IdentifierManager.generateIdentifier()); specRelationTypeAttributeDefinitionString.setLongName("Relation"); specRelationTypeAttributeDefinitionString.setLastChange(DateManager .getCurrentDate()); specRelationTypeAttributeDefinitionString.setType(typeId.getDef()); AttributeValueString attributeValueString = ReqIF10Factory.eINSTANCE .createAttributeValueString();
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RelationTypeDTO.java // public final class RelationTypeDTO { // public static Enumerator DEFAULT; // // private Enumerator enumerator; // // public void fromEnumerator(Enumerator enumerator) { // this.enumerator = enumerator; // } // @Override // public String toString() { // return enumerator.toString(); // } // // public String name() { // return enumerator.getName(); // } // // public static RelationTypeDTO newInstance() { // return new RelationTypeDTO(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/SpecRelationTypeWithRelationKind.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionString; import org.eclipse.rmf.reqif10.AttributeValueString; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecRelationType; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.RelationTypeDTO; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class SpecRelationTypeWithRelationKind { private SpecRelationType def; private IdentifierAttribute id; private AttributeDefinitionString specRelationTypeAttributeDefinitionString; public SpecRelationTypeWithRelationKind(String32k typeId) throws DatatypeConfigurationException { id = new IdentifierAttribute(typeId); specRelationTypeAttributeDefinitionString = ReqIF10Factory.eINSTANCE .createAttributeDefinitionString(); specRelationTypeAttributeDefinitionString .setIdentifier(IdentifierManager.generateIdentifier()); specRelationTypeAttributeDefinitionString.setLongName("Relation"); specRelationTypeAttributeDefinitionString.setLastChange(DateManager .getCurrentDate()); specRelationTypeAttributeDefinitionString.setType(typeId.getDef()); AttributeValueString attributeValueString = ReqIF10Factory.eINSTANCE .createAttributeValueString();
attributeValueString.setTheValue(RelationTypeDTO.DEFAULT.toString()
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/RequirementRankingValue.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RankingDTO.java // public final class RankingDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static RankingDTO newInstance() { // return new RankingDTO(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/EnumeratedAttributeValue.java // public class EnumeratedAttributeValue { // private AttributeValueEnumeration value; // // public EnumeratedAttributeValue(AttributeDefinitionEnumeration def) { // value = ReqIF10Factory.eINSTANCE.createAttributeValueEnumeration(); // value.setDefinition(def); // } // // public AttributeValueEnumeration getValue() { // return value; // } // // public void setValue(int v) { // List<EnumValue> newValues = new ArrayList<EnumValue>(); // final EList<EnumValue> enumValues = value.getDefinition().getType() // .getSpecifiedValues(); // for (EnumValue enumValue : enumValues) { // if (enumValue.getProperties().getKey() // .equals(BigInteger.valueOf(v))) { // newValues.add(enumValue); // break; // } // } // // value.getValues().clear(); // value.getValues().addAll(newValues); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/RequirementRankingAttribute.java // public class RequirementRankingAttribute { // private AttributeDefinitionEnumeration def; // // public RequirementRankingAttribute(final String name, final RequirementRanking type) { // def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName(name); // def.setType(type.getDef()); // def.setMultiValued(false); // // EnumeratedAttributeValue rankingValue = new EnumeratedAttributeValue(def); // rankingValue.setValue(RankingDTO.DEFAULT); // def.setDefaultValue(rankingValue.getValue()); // } // // public AttributeDefinitionEnumeration getDef() { // return def; // } // }
import org.eclipse.rmf.reqif10.AttributeValueEnumeration; import org.eclipse.rmf.reqif10.SpecObject; import de.kay_muench.reqif10.reqifcompiler.dto.RankingDTO; import de.kay_muench.reqif10.reqifcompiler.types.complex.EnumeratedAttributeValue; import de.kay_muench.reqif10.reqifcompiler.types.complex.RequirementRankingAttribute;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler; public class RequirementRankingValue { private EnumeratedAttributeValue value; public RequirementRankingValue(
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RankingDTO.java // public final class RankingDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static RankingDTO newInstance() { // return new RankingDTO(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/EnumeratedAttributeValue.java // public class EnumeratedAttributeValue { // private AttributeValueEnumeration value; // // public EnumeratedAttributeValue(AttributeDefinitionEnumeration def) { // value = ReqIF10Factory.eINSTANCE.createAttributeValueEnumeration(); // value.setDefinition(def); // } // // public AttributeValueEnumeration getValue() { // return value; // } // // public void setValue(int v) { // List<EnumValue> newValues = new ArrayList<EnumValue>(); // final EList<EnumValue> enumValues = value.getDefinition().getType() // .getSpecifiedValues(); // for (EnumValue enumValue : enumValues) { // if (enumValue.getProperties().getKey() // .equals(BigInteger.valueOf(v))) { // newValues.add(enumValue); // break; // } // } // // value.getValues().clear(); // value.getValues().addAll(newValues); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/RequirementRankingAttribute.java // public class RequirementRankingAttribute { // private AttributeDefinitionEnumeration def; // // public RequirementRankingAttribute(final String name, final RequirementRanking type) { // def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName(name); // def.setType(type.getDef()); // def.setMultiValued(false); // // EnumeratedAttributeValue rankingValue = new EnumeratedAttributeValue(def); // rankingValue.setValue(RankingDTO.DEFAULT); // def.setDefaultValue(rankingValue.getValue()); // } // // public AttributeDefinitionEnumeration getDef() { // return def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/RequirementRankingValue.java import org.eclipse.rmf.reqif10.AttributeValueEnumeration; import org.eclipse.rmf.reqif10.SpecObject; import de.kay_muench.reqif10.reqifcompiler.dto.RankingDTO; import de.kay_muench.reqif10.reqifcompiler.types.complex.EnumeratedAttributeValue; import de.kay_muench.reqif10.reqifcompiler.types.complex.RequirementRankingAttribute; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler; public class RequirementRankingValue { private EnumeratedAttributeValue value; public RequirementRankingValue(
final RequirementRankingAttribute type,
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/RequirementRankingValue.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RankingDTO.java // public final class RankingDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static RankingDTO newInstance() { // return new RankingDTO(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/EnumeratedAttributeValue.java // public class EnumeratedAttributeValue { // private AttributeValueEnumeration value; // // public EnumeratedAttributeValue(AttributeDefinitionEnumeration def) { // value = ReqIF10Factory.eINSTANCE.createAttributeValueEnumeration(); // value.setDefinition(def); // } // // public AttributeValueEnumeration getValue() { // return value; // } // // public void setValue(int v) { // List<EnumValue> newValues = new ArrayList<EnumValue>(); // final EList<EnumValue> enumValues = value.getDefinition().getType() // .getSpecifiedValues(); // for (EnumValue enumValue : enumValues) { // if (enumValue.getProperties().getKey() // .equals(BigInteger.valueOf(v))) { // newValues.add(enumValue); // break; // } // } // // value.getValues().clear(); // value.getValues().addAll(newValues); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/RequirementRankingAttribute.java // public class RequirementRankingAttribute { // private AttributeDefinitionEnumeration def; // // public RequirementRankingAttribute(final String name, final RequirementRanking type) { // def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName(name); // def.setType(type.getDef()); // def.setMultiValued(false); // // EnumeratedAttributeValue rankingValue = new EnumeratedAttributeValue(def); // rankingValue.setValue(RankingDTO.DEFAULT); // def.setDefaultValue(rankingValue.getValue()); // } // // public AttributeDefinitionEnumeration getDef() { // return def; // } // }
import org.eclipse.rmf.reqif10.AttributeValueEnumeration; import org.eclipse.rmf.reqif10.SpecObject; import de.kay_muench.reqif10.reqifcompiler.dto.RankingDTO; import de.kay_muench.reqif10.reqifcompiler.types.complex.EnumeratedAttributeValue; import de.kay_muench.reqif10.reqifcompiler.types.complex.RequirementRankingAttribute;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler; public class RequirementRankingValue { private EnumeratedAttributeValue value; public RequirementRankingValue( final RequirementRankingAttribute type, final SpecObject specObject) { this(type); specObject.getValues().add(value.getValue()); } public RequirementRankingValue( final RequirementRankingAttribute type) { value = new EnumeratedAttributeValue(type.getDef()); }
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RankingDTO.java // public final class RankingDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static RankingDTO newInstance() { // return new RankingDTO(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/EnumeratedAttributeValue.java // public class EnumeratedAttributeValue { // private AttributeValueEnumeration value; // // public EnumeratedAttributeValue(AttributeDefinitionEnumeration def) { // value = ReqIF10Factory.eINSTANCE.createAttributeValueEnumeration(); // value.setDefinition(def); // } // // public AttributeValueEnumeration getValue() { // return value; // } // // public void setValue(int v) { // List<EnumValue> newValues = new ArrayList<EnumValue>(); // final EList<EnumValue> enumValues = value.getDefinition().getType() // .getSpecifiedValues(); // for (EnumValue enumValue : enumValues) { // if (enumValue.getProperties().getKey() // .equals(BigInteger.valueOf(v))) { // newValues.add(enumValue); // break; // } // } // // value.getValues().clear(); // value.getValues().addAll(newValues); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/RequirementRankingAttribute.java // public class RequirementRankingAttribute { // private AttributeDefinitionEnumeration def; // // public RequirementRankingAttribute(final String name, final RequirementRanking type) { // def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName(name); // def.setType(type.getDef()); // def.setMultiValued(false); // // EnumeratedAttributeValue rankingValue = new EnumeratedAttributeValue(def); // rankingValue.setValue(RankingDTO.DEFAULT); // def.setDefaultValue(rankingValue.getValue()); // } // // public AttributeDefinitionEnumeration getDef() { // return def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/RequirementRankingValue.java import org.eclipse.rmf.reqif10.AttributeValueEnumeration; import org.eclipse.rmf.reqif10.SpecObject; import de.kay_muench.reqif10.reqifcompiler.dto.RankingDTO; import de.kay_muench.reqif10.reqifcompiler.types.complex.EnumeratedAttributeValue; import de.kay_muench.reqif10.reqifcompiler.types.complex.RequirementRankingAttribute; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler; public class RequirementRankingValue { private EnumeratedAttributeValue value; public RequirementRankingValue( final RequirementRankingAttribute type, final SpecObject specObject) { this(type); specObject.getValues().add(value.getValue()); } public RequirementRankingValue( final RequirementRankingAttribute type) { value = new EnumeratedAttributeValue(type.getDef()); }
void setRanking(RankingDTO ranking) {
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/RequirementRankingAttribute.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RankingDTO.java // public final class RankingDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static RankingDTO newInstance() { // return new RankingDTO(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // }
import org.eclipse.rmf.reqif10.AttributeDefinitionEnumeration; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.RankingDTO; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class RequirementRankingAttribute { private AttributeDefinitionEnumeration def;
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RankingDTO.java // public final class RankingDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static RankingDTO newInstance() { // return new RankingDTO(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/RequirementRankingAttribute.java import org.eclipse.rmf.reqif10.AttributeDefinitionEnumeration; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.RankingDTO; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class RequirementRankingAttribute { private AttributeDefinitionEnumeration def;
public RequirementRankingAttribute(final String name, final RequirementRanking type) {
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/RequirementRankingAttribute.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RankingDTO.java // public final class RankingDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static RankingDTO newInstance() { // return new RankingDTO(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // }
import org.eclipse.rmf.reqif10.AttributeDefinitionEnumeration; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.RankingDTO; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class RequirementRankingAttribute { private AttributeDefinitionEnumeration def; public RequirementRankingAttribute(final String name, final RequirementRanking type) { def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionEnumeration();
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RankingDTO.java // public final class RankingDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static RankingDTO newInstance() { // return new RankingDTO(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/RequirementRankingAttribute.java import org.eclipse.rmf.reqif10.AttributeDefinitionEnumeration; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.RankingDTO; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class RequirementRankingAttribute { private AttributeDefinitionEnumeration def; public RequirementRankingAttribute(final String name, final RequirementRanking type) { def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionEnumeration();
def.setIdentifier(IdentifierManager.generateIdentifier());
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/RequirementRankingAttribute.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RankingDTO.java // public final class RankingDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static RankingDTO newInstance() { // return new RankingDTO(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // }
import org.eclipse.rmf.reqif10.AttributeDefinitionEnumeration; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.RankingDTO; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class RequirementRankingAttribute { private AttributeDefinitionEnumeration def; public RequirementRankingAttribute(final String name, final RequirementRanking type) { def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionEnumeration(); def.setIdentifier(IdentifierManager.generateIdentifier()); def.setLongName(name); def.setType(type.getDef()); def.setMultiValued(false); EnumeratedAttributeValue rankingValue = new EnumeratedAttributeValue(def);
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RankingDTO.java // public final class RankingDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static RankingDTO newInstance() { // return new RankingDTO(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/RequirementRankingAttribute.java import org.eclipse.rmf.reqif10.AttributeDefinitionEnumeration; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.RankingDTO; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class RequirementRankingAttribute { private AttributeDefinitionEnumeration def; public RequirementRankingAttribute(final String name, final RequirementRanking type) { def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionEnumeration(); def.setIdentifier(IdentifierManager.generateIdentifier()); def.setLongName(name); def.setType(type.getDef()); def.setMultiValued(false); EnumeratedAttributeValue rankingValue = new EnumeratedAttributeValue(def);
rankingValue.setValue(RankingDTO.DEFAULT);
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/RequirementStatusAttribute.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/StatusDTO.java // public final class StatusDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static StatusDTO newInstance() { // return new StatusDTO(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // }
import org.eclipse.rmf.reqif10.AttributeDefinitionEnumeration; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.StatusDTO; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public final class RequirementStatusAttribute { private static final String STATUS = "Status"; private AttributeDefinitionEnumeration def;
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/StatusDTO.java // public final class StatusDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static StatusDTO newInstance() { // return new StatusDTO(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/RequirementStatusAttribute.java import org.eclipse.rmf.reqif10.AttributeDefinitionEnumeration; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.StatusDTO; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public final class RequirementStatusAttribute { private static final String STATUS = "Status"; private AttributeDefinitionEnumeration def;
public RequirementStatusAttribute(RequirementStatus type) {
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/RequirementStatusAttribute.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/StatusDTO.java // public final class StatusDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static StatusDTO newInstance() { // return new StatusDTO(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // }
import org.eclipse.rmf.reqif10.AttributeDefinitionEnumeration; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.StatusDTO; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public final class RequirementStatusAttribute { private static final String STATUS = "Status"; private AttributeDefinitionEnumeration def; public RequirementStatusAttribute(RequirementStatus type) { def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionEnumeration();
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/StatusDTO.java // public final class StatusDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static StatusDTO newInstance() { // return new StatusDTO(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/RequirementStatusAttribute.java import org.eclipse.rmf.reqif10.AttributeDefinitionEnumeration; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.StatusDTO; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public final class RequirementStatusAttribute { private static final String STATUS = "Status"; private AttributeDefinitionEnumeration def; public RequirementStatusAttribute(RequirementStatus type) { def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionEnumeration();
def.setIdentifier(IdentifierManager.generateIdentifier());
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/RequirementStatusAttribute.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/StatusDTO.java // public final class StatusDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static StatusDTO newInstance() { // return new StatusDTO(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // }
import org.eclipse.rmf.reqif10.AttributeDefinitionEnumeration; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.StatusDTO; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public final class RequirementStatusAttribute { private static final String STATUS = "Status"; private AttributeDefinitionEnumeration def; public RequirementStatusAttribute(RequirementStatus type) { def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionEnumeration(); def.setIdentifier(IdentifierManager.generateIdentifier()); def.setLongName(STATUS); def.setType(type.getDef()); def.setMultiValued(false); EnumeratedAttributeValue statusValue = new EnumeratedAttributeValue(def);
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/StatusDTO.java // public final class StatusDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static StatusDTO newInstance() { // return new StatusDTO(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/RequirementStatusAttribute.java import org.eclipse.rmf.reqif10.AttributeDefinitionEnumeration; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.StatusDTO; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public final class RequirementStatusAttribute { private static final String STATUS = "Status"; private AttributeDefinitionEnumeration def; public RequirementStatusAttribute(RequirementStatus type) { def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionEnumeration(); def.setIdentifier(IdentifierManager.generateIdentifier()); def.setLongName(STATUS); def.setType(type.getDef()); def.setMultiValued(false); EnumeratedAttributeValue statusValue = new EnumeratedAttributeValue(def);
statusValue.setValue(StatusDTO.DEFAULT);
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DescriptionValue.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/DescriptionAttribute.java // public final class DescriptionAttribute { // private static final String DESCRIPTION = "Description"; // private AttributeDefinitionXHTML def; // // DescriptionAttribute(XhtmlType type) throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionXHTML(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName(DESCRIPTION); // def.setType(type.getDef()); // def.setLastChange(DateManager.getCurrentDate()); // } // // public AttributeDefinitionXHTML getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/xhtml/XhtmlBuilder.java // public class XhtmlBuilder { // private Collection<XhtmlDivType> collection = new ArrayList<XhtmlDivType>(); // // public XhtmlBuilder append(ImageRefDTO ref) { // XhtmlDivType d = XhtmlFactory.eINSTANCE.createXhtmlDivType(); // // ImageInformationProvider provider = new ImageInformationProvider(); // // try { // ImageInformation info = provider.provideFor(ref.getUri()); // ImageDataUriProvider dataUriProvider = new ImageDataUriProvider(); // // XhtmlObjectType o = XhtmlFactory.eINSTANCE.createXhtmlObjectType(); // o.setClass("figure"); // o.setData(dataUriProvider.provideFor(info)); // o.setType(info.getMimeType()); // o.setWidth(Integer.valueOf(info.getWidth()).toString()); // o.setHeight(Integer.valueOf(info.getHeight()).toString()); // o.getBr().add(XhtmlFactory.eINSTANCE.createXhtmlBrType()); // // d.getObject().add(o); // } catch (RuntimeException e) { // XhtmlPType p = XhtmlFactory.eINSTANCE.createXhtmlPType(); // p.getXhtmlInlineMix().add( // FeatureMapUtil.createTextEntry(e.getMessage())); // d.getP().add(p); // } catch (IOException e) { // XhtmlPType p = XhtmlFactory.eINSTANCE.createXhtmlPType(); // p.getXhtmlInlineMix().add( // FeatureMapUtil.createTextEntry(e.getMessage())); // d.getP().add(p); // } // // this.collection.add(d); // return this; // } // // public XhtmlBuilder append(final TextDTO txt) { // XhtmlDivType d = XhtmlFactory.eINSTANCE.createXhtmlDivType(); // XhtmlPType p = XhtmlFactory.eINSTANCE.createXhtmlPType(); // final String[] lines = txt.getText().split("\n"); // for (int i = 0; i < lines.length; i++) { // p.getXhtmlInlineMix().add(FeatureMapUtil.createTextEntry(lines[i])); // if (i < lines.length - 1) // p.getBr().add(XhtmlFactory.eINSTANCE.createXhtmlBrType()); // } // d.getP().add(p); // this.collection.add(d); // return this; // } // // public XhtmlBuilder append(final XhtmlUlDTO dto) { // XhtmlDivType d = XhtmlFactory.eINSTANCE.createXhtmlDivType(); // d.getUl().add(dto.getUl()); // this.collection.add(d); // return this; // } // // public Collection<? extends XhtmlDivType> build() { // return this.collection; // } // // public static XhtmlBuilder newInstance() { // return new XhtmlBuilder(); // } // // }
import org.eclipse.rmf.reqif10.AttributeValueXHTML; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecObject; import org.eclipse.rmf.reqif10.XhtmlContent; import org.eclipse.rmf.reqif10.xhtml.XhtmlDivType; import org.eclipse.rmf.reqif10.xhtml.XhtmlFactory; import de.kay_muench.reqif10.reqifcompiler.types.complex.DescriptionAttribute; import de.kay_muench.reqif10.reqifcompiler.xhtml.XhtmlBuilder;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler; class DescriptionValue { private AttributeValueXHTML value;
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/DescriptionAttribute.java // public final class DescriptionAttribute { // private static final String DESCRIPTION = "Description"; // private AttributeDefinitionXHTML def; // // DescriptionAttribute(XhtmlType type) throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionXHTML(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName(DESCRIPTION); // def.setType(type.getDef()); // def.setLastChange(DateManager.getCurrentDate()); // } // // public AttributeDefinitionXHTML getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/xhtml/XhtmlBuilder.java // public class XhtmlBuilder { // private Collection<XhtmlDivType> collection = new ArrayList<XhtmlDivType>(); // // public XhtmlBuilder append(ImageRefDTO ref) { // XhtmlDivType d = XhtmlFactory.eINSTANCE.createXhtmlDivType(); // // ImageInformationProvider provider = new ImageInformationProvider(); // // try { // ImageInformation info = provider.provideFor(ref.getUri()); // ImageDataUriProvider dataUriProvider = new ImageDataUriProvider(); // // XhtmlObjectType o = XhtmlFactory.eINSTANCE.createXhtmlObjectType(); // o.setClass("figure"); // o.setData(dataUriProvider.provideFor(info)); // o.setType(info.getMimeType()); // o.setWidth(Integer.valueOf(info.getWidth()).toString()); // o.setHeight(Integer.valueOf(info.getHeight()).toString()); // o.getBr().add(XhtmlFactory.eINSTANCE.createXhtmlBrType()); // // d.getObject().add(o); // } catch (RuntimeException e) { // XhtmlPType p = XhtmlFactory.eINSTANCE.createXhtmlPType(); // p.getXhtmlInlineMix().add( // FeatureMapUtil.createTextEntry(e.getMessage())); // d.getP().add(p); // } catch (IOException e) { // XhtmlPType p = XhtmlFactory.eINSTANCE.createXhtmlPType(); // p.getXhtmlInlineMix().add( // FeatureMapUtil.createTextEntry(e.getMessage())); // d.getP().add(p); // } // // this.collection.add(d); // return this; // } // // public XhtmlBuilder append(final TextDTO txt) { // XhtmlDivType d = XhtmlFactory.eINSTANCE.createXhtmlDivType(); // XhtmlPType p = XhtmlFactory.eINSTANCE.createXhtmlPType(); // final String[] lines = txt.getText().split("\n"); // for (int i = 0; i < lines.length; i++) { // p.getXhtmlInlineMix().add(FeatureMapUtil.createTextEntry(lines[i])); // if (i < lines.length - 1) // p.getBr().add(XhtmlFactory.eINSTANCE.createXhtmlBrType()); // } // d.getP().add(p); // this.collection.add(d); // return this; // } // // public XhtmlBuilder append(final XhtmlUlDTO dto) { // XhtmlDivType d = XhtmlFactory.eINSTANCE.createXhtmlDivType(); // d.getUl().add(dto.getUl()); // this.collection.add(d); // return this; // } // // public Collection<? extends XhtmlDivType> build() { // return this.collection; // } // // public static XhtmlBuilder newInstance() { // return new XhtmlBuilder(); // } // // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DescriptionValue.java import org.eclipse.rmf.reqif10.AttributeValueXHTML; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecObject; import org.eclipse.rmf.reqif10.XhtmlContent; import org.eclipse.rmf.reqif10.xhtml.XhtmlDivType; import org.eclipse.rmf.reqif10.xhtml.XhtmlFactory; import de.kay_muench.reqif10.reqifcompiler.types.complex.DescriptionAttribute; import de.kay_muench.reqif10.reqifcompiler.xhtml.XhtmlBuilder; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler; class DescriptionValue { private AttributeValueXHTML value;
DescriptionValue(final DescriptionAttribute type,
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DescriptionValue.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/DescriptionAttribute.java // public final class DescriptionAttribute { // private static final String DESCRIPTION = "Description"; // private AttributeDefinitionXHTML def; // // DescriptionAttribute(XhtmlType type) throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionXHTML(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName(DESCRIPTION); // def.setType(type.getDef()); // def.setLastChange(DateManager.getCurrentDate()); // } // // public AttributeDefinitionXHTML getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/xhtml/XhtmlBuilder.java // public class XhtmlBuilder { // private Collection<XhtmlDivType> collection = new ArrayList<XhtmlDivType>(); // // public XhtmlBuilder append(ImageRefDTO ref) { // XhtmlDivType d = XhtmlFactory.eINSTANCE.createXhtmlDivType(); // // ImageInformationProvider provider = new ImageInformationProvider(); // // try { // ImageInformation info = provider.provideFor(ref.getUri()); // ImageDataUriProvider dataUriProvider = new ImageDataUriProvider(); // // XhtmlObjectType o = XhtmlFactory.eINSTANCE.createXhtmlObjectType(); // o.setClass("figure"); // o.setData(dataUriProvider.provideFor(info)); // o.setType(info.getMimeType()); // o.setWidth(Integer.valueOf(info.getWidth()).toString()); // o.setHeight(Integer.valueOf(info.getHeight()).toString()); // o.getBr().add(XhtmlFactory.eINSTANCE.createXhtmlBrType()); // // d.getObject().add(o); // } catch (RuntimeException e) { // XhtmlPType p = XhtmlFactory.eINSTANCE.createXhtmlPType(); // p.getXhtmlInlineMix().add( // FeatureMapUtil.createTextEntry(e.getMessage())); // d.getP().add(p); // } catch (IOException e) { // XhtmlPType p = XhtmlFactory.eINSTANCE.createXhtmlPType(); // p.getXhtmlInlineMix().add( // FeatureMapUtil.createTextEntry(e.getMessage())); // d.getP().add(p); // } // // this.collection.add(d); // return this; // } // // public XhtmlBuilder append(final TextDTO txt) { // XhtmlDivType d = XhtmlFactory.eINSTANCE.createXhtmlDivType(); // XhtmlPType p = XhtmlFactory.eINSTANCE.createXhtmlPType(); // final String[] lines = txt.getText().split("\n"); // for (int i = 0; i < lines.length; i++) { // p.getXhtmlInlineMix().add(FeatureMapUtil.createTextEntry(lines[i])); // if (i < lines.length - 1) // p.getBr().add(XhtmlFactory.eINSTANCE.createXhtmlBrType()); // } // d.getP().add(p); // this.collection.add(d); // return this; // } // // public XhtmlBuilder append(final XhtmlUlDTO dto) { // XhtmlDivType d = XhtmlFactory.eINSTANCE.createXhtmlDivType(); // d.getUl().add(dto.getUl()); // this.collection.add(d); // return this; // } // // public Collection<? extends XhtmlDivType> build() { // return this.collection; // } // // public static XhtmlBuilder newInstance() { // return new XhtmlBuilder(); // } // // }
import org.eclipse.rmf.reqif10.AttributeValueXHTML; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecObject; import org.eclipse.rmf.reqif10.XhtmlContent; import org.eclipse.rmf.reqif10.xhtml.XhtmlDivType; import org.eclipse.rmf.reqif10.xhtml.XhtmlFactory; import de.kay_muench.reqif10.reqifcompiler.types.complex.DescriptionAttribute; import de.kay_muench.reqif10.reqifcompiler.xhtml.XhtmlBuilder;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler; class DescriptionValue { private AttributeValueXHTML value; DescriptionValue(final DescriptionAttribute type, final SpecObject specObject) { value = ReqIF10Factory.eINSTANCE.createAttributeValueXHTML(); value.setDefinition(type.getDef()); specObject.getValues().add(value); }
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/DescriptionAttribute.java // public final class DescriptionAttribute { // private static final String DESCRIPTION = "Description"; // private AttributeDefinitionXHTML def; // // DescriptionAttribute(XhtmlType type) throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionXHTML(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName(DESCRIPTION); // def.setType(type.getDef()); // def.setLastChange(DateManager.getCurrentDate()); // } // // public AttributeDefinitionXHTML getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/xhtml/XhtmlBuilder.java // public class XhtmlBuilder { // private Collection<XhtmlDivType> collection = new ArrayList<XhtmlDivType>(); // // public XhtmlBuilder append(ImageRefDTO ref) { // XhtmlDivType d = XhtmlFactory.eINSTANCE.createXhtmlDivType(); // // ImageInformationProvider provider = new ImageInformationProvider(); // // try { // ImageInformation info = provider.provideFor(ref.getUri()); // ImageDataUriProvider dataUriProvider = new ImageDataUriProvider(); // // XhtmlObjectType o = XhtmlFactory.eINSTANCE.createXhtmlObjectType(); // o.setClass("figure"); // o.setData(dataUriProvider.provideFor(info)); // o.setType(info.getMimeType()); // o.setWidth(Integer.valueOf(info.getWidth()).toString()); // o.setHeight(Integer.valueOf(info.getHeight()).toString()); // o.getBr().add(XhtmlFactory.eINSTANCE.createXhtmlBrType()); // // d.getObject().add(o); // } catch (RuntimeException e) { // XhtmlPType p = XhtmlFactory.eINSTANCE.createXhtmlPType(); // p.getXhtmlInlineMix().add( // FeatureMapUtil.createTextEntry(e.getMessage())); // d.getP().add(p); // } catch (IOException e) { // XhtmlPType p = XhtmlFactory.eINSTANCE.createXhtmlPType(); // p.getXhtmlInlineMix().add( // FeatureMapUtil.createTextEntry(e.getMessage())); // d.getP().add(p); // } // // this.collection.add(d); // return this; // } // // public XhtmlBuilder append(final TextDTO txt) { // XhtmlDivType d = XhtmlFactory.eINSTANCE.createXhtmlDivType(); // XhtmlPType p = XhtmlFactory.eINSTANCE.createXhtmlPType(); // final String[] lines = txt.getText().split("\n"); // for (int i = 0; i < lines.length; i++) { // p.getXhtmlInlineMix().add(FeatureMapUtil.createTextEntry(lines[i])); // if (i < lines.length - 1) // p.getBr().add(XhtmlFactory.eINSTANCE.createXhtmlBrType()); // } // d.getP().add(p); // this.collection.add(d); // return this; // } // // public XhtmlBuilder append(final XhtmlUlDTO dto) { // XhtmlDivType d = XhtmlFactory.eINSTANCE.createXhtmlDivType(); // d.getUl().add(dto.getUl()); // this.collection.add(d); // return this; // } // // public Collection<? extends XhtmlDivType> build() { // return this.collection; // } // // public static XhtmlBuilder newInstance() { // return new XhtmlBuilder(); // } // // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DescriptionValue.java import org.eclipse.rmf.reqif10.AttributeValueXHTML; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecObject; import org.eclipse.rmf.reqif10.XhtmlContent; import org.eclipse.rmf.reqif10.xhtml.XhtmlDivType; import org.eclipse.rmf.reqif10.xhtml.XhtmlFactory; import de.kay_muench.reqif10.reqifcompiler.types.complex.DescriptionAttribute; import de.kay_muench.reqif10.reqifcompiler.xhtml.XhtmlBuilder; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler; class DescriptionValue { private AttributeValueXHTML value; DescriptionValue(final DescriptionAttribute type, final SpecObject specObject) { value = ReqIF10Factory.eINSTANCE.createAttributeValueXHTML(); value.setDefinition(type.getDef()); specObject.getValues().add(value); }
void setDescription(final XhtmlBuilder builder) {
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.DatatypeDefinitionDate; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.simple; public class DateType { private DatatypeDefinitionDate def; DateType() throws DatatypeConfigurationException { def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate();
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.DatatypeDefinitionDate; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.simple; public class DateType { private DatatypeDefinitionDate def; DateType() throws DatatypeConfigurationException { def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate();
def.setIdentifier(IdentifierManager.generateIdentifier());
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.DatatypeDefinitionDate; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.simple; public class DateType { private DatatypeDefinitionDate def; DateType() throws DatatypeConfigurationException { def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); def.setIdentifier(IdentifierManager.generateIdentifier()); def.setLongName("T_Date");
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.DatatypeDefinitionDate; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.simple; public class DateType { private DatatypeDefinitionDate def; DateType() throws DatatypeConfigurationException { def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); def.setIdentifier(IdentifierManager.generateIdentifier()); def.setLongName("T_Date");
def.setLastChange(DateManager.getCurrentDate());
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // }
import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import org.eclipse.rmf.reqif10.DatatypeDefinitionXHTML; import org.eclipse.rmf.reqif10.ReqIF10Factory;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.simple; public class XhtmlType { private DatatypeDefinitionXHTML def; public XhtmlType() { this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML();
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import org.eclipse.rmf.reqif10.DatatypeDefinitionXHTML; import org.eclipse.rmf.reqif10.ReqIF10Factory; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.simple; public class XhtmlType { private DatatypeDefinitionXHTML def; public XhtmlType() { this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML();
this.def.setIdentifier(IdentifierManager.generateIdentifier());
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/HeadlineType.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/Headline.java // public class Headline { // private DatatypeDefinitionString def; // // Headline() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Headline"); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.Headline;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class HeadlineType { private SpecObjectType def; private IdentifierAttribute id;
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/Headline.java // public class Headline { // private DatatypeDefinitionString def; // // Headline() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Headline"); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/HeadlineType.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.Headline; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class HeadlineType { private SpecObjectType def; private IdentifierAttribute id;
HeadlineType(Headline typeIdDesc)
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/HeadlineType.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/Headline.java // public class Headline { // private DatatypeDefinitionString def; // // Headline() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Headline"); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.Headline;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class HeadlineType { private SpecObjectType def; private IdentifierAttribute id; HeadlineType(Headline typeIdDesc) throws DatatypeConfigurationException { id = new IdentifierAttribute(typeIdDesc); def = ReqIF10Factory.eINSTANCE.createSpecObjectType();
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/Headline.java // public class Headline { // private DatatypeDefinitionString def; // // Headline() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Headline"); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/HeadlineType.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.Headline; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class HeadlineType { private SpecObjectType def; private IdentifierAttribute id; HeadlineType(Headline typeIdDesc) throws DatatypeConfigurationException { id = new IdentifierAttribute(typeIdDesc); def = ReqIF10Factory.eINSTANCE.createSpecObjectType();
def.setIdentifier(IdentifierManager.generateIdentifier());
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/RequirementStatusValue.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/StatusDTO.java // public final class StatusDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static StatusDTO newInstance() { // return new StatusDTO(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/EnumeratedAttributeValue.java // public class EnumeratedAttributeValue { // private AttributeValueEnumeration value; // // public EnumeratedAttributeValue(AttributeDefinitionEnumeration def) { // value = ReqIF10Factory.eINSTANCE.createAttributeValueEnumeration(); // value.setDefinition(def); // } // // public AttributeValueEnumeration getValue() { // return value; // } // // public void setValue(int v) { // List<EnumValue> newValues = new ArrayList<EnumValue>(); // final EList<EnumValue> enumValues = value.getDefinition().getType() // .getSpecifiedValues(); // for (EnumValue enumValue : enumValues) { // if (enumValue.getProperties().getKey() // .equals(BigInteger.valueOf(v))) { // newValues.add(enumValue); // break; // } // } // // value.getValues().clear(); // value.getValues().addAll(newValues); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/RequirementStatusAttribute.java // public final class RequirementStatusAttribute { // private static final String STATUS = "Status"; // private AttributeDefinitionEnumeration def; // // public RequirementStatusAttribute(RequirementStatus type) { // // def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName(STATUS); // def.setType(type.getDef()); // def.setMultiValued(false); // // EnumeratedAttributeValue statusValue = new EnumeratedAttributeValue(def); // statusValue.setValue(StatusDTO.DEFAULT); // def.setDefaultValue(statusValue.getValue()); // } // // public AttributeDefinitionEnumeration getDef() { // return def; // } // // }
import org.eclipse.rmf.reqif10.AttributeValueEnumeration; import org.eclipse.rmf.reqif10.SpecObject; import de.kay_muench.reqif10.reqifcompiler.dto.StatusDTO; import de.kay_muench.reqif10.reqifcompiler.types.complex.EnumeratedAttributeValue; import de.kay_muench.reqif10.reqifcompiler.types.complex.RequirementStatusAttribute;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler; public class RequirementStatusValue { private EnumeratedAttributeValue value; public RequirementStatusValue(
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/StatusDTO.java // public final class StatusDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static StatusDTO newInstance() { // return new StatusDTO(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/EnumeratedAttributeValue.java // public class EnumeratedAttributeValue { // private AttributeValueEnumeration value; // // public EnumeratedAttributeValue(AttributeDefinitionEnumeration def) { // value = ReqIF10Factory.eINSTANCE.createAttributeValueEnumeration(); // value.setDefinition(def); // } // // public AttributeValueEnumeration getValue() { // return value; // } // // public void setValue(int v) { // List<EnumValue> newValues = new ArrayList<EnumValue>(); // final EList<EnumValue> enumValues = value.getDefinition().getType() // .getSpecifiedValues(); // for (EnumValue enumValue : enumValues) { // if (enumValue.getProperties().getKey() // .equals(BigInteger.valueOf(v))) { // newValues.add(enumValue); // break; // } // } // // value.getValues().clear(); // value.getValues().addAll(newValues); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/RequirementStatusAttribute.java // public final class RequirementStatusAttribute { // private static final String STATUS = "Status"; // private AttributeDefinitionEnumeration def; // // public RequirementStatusAttribute(RequirementStatus type) { // // def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName(STATUS); // def.setType(type.getDef()); // def.setMultiValued(false); // // EnumeratedAttributeValue statusValue = new EnumeratedAttributeValue(def); // statusValue.setValue(StatusDTO.DEFAULT); // def.setDefaultValue(statusValue.getValue()); // } // // public AttributeDefinitionEnumeration getDef() { // return def; // } // // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/RequirementStatusValue.java import org.eclipse.rmf.reqif10.AttributeValueEnumeration; import org.eclipse.rmf.reqif10.SpecObject; import de.kay_muench.reqif10.reqifcompiler.dto.StatusDTO; import de.kay_muench.reqif10.reqifcompiler.types.complex.EnumeratedAttributeValue; import de.kay_muench.reqif10.reqifcompiler.types.complex.RequirementStatusAttribute; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler; public class RequirementStatusValue { private EnumeratedAttributeValue value; public RequirementStatusValue(
final RequirementStatusAttribute type,
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/RequirementStatusValue.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/StatusDTO.java // public final class StatusDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static StatusDTO newInstance() { // return new StatusDTO(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/EnumeratedAttributeValue.java // public class EnumeratedAttributeValue { // private AttributeValueEnumeration value; // // public EnumeratedAttributeValue(AttributeDefinitionEnumeration def) { // value = ReqIF10Factory.eINSTANCE.createAttributeValueEnumeration(); // value.setDefinition(def); // } // // public AttributeValueEnumeration getValue() { // return value; // } // // public void setValue(int v) { // List<EnumValue> newValues = new ArrayList<EnumValue>(); // final EList<EnumValue> enumValues = value.getDefinition().getType() // .getSpecifiedValues(); // for (EnumValue enumValue : enumValues) { // if (enumValue.getProperties().getKey() // .equals(BigInteger.valueOf(v))) { // newValues.add(enumValue); // break; // } // } // // value.getValues().clear(); // value.getValues().addAll(newValues); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/RequirementStatusAttribute.java // public final class RequirementStatusAttribute { // private static final String STATUS = "Status"; // private AttributeDefinitionEnumeration def; // // public RequirementStatusAttribute(RequirementStatus type) { // // def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName(STATUS); // def.setType(type.getDef()); // def.setMultiValued(false); // // EnumeratedAttributeValue statusValue = new EnumeratedAttributeValue(def); // statusValue.setValue(StatusDTO.DEFAULT); // def.setDefaultValue(statusValue.getValue()); // } // // public AttributeDefinitionEnumeration getDef() { // return def; // } // // }
import org.eclipse.rmf.reqif10.AttributeValueEnumeration; import org.eclipse.rmf.reqif10.SpecObject; import de.kay_muench.reqif10.reqifcompiler.dto.StatusDTO; import de.kay_muench.reqif10.reqifcompiler.types.complex.EnumeratedAttributeValue; import de.kay_muench.reqif10.reqifcompiler.types.complex.RequirementStatusAttribute;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler; public class RequirementStatusValue { private EnumeratedAttributeValue value; public RequirementStatusValue( final RequirementStatusAttribute type, final SpecObject specObject) { this(type); specObject.getValues().add(value.getValue()); } public RequirementStatusValue( final RequirementStatusAttribute type) { value = new EnumeratedAttributeValue(type.getDef()); }
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/StatusDTO.java // public final class StatusDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static StatusDTO newInstance() { // return new StatusDTO(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/EnumeratedAttributeValue.java // public class EnumeratedAttributeValue { // private AttributeValueEnumeration value; // // public EnumeratedAttributeValue(AttributeDefinitionEnumeration def) { // value = ReqIF10Factory.eINSTANCE.createAttributeValueEnumeration(); // value.setDefinition(def); // } // // public AttributeValueEnumeration getValue() { // return value; // } // // public void setValue(int v) { // List<EnumValue> newValues = new ArrayList<EnumValue>(); // final EList<EnumValue> enumValues = value.getDefinition().getType() // .getSpecifiedValues(); // for (EnumValue enumValue : enumValues) { // if (enumValue.getProperties().getKey() // .equals(BigInteger.valueOf(v))) { // newValues.add(enumValue); // break; // } // } // // value.getValues().clear(); // value.getValues().addAll(newValues); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/RequirementStatusAttribute.java // public final class RequirementStatusAttribute { // private static final String STATUS = "Status"; // private AttributeDefinitionEnumeration def; // // public RequirementStatusAttribute(RequirementStatus type) { // // def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName(STATUS); // def.setType(type.getDef()); // def.setMultiValued(false); // // EnumeratedAttributeValue statusValue = new EnumeratedAttributeValue(def); // statusValue.setValue(StatusDTO.DEFAULT); // def.setDefaultValue(statusValue.getValue()); // } // // public AttributeDefinitionEnumeration getDef() { // return def; // } // // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/RequirementStatusValue.java import org.eclipse.rmf.reqif10.AttributeValueEnumeration; import org.eclipse.rmf.reqif10.SpecObject; import de.kay_muench.reqif10.reqifcompiler.dto.StatusDTO; import de.kay_muench.reqif10.reqifcompiler.types.complex.EnumeratedAttributeValue; import de.kay_muench.reqif10.reqifcompiler.types.complex.RequirementStatusAttribute; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler; public class RequirementStatusValue { private EnumeratedAttributeValue value; public RequirementStatusValue( final RequirementStatusAttribute type, final SpecObject specObject) { this(type); specObject.getValues().add(value.getValue()); } public RequirementStatusValue( final RequirementStatusAttribute type) { value = new EnumeratedAttributeValue(type.getDef()); }
void setStatus(StatusDTO status) {
KayErikMuench/reqiftools
reqifiterator/src/test/java/de/kay_muench/reqif10/reqifiterator/ReqIF10ListenerIteratorTest.java
// Path: reqifparser/src/main/java/de/kay_muench/reqif10/reqifparser/ReqIF10Parser.java // public final class ReqIF10Parser { // private String reqIFFilename; // private List<String> diagnostics = new ArrayList<String>(); // private boolean removeToolExtensions = false; // private boolean removeTemporaries = true; // // public ReqIF parseReqIFContent() { // String wkFile = this.getReqIFFilename(); // if (isRemoveToolExtensions()) { // ToolExRemover remover = new ToolExRemover(); // remover.setDeleteOnExit(this.isRemoveTemporaries()); // wkFile = remover.remove(this.getReqIFFilename()); // } // // registerEPackageStd(); // ReqIF reqif = this.parse(wkFile); // return reqif; // } // // public String getReqIFFilename() { // return reqIFFilename; // } // // public void setReqIFFilename(String filename) { // if (filename != null) { // reqIFFilename = filename; // } // } // // public boolean isRemoveToolExtensions() { // return removeToolExtensions; // } // // public void setRemoveToolExtensions(boolean removeToolExtensions) { // this.removeToolExtensions = removeToolExtensions; // } // // public boolean isRemoveTemporaries() { // return removeTemporaries; // } // // public void setRemoveTemporaries(boolean removeTemporaries) { // this.removeTemporaries = removeTemporaries; // } // // private ReqIF parse(final String fileName) { // try { // URI uri = URI.createFileURI(fileName); // ResourceFactoryImpl resourceFactory = new XMLPersistenceMappingResourceFactoryImpl(); // XMLResource resource = (XMLResource) resourceFactory // .createResource(uri); // Map<?, ?> options = null; // resource.load(options); // // this.getDiagnostics().clear(); // for (Diagnostic d : resource.getErrors()) { // this.getDiagnostics().add("ERROR " + d.getLocation() + " " // + d.getLine() + " " + d.getMessage()); // } // for (Diagnostic d : resource.getWarnings()) { // this.getDiagnostics().add("WARNING " + d.getLocation() + " " // + d.getLine() + " " + d.getMessage()); // } // // ResourceSet resourceSet = new XMLPersistenceMappingResourceSetImpl(); // resourceSet.getResources().add(resource); // // EList<EObject> rootObjects = resource.getContents(); // if (rootObjects.isEmpty()) { // throw new RuntimeException("The resource parsed from '" // + uri.toString() + "' seems to be empty."); // } // ReqIF reqif = (ReqIF) rootObjects.get(0); // // return reqif; // // } catch (Exception e) { // throw new RuntimeException("Parsing '" + fileName + "' failed.", // e.getCause()); // } // } // // private final void registerEPackageStd() { // EPackage.Registry.INSTANCE.clear(); // EPackage.Registry.INSTANCE.put(ReqIF10Package.eNS_URI, // ReqIF10Package.eINSTANCE); // EPackage.Registry.INSTANCE.put(XhtmlPackage.eNS_URI, // XhtmlPackage.eINSTANCE); // EPackage.Registry.INSTANCE.put(DatatypesPackage.eNS_URI, // DatatypesPackage.eINSTANCE); // EPackage.Registry.INSTANCE.put(XMLNamespacePackage.eNS_URI, // XMLNamespacePackage.eINSTANCE); // } // // public List<String> getDiagnostics() { // return diagnostics; // } // }
import de.kay_muench.reqif10.reqifparser.ReqIF10Parser; import static org.junit.Assert.assertEquals; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.ResourceBundle; import java.util.Set; import org.apache.log4j.ConsoleAppender; import org.apache.log4j.Logger; import org.apache.log4j.PatternLayout; import org.eclipse.emf.common.util.EList; import org.eclipse.rmf.reqif10.ReqIF; import org.eclipse.rmf.reqif10.SpecRelation; import org.eclipse.rmf.reqif10.Specification; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifiterator; public class ReqIF10ListenerIteratorTest { private ReqIF reqif; private SpecObjectListener specObjectListener; private SpecificationListener specificationListener; private SpecRelationListener specRelationListener; private final List<String> listenedTypes = new ArrayList<>(); @BeforeClass public static void setUpBeforeClass() { ConsoleAppender appender = new ConsoleAppender(); appender.setName("testappender"); appender.setLayout(new PatternLayout( "%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}]: %m%n")); appender.setTarget(ConsoleAppender.SYSTEM_OUT); appender.activateOptions(); Logger.getLogger("testlogger").addAppender(appender); } @Before public void setUp() throws Exception {
// Path: reqifparser/src/main/java/de/kay_muench/reqif10/reqifparser/ReqIF10Parser.java // public final class ReqIF10Parser { // private String reqIFFilename; // private List<String> diagnostics = new ArrayList<String>(); // private boolean removeToolExtensions = false; // private boolean removeTemporaries = true; // // public ReqIF parseReqIFContent() { // String wkFile = this.getReqIFFilename(); // if (isRemoveToolExtensions()) { // ToolExRemover remover = new ToolExRemover(); // remover.setDeleteOnExit(this.isRemoveTemporaries()); // wkFile = remover.remove(this.getReqIFFilename()); // } // // registerEPackageStd(); // ReqIF reqif = this.parse(wkFile); // return reqif; // } // // public String getReqIFFilename() { // return reqIFFilename; // } // // public void setReqIFFilename(String filename) { // if (filename != null) { // reqIFFilename = filename; // } // } // // public boolean isRemoveToolExtensions() { // return removeToolExtensions; // } // // public void setRemoveToolExtensions(boolean removeToolExtensions) { // this.removeToolExtensions = removeToolExtensions; // } // // public boolean isRemoveTemporaries() { // return removeTemporaries; // } // // public void setRemoveTemporaries(boolean removeTemporaries) { // this.removeTemporaries = removeTemporaries; // } // // private ReqIF parse(final String fileName) { // try { // URI uri = URI.createFileURI(fileName); // ResourceFactoryImpl resourceFactory = new XMLPersistenceMappingResourceFactoryImpl(); // XMLResource resource = (XMLResource) resourceFactory // .createResource(uri); // Map<?, ?> options = null; // resource.load(options); // // this.getDiagnostics().clear(); // for (Diagnostic d : resource.getErrors()) { // this.getDiagnostics().add("ERROR " + d.getLocation() + " " // + d.getLine() + " " + d.getMessage()); // } // for (Diagnostic d : resource.getWarnings()) { // this.getDiagnostics().add("WARNING " + d.getLocation() + " " // + d.getLine() + " " + d.getMessage()); // } // // ResourceSet resourceSet = new XMLPersistenceMappingResourceSetImpl(); // resourceSet.getResources().add(resource); // // EList<EObject> rootObjects = resource.getContents(); // if (rootObjects.isEmpty()) { // throw new RuntimeException("The resource parsed from '" // + uri.toString() + "' seems to be empty."); // } // ReqIF reqif = (ReqIF) rootObjects.get(0); // // return reqif; // // } catch (Exception e) { // throw new RuntimeException("Parsing '" + fileName + "' failed.", // e.getCause()); // } // } // // private final void registerEPackageStd() { // EPackage.Registry.INSTANCE.clear(); // EPackage.Registry.INSTANCE.put(ReqIF10Package.eNS_URI, // ReqIF10Package.eINSTANCE); // EPackage.Registry.INSTANCE.put(XhtmlPackage.eNS_URI, // XhtmlPackage.eINSTANCE); // EPackage.Registry.INSTANCE.put(DatatypesPackage.eNS_URI, // DatatypesPackage.eINSTANCE); // EPackage.Registry.INSTANCE.put(XMLNamespacePackage.eNS_URI, // XMLNamespacePackage.eINSTANCE); // } // // public List<String> getDiagnostics() { // return diagnostics; // } // } // Path: reqifiterator/src/test/java/de/kay_muench/reqif10/reqifiterator/ReqIF10ListenerIteratorTest.java import de.kay_muench.reqif10.reqifparser.ReqIF10Parser; import static org.junit.Assert.assertEquals; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.ResourceBundle; import java.util.Set; import org.apache.log4j.ConsoleAppender; import org.apache.log4j.Logger; import org.apache.log4j.PatternLayout; import org.eclipse.emf.common.util.EList; import org.eclipse.rmf.reqif10.ReqIF; import org.eclipse.rmf.reqif10.SpecRelation; import org.eclipse.rmf.reqif10.Specification; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifiterator; public class ReqIF10ListenerIteratorTest { private ReqIF reqif; private SpecObjectListener specObjectListener; private SpecificationListener specificationListener; private SpecRelationListener specRelationListener; private final List<String> listenedTypes = new ArrayList<>(); @BeforeClass public static void setUpBeforeClass() { ConsoleAppender appender = new ConsoleAppender(); appender.setName("testappender"); appender.setLayout(new PatternLayout( "%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}]: %m%n")); appender.setTarget(ConsoleAppender.SYSTEM_OUT); appender.activateOptions(); Logger.getLogger("testlogger").addAppender(appender); } @Before public void setUp() throws Exception {
ReqIF10Parser parser = new ReqIF10Parser();
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/AttributesRegistry.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/SimpleTypesRegistry.java // public class SimpleTypesRegistry { // public SimpleTypesRegistry() throws Exception { // } // // private String32k reqifString = new String32k(); // private DateType reqifDate = new DateType(); // private XhtmlType reqifXhtml = new XhtmlType(); // private Headline reqifHeadline = new Headline(); // private RequirementStatus reqifRequirementStatus = new RequirementStatus(); // private RequirementRanking reqifRequirementRanking = new RequirementRanking(); // // public String32k getReqIFString32kType() { // return this.reqifString; // } // // public DateType getReqIFDateType() { // return this.reqifDate; // } // // public XhtmlType getReqIFXhtmlType() { // return this.reqifXhtml; // } // // public Headline getReqIFHeadlineType() { // return this.reqifHeadline; // } // // public RequirementStatus getReqIFRequirementStatusType() { // return reqifRequirementStatus; // } // // public RequirementRanking getReqIFRequirementRankingType() { // return this.reqifRequirementRanking; // } // // public List<DatatypeDefinition> getDatatypes() { // List<DatatypeDefinition> definitions = new LinkedList<DatatypeDefinition>(); // definitions.add(this.reqifString.getDef()); // definitions.add(this.reqifDate.getDef()); // definitions.add(this.reqifXhtml.getDef()); // definitions.add(this.reqifHeadline.getDef()); // definitions.add(this.reqifRequirementStatus.getDef()); // definitions.add(this.reqifRequirementRanking.getDef()); // return definitions; // } // }
import de.kay_muench.reqif10.reqifcompiler.types.simple.SimpleTypesRegistry;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class AttributesRegistry { private IdentifierAttribute idAttribute;
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/SimpleTypesRegistry.java // public class SimpleTypesRegistry { // public SimpleTypesRegistry() throws Exception { // } // // private String32k reqifString = new String32k(); // private DateType reqifDate = new DateType(); // private XhtmlType reqifXhtml = new XhtmlType(); // private Headline reqifHeadline = new Headline(); // private RequirementStatus reqifRequirementStatus = new RequirementStatus(); // private RequirementRanking reqifRequirementRanking = new RequirementRanking(); // // public String32k getReqIFString32kType() { // return this.reqifString; // } // // public DateType getReqIFDateType() { // return this.reqifDate; // } // // public XhtmlType getReqIFXhtmlType() { // return this.reqifXhtml; // } // // public Headline getReqIFHeadlineType() { // return this.reqifHeadline; // } // // public RequirementStatus getReqIFRequirementStatusType() { // return reqifRequirementStatus; // } // // public RequirementRanking getReqIFRequirementRankingType() { // return this.reqifRequirementRanking; // } // // public List<DatatypeDefinition> getDatatypes() { // List<DatatypeDefinition> definitions = new LinkedList<DatatypeDefinition>(); // definitions.add(this.reqifString.getDef()); // definitions.add(this.reqifDate.getDef()); // definitions.add(this.reqifXhtml.getDef()); // definitions.add(this.reqifHeadline.getDef()); // definitions.add(this.reqifRequirementStatus.getDef()); // definitions.add(this.reqifRequirementRanking.getDef()); // return definitions; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/AttributesRegistry.java import de.kay_muench.reqif10.reqifcompiler.types.simple.SimpleTypesRegistry; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class AttributesRegistry { private IdentifierAttribute idAttribute;
public AttributesRegistry(SimpleTypesRegistry registry) throws Exception {
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/BaselineSpecObjectType.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class BaselineSpecObjectType { private CommonSpecObjectTypeDefinitions commondefs;
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/BaselineSpecObjectType.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class BaselineSpecObjectType { private CommonSpecObjectTypeDefinitions commondefs;
BaselineSpecObjectType(String32k typeId, XhtmlType reqifXhtml,
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/BaselineSpecObjectType.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class BaselineSpecObjectType { private CommonSpecObjectTypeDefinitions commondefs;
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/BaselineSpecObjectType.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class BaselineSpecObjectType { private CommonSpecObjectTypeDefinitions commondefs;
BaselineSpecObjectType(String32k typeId, XhtmlType reqifXhtml,
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/BaselineSpecObjectType.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class BaselineSpecObjectType { private CommonSpecObjectTypeDefinitions commondefs; BaselineSpecObjectType(String32k typeId, XhtmlType reqifXhtml,
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/BaselineSpecObjectType.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class BaselineSpecObjectType { private CommonSpecObjectTypeDefinitions commondefs; BaselineSpecObjectType(String32k typeId, XhtmlType reqifXhtml,
DateType typeDate, RequirementStatus typeStatus,
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/BaselineSpecObjectType.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class BaselineSpecObjectType { private CommonSpecObjectTypeDefinitions commondefs; BaselineSpecObjectType(String32k typeId, XhtmlType reqifXhtml,
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/BaselineSpecObjectType.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class BaselineSpecObjectType { private CommonSpecObjectTypeDefinitions commondefs; BaselineSpecObjectType(String32k typeId, XhtmlType reqifXhtml,
DateType typeDate, RequirementStatus typeStatus,
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/BaselineSpecObjectType.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class BaselineSpecObjectType { private CommonSpecObjectTypeDefinitions commondefs; BaselineSpecObjectType(String32k typeId, XhtmlType reqifXhtml, DateType typeDate, RequirementStatus typeStatus,
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java // public class DateType { // private DatatypeDefinitionDate def; // // DateType() throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_Date"); // def.setLastChange(DateManager.getCurrentDate()); // } // // public DatatypeDefinitionDate getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/BaselineSpecObjectType.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.types.simple.DateType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class BaselineSpecObjectType { private CommonSpecObjectTypeDefinitions commondefs; BaselineSpecObjectType(String32k typeId, XhtmlType reqifXhtml, DateType typeDate, RequirementStatus typeStatus,
RequirementRanking typeRanking)
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/ConfigurationSpecObjectType.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class ConfigurationSpecObjectType { private CommonSpecObjectTypeDefinitions commondefs;
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/ConfigurationSpecObjectType.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class ConfigurationSpecObjectType { private CommonSpecObjectTypeDefinitions commondefs;
ConfigurationSpecObjectType(String32k typeIdDesc, XhtmlType reqifXhtml,
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/ConfigurationSpecObjectType.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class ConfigurationSpecObjectType { private CommonSpecObjectTypeDefinitions commondefs;
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/ConfigurationSpecObjectType.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class ConfigurationSpecObjectType { private CommonSpecObjectTypeDefinitions commondefs;
ConfigurationSpecObjectType(String32k typeIdDesc, XhtmlType reqifXhtml,
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/ConfigurationSpecObjectType.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class ConfigurationSpecObjectType { private CommonSpecObjectTypeDefinitions commondefs; ConfigurationSpecObjectType(String32k typeIdDesc, XhtmlType reqifXhtml,
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/ConfigurationSpecObjectType.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class ConfigurationSpecObjectType { private CommonSpecObjectTypeDefinitions commondefs; ConfigurationSpecObjectType(String32k typeIdDesc, XhtmlType reqifXhtml,
RequirementStatus typeStatus,
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/ConfigurationSpecObjectType.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class ConfigurationSpecObjectType { private CommonSpecObjectTypeDefinitions commondefs; ConfigurationSpecObjectType(String32k typeIdDesc, XhtmlType reqifXhtml, RequirementStatus typeStatus,
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java // public final class RequirementRanking { // private ReqIFEnumerationDatatype def; // // public RequirementRanking() { // def = new ReqIFEnumerationDatatype(); // def.setName("T_ReqRanking"); // // for (Enumerator ranking : RankingDTO.VALUES) { // def.addEnumValue(ranking); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def.getDef(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java // public class RequirementStatus { // private DatatypeDefinitionEnumeration def; // // public RequirementStatus() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_ReqStatus"); // // for (Enumerator status : StatusDTO.VALUES) { // EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); // enumValue.setIdentifier(IdentifierManager.generateIdentifier()); // enumValue.setLongName(status.getLiteral()); // // EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE // .createEmbeddedValue(); // embeddedValue.setKey(BigInteger.valueOf(status.getValue())); // embeddedValue.setOtherContent(""); // // enumValue.setProperties(embeddedValue); // // def.getSpecifiedValues().add(enumValue); // } // } // // public DatatypeDefinitionEnumeration getDef() { // return def; // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java // public class String32k { // private DatatypeDefinitionString def; // // String32k() { // def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("T_String"); // def.setMaxLength(new BigInteger("32000")); // } // // public DatatypeDefinitionString getDef() { // return this.def; // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/ConfigurationSpecObjectType.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.SpecObjectType; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementRanking; import de.kay_muench.reqif10.reqifcompiler.types.simple.RequirementStatus; import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public class ConfigurationSpecObjectType { private CommonSpecObjectTypeDefinitions commondefs; ConfigurationSpecObjectType(String32k typeIdDesc, XhtmlType reqifXhtml, RequirementStatus typeStatus,
RequirementRanking typeRanking)
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IDValue.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/IdentifierAttribute.java // public class IdentifierAttribute { // public static String NAME = "ID"; // private AttributeDefinitionString def; // // IdentifierAttribute(String32k type) throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName(IdentifierAttribute.NAME); // def.setType(type.getDef()); // def.setLastChange(DateManager.getCurrentDate()); // } // // IdentifierAttribute(Headline type) throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName(IdentifierAttribute.NAME); // def.setType(type.getDef()); // def.setLastChange(DateManager.getCurrentDate()); // } // // public AttributeDefinitionString getDef() { // return this.def; // } // }
import de.kay_muench.reqif10.reqifcompiler.types.complex.IdentifierAttribute; import org.eclipse.rmf.reqif10.AttributeValueString; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecElementWithAttributes;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler; class IDValue { private AttributeValueString value;
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/IdentifierAttribute.java // public class IdentifierAttribute { // public static String NAME = "ID"; // private AttributeDefinitionString def; // // IdentifierAttribute(String32k type) throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName(IdentifierAttribute.NAME); // def.setType(type.getDef()); // def.setLastChange(DateManager.getCurrentDate()); // } // // IdentifierAttribute(Headline type) throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionString(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName(IdentifierAttribute.NAME); // def.setType(type.getDef()); // def.setLastChange(DateManager.getCurrentDate()); // } // // public AttributeDefinitionString getDef() { // return this.def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IDValue.java import de.kay_muench.reqif10.reqifcompiler.types.complex.IdentifierAttribute; import org.eclipse.rmf.reqif10.AttributeValueString; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecElementWithAttributes; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler; class IDValue { private AttributeValueString value;
IDValue(final IdentifierAttribute type,
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RankingDTO.java // public final class RankingDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static RankingDTO newInstance() { // return new RankingDTO(); // } // }
import java.math.BigInteger; import org.eclipse.emf.common.util.Enumerator; import org.eclipse.rmf.reqif10.DatatypeDefinitionEnumeration; import org.eclipse.rmf.reqif10.EmbeddedValue; import org.eclipse.rmf.reqif10.EnumValue; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.RankingDTO;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.simple; final class ReqIFEnumerationDatatype { private DatatypeDefinitionEnumeration def; public ReqIFEnumerationDatatype() { def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration();
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RankingDTO.java // public final class RankingDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static RankingDTO newInstance() { // return new RankingDTO(); // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java import java.math.BigInteger; import org.eclipse.emf.common.util.Enumerator; import org.eclipse.rmf.reqif10.DatatypeDefinitionEnumeration; import org.eclipse.rmf.reqif10.EmbeddedValue; import org.eclipse.rmf.reqif10.EnumValue; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.RankingDTO; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.simple; final class ReqIFEnumerationDatatype { private DatatypeDefinitionEnumeration def; public ReqIFEnumerationDatatype() { def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration();
def.setIdentifier(IdentifierManager.generateIdentifier());
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RankingDTO.java // public final class RankingDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static RankingDTO newInstance() { // return new RankingDTO(); // } // }
import java.math.BigInteger; import org.eclipse.emf.common.util.Enumerator; import org.eclipse.rmf.reqif10.DatatypeDefinitionEnumeration; import org.eclipse.rmf.reqif10.EmbeddedValue; import org.eclipse.rmf.reqif10.EnumValue; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.RankingDTO;
} public void addEnumValue(Enumerator enumerator) { EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); enumValue.setIdentifier(IdentifierManager.generateIdentifier()); enumValue.setLongName(enumerator.getLiteral()); EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE .createEmbeddedValue(); embeddedValue.setKey(BigInteger.valueOf(enumerator.getValue())); embeddedValue.setOtherContent(""); enumValue.setProperties(embeddedValue); def.getSpecifiedValues().add(enumValue); } public DatatypeDefinitionEnumeration getDef() { return def; } } public final class RequirementRanking { private ReqIFEnumerationDatatype def; public RequirementRanking() { def = new ReqIFEnumerationDatatype(); def.setName("T_ReqRanking");
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RankingDTO.java // public final class RankingDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static RankingDTO newInstance() { // return new RankingDTO(); // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementRanking.java import java.math.BigInteger; import org.eclipse.emf.common.util.Enumerator; import org.eclipse.rmf.reqif10.DatatypeDefinitionEnumeration; import org.eclipse.rmf.reqif10.EmbeddedValue; import org.eclipse.rmf.reqif10.EnumValue; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.RankingDTO; } public void addEnumValue(Enumerator enumerator) { EnumValue enumValue = ReqIF10Factory.eINSTANCE.createEnumValue(); enumValue.setIdentifier(IdentifierManager.generateIdentifier()); enumValue.setLongName(enumerator.getLiteral()); EmbeddedValue embeddedValue = ReqIF10Factory.eINSTANCE .createEmbeddedValue(); embeddedValue.setKey(BigInteger.valueOf(enumerator.getValue())); embeddedValue.setOtherContent(""); enumValue.setProperties(embeddedValue); def.getSpecifiedValues().add(enumValue); } public DatatypeDefinitionEnumeration getDef() { return def; } } public final class RequirementRanking { private ReqIFEnumerationDatatype def; public RequirementRanking() { def = new ReqIFEnumerationDatatype(); def.setName("T_ReqRanking");
for (Enumerator ranking : RankingDTO.VALUES) {
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/Relation.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RelationTypeDTO.java // public final class RelationTypeDTO { // public static Enumerator DEFAULT; // // private Enumerator enumerator; // // public void fromEnumerator(Enumerator enumerator) { // this.enumerator = enumerator; // } // @Override // public String toString() { // return enumerator.toString(); // } // // public String name() { // return enumerator.getName(); // } // // public static RelationTypeDTO newInstance() { // return new RelationTypeDTO(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RequirementDTO.java // public final class RequirementDTO { // // private String name; // // public String getName() { // return this.name; // } // // public void setName(String name) { // this.name = name; // } // // public static RequirementDTO newInstance() { // return new RequirementDTO(); // } // // }
import de.kay_muench.reqif10.reqifcompiler.dto.RelationTypeDTO; import de.kay_muench.reqif10.reqifcompiler.dto.RequirementDTO;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler; public class Relation { private final RelationTypeDTO relationKind;
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RelationTypeDTO.java // public final class RelationTypeDTO { // public static Enumerator DEFAULT; // // private Enumerator enumerator; // // public void fromEnumerator(Enumerator enumerator) { // this.enumerator = enumerator; // } // @Override // public String toString() { // return enumerator.toString(); // } // // public String name() { // return enumerator.getName(); // } // // public static RelationTypeDTO newInstance() { // return new RelationTypeDTO(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/RequirementDTO.java // public final class RequirementDTO { // // private String name; // // public String getName() { // return this.name; // } // // public void setName(String name) { // this.name = name; // } // // public static RequirementDTO newInstance() { // return new RequirementDTO(); // } // // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/Relation.java import de.kay_muench.reqif10.reqifcompiler.dto.RelationTypeDTO; import de.kay_muench.reqif10.reqifcompiler.dto.RequirementDTO; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler; public class Relation { private final RelationTypeDTO relationKind;
private final RequirementDTO src;
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/DescriptionAttribute.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionXHTML; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public final class DescriptionAttribute { private static final String DESCRIPTION = "Description"; private AttributeDefinitionXHTML def;
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/DescriptionAttribute.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionXHTML; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public final class DescriptionAttribute { private static final String DESCRIPTION = "Description"; private AttributeDefinitionXHTML def;
DescriptionAttribute(XhtmlType type) throws DatatypeConfigurationException {
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/DescriptionAttribute.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionXHTML; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public final class DescriptionAttribute { private static final String DESCRIPTION = "Description"; private AttributeDefinitionXHTML def; DescriptionAttribute(XhtmlType type) throws DatatypeConfigurationException { def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionXHTML();
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/DescriptionAttribute.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionXHTML; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public final class DescriptionAttribute { private static final String DESCRIPTION = "Description"; private AttributeDefinitionXHTML def; DescriptionAttribute(XhtmlType type) throws DatatypeConfigurationException { def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionXHTML();
def.setIdentifier(IdentifierManager.generateIdentifier());
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/DescriptionAttribute.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionXHTML; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public final class DescriptionAttribute { private static final String DESCRIPTION = "Description"; private AttributeDefinitionXHTML def; DescriptionAttribute(XhtmlType type) throws DatatypeConfigurationException { def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionXHTML(); def.setIdentifier(IdentifierManager.generateIdentifier()); def.setLongName(DESCRIPTION); def.setType(type.getDef());
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java // public class DateManager { // private static boolean predictabilityEnabled = false; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static GregorianCalendar getCurrentDate() // throws DatatypeConfigurationException { // GregorianCalendar calendar = new GregorianCalendar(); // if (predictabilityEnabled) { // calendar.setTimeInMillis(0); // calendar.setTimeZone(TimeZone.getTimeZone("UTC")); // } else { // calendar.setTime(new Date()); // } // return calendar; // } // // public static GregorianCalendar toDate(String date) // throws DatatypeConfigurationException { // XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil // .createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date); // return xmlGregoriaCalendar.toGregorianCalendar(); // } // // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/XhtmlType.java // public class XhtmlType { // private DatatypeDefinitionXHTML def; // // public XhtmlType() { // this.def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML(); // this.def.setIdentifier(IdentifierManager.generateIdentifier()); // this.def.setLongName("T_Xhtml"); // } // // public DatatypeDefinitionXHTML getDef() { // return def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/DescriptionAttribute.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeDefinitionXHTML; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.DateManager; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.types.simple.XhtmlType; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.complex; public final class DescriptionAttribute { private static final String DESCRIPTION = "Description"; private AttributeDefinitionXHTML def; DescriptionAttribute(XhtmlType type) throws DatatypeConfigurationException { def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionXHTML(); def.setIdentifier(IdentifierManager.generateIdentifier()); def.setLongName(DESCRIPTION); def.setType(type.getDef());
def.setLastChange(DateManager.getCurrentDate());
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/StatusDTO.java // public final class StatusDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static StatusDTO newInstance() { // return new StatusDTO(); // } // // }
import java.math.BigInteger; import org.eclipse.emf.common.util.Enumerator; import org.eclipse.rmf.reqif10.DatatypeDefinitionEnumeration; import org.eclipse.rmf.reqif10.EmbeddedValue; import org.eclipse.rmf.reqif10.EnumValue; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.StatusDTO;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.simple; public class RequirementStatus { private DatatypeDefinitionEnumeration def; public RequirementStatus() { def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration();
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/StatusDTO.java // public final class StatusDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static StatusDTO newInstance() { // return new StatusDTO(); // } // // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java import java.math.BigInteger; import org.eclipse.emf.common.util.Enumerator; import org.eclipse.rmf.reqif10.DatatypeDefinitionEnumeration; import org.eclipse.rmf.reqif10.EmbeddedValue; import org.eclipse.rmf.reqif10.EnumValue; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.StatusDTO; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.simple; public class RequirementStatus { private DatatypeDefinitionEnumeration def; public RequirementStatus() { def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration();
def.setIdentifier(IdentifierManager.generateIdentifier());
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/StatusDTO.java // public final class StatusDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static StatusDTO newInstance() { // return new StatusDTO(); // } // // }
import java.math.BigInteger; import org.eclipse.emf.common.util.Enumerator; import org.eclipse.rmf.reqif10.DatatypeDefinitionEnumeration; import org.eclipse.rmf.reqif10.EmbeddedValue; import org.eclipse.rmf.reqif10.EnumValue; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.StatusDTO;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.simple; public class RequirementStatus { private DatatypeDefinitionEnumeration def; public RequirementStatus() { def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); def.setIdentifier(IdentifierManager.generateIdentifier()); def.setLongName("T_ReqStatus");
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/dto/StatusDTO.java // public final class StatusDTO extends EnumeratorDTO { // // public static Integer DEFAULT = 0; // public static List<? extends Enumerator> VALUES; // // public static StatusDTO newInstance() { // return new StatusDTO(); // } // // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/RequirementStatus.java import java.math.BigInteger; import org.eclipse.emf.common.util.Enumerator; import org.eclipse.rmf.reqif10.DatatypeDefinitionEnumeration; import org.eclipse.rmf.reqif10.EmbeddedValue; import org.eclipse.rmf.reqif10.EnumValue; import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import de.kay_muench.reqif10.reqifcompiler.dto.StatusDTO; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.simple; public class RequirementStatus { private DatatypeDefinitionEnumeration def; public RequirementStatus() { def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionEnumeration(); def.setIdentifier(IdentifierManager.generateIdentifier()); def.setLongName("T_ReqStatus");
for (Enumerator status : StatusDTO.VALUES) {
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/Headline.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/HeadlineType.java // public class HeadlineType { // private SpecObjectType def; // private IdentifierAttribute id; // // HeadlineType(Headline typeIdDesc) // throws DatatypeConfigurationException { // id = new IdentifierAttribute(typeIdDesc); // // def = ReqIF10Factory.eINSTANCE.createSpecObjectType(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("HeadlineType"); // def.getSpecAttributes().add(id.getDef()); // } // // public IdentifierAttribute getId() { // return id; // } // // public SpecObjectType getDef() { // return def; // } // }
import de.kay_muench.reqif10.reqifcompiler.types.complex.HeadlineType; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecObject;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler; class Headline { private IDValue attributeValueID; private SpecObject specObject;
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/HeadlineType.java // public class HeadlineType { // private SpecObjectType def; // private IdentifierAttribute id; // // HeadlineType(Headline typeIdDesc) // throws DatatypeConfigurationException { // id = new IdentifierAttribute(typeIdDesc); // // def = ReqIF10Factory.eINSTANCE.createSpecObjectType(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName("HeadlineType"); // def.getSpecAttributes().add(id.getDef()); // } // // public IdentifierAttribute getId() { // return id; // } // // public SpecObjectType getDef() { // return def; // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/Headline.java import de.kay_muench.reqif10.reqifcompiler.types.complex.HeadlineType; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecObject; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler; class Headline { private IDValue attributeValueID; private SpecObject specObject;
Headline(final HeadlineType type, final String id) {
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // }
import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import java.math.BigInteger; import org.eclipse.rmf.reqif10.DatatypeDefinitionString;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.simple; public class String32k { private DatatypeDefinitionString def; String32k() { def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString();
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java // public final class IdentifierManager { // private static boolean predictabilityEnabled = false; // private static long predictableId = 1L; // // public static void enablePredictableId() { // predictabilityEnabled = true; // } // // public static String generateIdentifier() { // if (predictabilityEnabled) { // predictableId += 1L; // return "" + predictableId; // } // return "requie-tool-" + UUID.randomUUID().toString(); // } // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java import org.eclipse.rmf.reqif10.ReqIF10Factory; import de.kay_muench.reqif10.reqifcompiler.IdentifierManager; import java.math.BigInteger; import org.eclipse.rmf.reqif10.DatatypeDefinitionString; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler.types.simple; public class String32k { private DatatypeDefinitionString def; String32k() { def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString();
def.setIdentifier(IdentifierManager.generateIdentifier());
KayErikMuench/reqiftools
reqifiterator/src/test/java/de/kay_muench/reqif10/reqifiterator/ReqIF10IteratorTest.java
// Path: reqifparser/src/main/java/de/kay_muench/reqif10/reqifparser/ReqIF10Parser.java // public final class ReqIF10Parser { // private String reqIFFilename; // private List<String> diagnostics = new ArrayList<String>(); // private boolean removeToolExtensions = false; // private boolean removeTemporaries = true; // // public ReqIF parseReqIFContent() { // String wkFile = this.getReqIFFilename(); // if (isRemoveToolExtensions()) { // ToolExRemover remover = new ToolExRemover(); // remover.setDeleteOnExit(this.isRemoveTemporaries()); // wkFile = remover.remove(this.getReqIFFilename()); // } // // registerEPackageStd(); // ReqIF reqif = this.parse(wkFile); // return reqif; // } // // public String getReqIFFilename() { // return reqIFFilename; // } // // public void setReqIFFilename(String filename) { // if (filename != null) { // reqIFFilename = filename; // } // } // // public boolean isRemoveToolExtensions() { // return removeToolExtensions; // } // // public void setRemoveToolExtensions(boolean removeToolExtensions) { // this.removeToolExtensions = removeToolExtensions; // } // // public boolean isRemoveTemporaries() { // return removeTemporaries; // } // // public void setRemoveTemporaries(boolean removeTemporaries) { // this.removeTemporaries = removeTemporaries; // } // // private ReqIF parse(final String fileName) { // try { // URI uri = URI.createFileURI(fileName); // ResourceFactoryImpl resourceFactory = new XMLPersistenceMappingResourceFactoryImpl(); // XMLResource resource = (XMLResource) resourceFactory // .createResource(uri); // Map<?, ?> options = null; // resource.load(options); // // this.getDiagnostics().clear(); // for (Diagnostic d : resource.getErrors()) { // this.getDiagnostics().add("ERROR " + d.getLocation() + " " // + d.getLine() + " " + d.getMessage()); // } // for (Diagnostic d : resource.getWarnings()) { // this.getDiagnostics().add("WARNING " + d.getLocation() + " " // + d.getLine() + " " + d.getMessage()); // } // // ResourceSet resourceSet = new XMLPersistenceMappingResourceSetImpl(); // resourceSet.getResources().add(resource); // // EList<EObject> rootObjects = resource.getContents(); // if (rootObjects.isEmpty()) { // throw new RuntimeException("The resource parsed from '" // + uri.toString() + "' seems to be empty."); // } // ReqIF reqif = (ReqIF) rootObjects.get(0); // // return reqif; // // } catch (Exception e) { // throw new RuntimeException("Parsing '" + fileName + "' failed.", // e.getCause()); // } // } // // private final void registerEPackageStd() { // EPackage.Registry.INSTANCE.clear(); // EPackage.Registry.INSTANCE.put(ReqIF10Package.eNS_URI, // ReqIF10Package.eINSTANCE); // EPackage.Registry.INSTANCE.put(XhtmlPackage.eNS_URI, // XhtmlPackage.eINSTANCE); // EPackage.Registry.INSTANCE.put(DatatypesPackage.eNS_URI, // DatatypesPackage.eINSTANCE); // EPackage.Registry.INSTANCE.put(XMLNamespacePackage.eNS_URI, // XMLNamespacePackage.eINSTANCE); // } // // public List<String> getDiagnostics() { // return diagnostics; // } // }
import de.kay_muench.reqif10.reqifparser.ReqIF10Parser; import static org.junit.Assert.assertEquals; import java.util.ArrayList; import java.util.List; import org.apache.log4j.ConsoleAppender; import org.apache.log4j.Logger; import org.apache.log4j.PatternLayout; import org.eclipse.emf.common.util.EList; import org.eclipse.rmf.reqif10.AttributeDefinition; import org.eclipse.rmf.reqif10.AttributeValue; import org.eclipse.rmf.reqif10.ReqIF; import org.eclipse.rmf.reqif10.SpecRelation; import org.eclipse.rmf.reqif10.Specification; import org.eclipse.rmf.reqif10.common.util.ReqIF10Util; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test;
return title; } public void setLongName(String longName) { this.longName = longName; } public void setTitle(String title) { this.title = title; } } ReqIF reqif; @BeforeClass public static void setUpBeforeClass() { ConsoleAppender appender = new ConsoleAppender(); appender.setName("testappender"); appender.setLayout(new PatternLayout("%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}]: %m%n")); appender.setTarget(ConsoleAppender.SYSTEM_OUT); appender.activateOptions(); Logger.getLogger("testlogger").addAppender(appender); } @Before public void setUp() throws Exception {
// Path: reqifparser/src/main/java/de/kay_muench/reqif10/reqifparser/ReqIF10Parser.java // public final class ReqIF10Parser { // private String reqIFFilename; // private List<String> diagnostics = new ArrayList<String>(); // private boolean removeToolExtensions = false; // private boolean removeTemporaries = true; // // public ReqIF parseReqIFContent() { // String wkFile = this.getReqIFFilename(); // if (isRemoveToolExtensions()) { // ToolExRemover remover = new ToolExRemover(); // remover.setDeleteOnExit(this.isRemoveTemporaries()); // wkFile = remover.remove(this.getReqIFFilename()); // } // // registerEPackageStd(); // ReqIF reqif = this.parse(wkFile); // return reqif; // } // // public String getReqIFFilename() { // return reqIFFilename; // } // // public void setReqIFFilename(String filename) { // if (filename != null) { // reqIFFilename = filename; // } // } // // public boolean isRemoveToolExtensions() { // return removeToolExtensions; // } // // public void setRemoveToolExtensions(boolean removeToolExtensions) { // this.removeToolExtensions = removeToolExtensions; // } // // public boolean isRemoveTemporaries() { // return removeTemporaries; // } // // public void setRemoveTemporaries(boolean removeTemporaries) { // this.removeTemporaries = removeTemporaries; // } // // private ReqIF parse(final String fileName) { // try { // URI uri = URI.createFileURI(fileName); // ResourceFactoryImpl resourceFactory = new XMLPersistenceMappingResourceFactoryImpl(); // XMLResource resource = (XMLResource) resourceFactory // .createResource(uri); // Map<?, ?> options = null; // resource.load(options); // // this.getDiagnostics().clear(); // for (Diagnostic d : resource.getErrors()) { // this.getDiagnostics().add("ERROR " + d.getLocation() + " " // + d.getLine() + " " + d.getMessage()); // } // for (Diagnostic d : resource.getWarnings()) { // this.getDiagnostics().add("WARNING " + d.getLocation() + " " // + d.getLine() + " " + d.getMessage()); // } // // ResourceSet resourceSet = new XMLPersistenceMappingResourceSetImpl(); // resourceSet.getResources().add(resource); // // EList<EObject> rootObjects = resource.getContents(); // if (rootObjects.isEmpty()) { // throw new RuntimeException("The resource parsed from '" // + uri.toString() + "' seems to be empty."); // } // ReqIF reqif = (ReqIF) rootObjects.get(0); // // return reqif; // // } catch (Exception e) { // throw new RuntimeException("Parsing '" + fileName + "' failed.", // e.getCause()); // } // } // // private final void registerEPackageStd() { // EPackage.Registry.INSTANCE.clear(); // EPackage.Registry.INSTANCE.put(ReqIF10Package.eNS_URI, // ReqIF10Package.eINSTANCE); // EPackage.Registry.INSTANCE.put(XhtmlPackage.eNS_URI, // XhtmlPackage.eINSTANCE); // EPackage.Registry.INSTANCE.put(DatatypesPackage.eNS_URI, // DatatypesPackage.eINSTANCE); // EPackage.Registry.INSTANCE.put(XMLNamespacePackage.eNS_URI, // XMLNamespacePackage.eINSTANCE); // } // // public List<String> getDiagnostics() { // return diagnostics; // } // } // Path: reqifiterator/src/test/java/de/kay_muench/reqif10/reqifiterator/ReqIF10IteratorTest.java import de.kay_muench.reqif10.reqifparser.ReqIF10Parser; import static org.junit.Assert.assertEquals; import java.util.ArrayList; import java.util.List; import org.apache.log4j.ConsoleAppender; import org.apache.log4j.Logger; import org.apache.log4j.PatternLayout; import org.eclipse.emf.common.util.EList; import org.eclipse.rmf.reqif10.AttributeDefinition; import org.eclipse.rmf.reqif10.AttributeValue; import org.eclipse.rmf.reqif10.ReqIF; import org.eclipse.rmf.reqif10.SpecRelation; import org.eclipse.rmf.reqif10.Specification; import org.eclipse.rmf.reqif10.common.util.ReqIF10Util; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; return title; } public void setLongName(String longName) { this.longName = longName; } public void setTitle(String title) { this.title = title; } } ReqIF reqif; @BeforeClass public static void setUpBeforeClass() { ConsoleAppender appender = new ConsoleAppender(); appender.setName("testappender"); appender.setLayout(new PatternLayout("%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}]: %m%n")); appender.setTarget(ConsoleAppender.SYSTEM_OUT); appender.activateOptions(); Logger.getLogger("testlogger").addAppender(appender); } @Before public void setUp() throws Exception {
ReqIF10Parser parser = new ReqIF10Parser();
KayErikMuench/reqiftools
reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateValue.java
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/ScheduledByAttribute.java // public class ScheduledByAttribute { // private static final String SCHEDULEDBY = "Scheduled by"; // private AttributeDefinitionDate def; // // ScheduledByAttribute(DateType type) // throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName(SCHEDULEDBY); // def.setType(type.getDef()); // def.setLastChange(DateManager.getCurrentDate()); // } // // public AttributeDefinitionDate getDef() { // return def; // } // // }
import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeValueDate; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecObject; import de.kay_muench.reqif10.reqifcompiler.types.complex.ScheduledByAttribute;
/** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler; class DateValue { private AttributeValueDate value;
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/ScheduledByAttribute.java // public class ScheduledByAttribute { // private static final String SCHEDULEDBY = "Scheduled by"; // private AttributeDefinitionDate def; // // ScheduledByAttribute(DateType type) // throws DatatypeConfigurationException { // def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionDate(); // def.setIdentifier(IdentifierManager.generateIdentifier()); // def.setLongName(SCHEDULEDBY); // def.setType(type.getDef()); // def.setLastChange(DateManager.getCurrentDate()); // } // // public AttributeDefinitionDate getDef() { // return def; // } // // } // Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateValue.java import javax.xml.datatype.DatatypeConfigurationException; import org.eclipse.rmf.reqif10.AttributeValueDate; import org.eclipse.rmf.reqif10.ReqIF10Factory; import org.eclipse.rmf.reqif10.SpecObject; import de.kay_muench.reqif10.reqifcompiler.types.complex.ScheduledByAttribute; /** * Copyright (c) 2014 Kay Erik Münch. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.spdx.org/licenses/EPL-1.0 * * Contributors: * Kay Erik Münch - initial API and implementation * */ package de.kay_muench.reqif10.reqifcompiler; class DateValue { private AttributeValueDate value;
DateValue(final ScheduledByAttribute type,
JosuaKrause/NBTEditor
src/nbt/record/NBTHandler.java
// Path: src/nbt/read/NBTReader.java // public class NBTReader extends PushBackReader { // // /** // * Creates a reader for a nbt file. // * // * @param file The nbt file. // * @throws IOException I/O Exception. // */ // public NBTReader(final File file) throws IOException { // this(file, true); // } // // /** // * Creates a reader for a maybe zipped nbt file. // * // * @param file The nbt file. // * @param wrapZip Whether the file is zipped or not. // * @throws IOException I/O Exception. // */ // public NBTReader(final File file, final boolean wrapZip) throws IOException { // this(new BufferedInputStream(new FileInputStream(file)), wrapZip); // } // // /** // * Creates a reader for a maybe zipped nbt stream. // * // * @param is The input stream. // * @param wrapZip Whether the file is zipped or not. // * @throws IOException I/O Exception. // */ // public NBTReader(final InputStream is, final boolean wrapZip) // throws IOException { // super(wrapZip ? new GZIPInputStream(is) : is); // } // // /** // * Reads the nbt stream. // * // * @param exp Expected type, {@code null} for no check. // * @param <T> The type. // * @return The root record. // * @throws IOException I/O Exception. // */ // @SuppressWarnings("unchecked") // public <T extends NBTRecord> T read(final NBTType exp) throws IOException { // final NBTRecord read = NBTType.readRecord(this); // if(exp != null && read.getType() != exp) throw new IllegalStateException( // "Expected: " + exp + " Got: " + read.getType()); // return (T) read; // } // // } // // Path: src/nbt/write/NBTWriter.java // public class NBTWriter extends ByteWriter { // // /** // * Creates a writer for a zipped nbt file. // * // * @param file The output file. // * @throws IOException I/O Exception. // */ // public NBTWriter(final File file) throws IOException { // this(file, true); // } // // /** // * Creates a writer for a maybe zipped nbt file. // * // * @param file The output file. // * @param wrapZip Whether the file is zipped or not. // * @throws IOException I/O Exception. // */ // public NBTWriter(final File file, final boolean wrapZip) throws IOException { // this(new BufferedOutputStream(new FileOutputStream(file)), wrapZip); // } // // /** // * Creates a writer for a maybe zipped nbt stream. // * // * @param out The output stream. // * @param wrapZip Whether the file is zipped or not. // * @throws IOException I/O Exception. // */ // public NBTWriter(final OutputStream out, final boolean wrapZip) // throws IOException { // super(wrapZip ? new GZIPOutputStream(out) : out); // } // // /** // * Writes the nbt content. // * // * @param record The root element. // * @throws IOException I/O Exception. // */ // public void write(final NBTRecord record) throws IOException { // record.write(this); // } // // }
import java.io.File; import java.io.IOException; import nbt.read.NBTReader; import nbt.write.NBTWriter;
package nbt.record; /** * Handles the loading and saving of nbt files. * * @author Joschi <josua.krause@googlemail.com> */ public class NBTHandler { private final File nbtFile; private final boolean wrapZip; private final NBTCompound root; /** * Creates a nbt handler. * * @param nbtFile The nbt file. * @param wrapZip Whether this file is zipped. * @throws IOException I/O Exception. */ public NBTHandler(final File nbtFile, final boolean wrapZip) throws IOException { this.nbtFile = nbtFile; this.wrapZip = wrapZip;
// Path: src/nbt/read/NBTReader.java // public class NBTReader extends PushBackReader { // // /** // * Creates a reader for a nbt file. // * // * @param file The nbt file. // * @throws IOException I/O Exception. // */ // public NBTReader(final File file) throws IOException { // this(file, true); // } // // /** // * Creates a reader for a maybe zipped nbt file. // * // * @param file The nbt file. // * @param wrapZip Whether the file is zipped or not. // * @throws IOException I/O Exception. // */ // public NBTReader(final File file, final boolean wrapZip) throws IOException { // this(new BufferedInputStream(new FileInputStream(file)), wrapZip); // } // // /** // * Creates a reader for a maybe zipped nbt stream. // * // * @param is The input stream. // * @param wrapZip Whether the file is zipped or not. // * @throws IOException I/O Exception. // */ // public NBTReader(final InputStream is, final boolean wrapZip) // throws IOException { // super(wrapZip ? new GZIPInputStream(is) : is); // } // // /** // * Reads the nbt stream. // * // * @param exp Expected type, {@code null} for no check. // * @param <T> The type. // * @return The root record. // * @throws IOException I/O Exception. // */ // @SuppressWarnings("unchecked") // public <T extends NBTRecord> T read(final NBTType exp) throws IOException { // final NBTRecord read = NBTType.readRecord(this); // if(exp != null && read.getType() != exp) throw new IllegalStateException( // "Expected: " + exp + " Got: " + read.getType()); // return (T) read; // } // // } // // Path: src/nbt/write/NBTWriter.java // public class NBTWriter extends ByteWriter { // // /** // * Creates a writer for a zipped nbt file. // * // * @param file The output file. // * @throws IOException I/O Exception. // */ // public NBTWriter(final File file) throws IOException { // this(file, true); // } // // /** // * Creates a writer for a maybe zipped nbt file. // * // * @param file The output file. // * @param wrapZip Whether the file is zipped or not. // * @throws IOException I/O Exception. // */ // public NBTWriter(final File file, final boolean wrapZip) throws IOException { // this(new BufferedOutputStream(new FileOutputStream(file)), wrapZip); // } // // /** // * Creates a writer for a maybe zipped nbt stream. // * // * @param out The output stream. // * @param wrapZip Whether the file is zipped or not. // * @throws IOException I/O Exception. // */ // public NBTWriter(final OutputStream out, final boolean wrapZip) // throws IOException { // super(wrapZip ? new GZIPOutputStream(out) : out); // } // // /** // * Writes the nbt content. // * // * @param record The root element. // * @throws IOException I/O Exception. // */ // public void write(final NBTRecord record) throws IOException { // record.write(this); // } // // } // Path: src/nbt/record/NBTHandler.java import java.io.File; import java.io.IOException; import nbt.read.NBTReader; import nbt.write.NBTWriter; package nbt.record; /** * Handles the loading and saving of nbt files. * * @author Joschi <josua.krause@googlemail.com> */ public class NBTHandler { private final File nbtFile; private final boolean wrapZip; private final NBTCompound root; /** * Creates a nbt handler. * * @param nbtFile The nbt file. * @param wrapZip Whether this file is zipped. * @throws IOException I/O Exception. */ public NBTHandler(final File nbtFile, final boolean wrapZip) throws IOException { this.nbtFile = nbtFile; this.wrapZip = wrapZip;
root = new NBTReader(nbtFile).read(NBTType.COMPOUND);
JosuaKrause/NBTEditor
src/nbt/record/NBTHandler.java
// Path: src/nbt/read/NBTReader.java // public class NBTReader extends PushBackReader { // // /** // * Creates a reader for a nbt file. // * // * @param file The nbt file. // * @throws IOException I/O Exception. // */ // public NBTReader(final File file) throws IOException { // this(file, true); // } // // /** // * Creates a reader for a maybe zipped nbt file. // * // * @param file The nbt file. // * @param wrapZip Whether the file is zipped or not. // * @throws IOException I/O Exception. // */ // public NBTReader(final File file, final boolean wrapZip) throws IOException { // this(new BufferedInputStream(new FileInputStream(file)), wrapZip); // } // // /** // * Creates a reader for a maybe zipped nbt stream. // * // * @param is The input stream. // * @param wrapZip Whether the file is zipped or not. // * @throws IOException I/O Exception. // */ // public NBTReader(final InputStream is, final boolean wrapZip) // throws IOException { // super(wrapZip ? new GZIPInputStream(is) : is); // } // // /** // * Reads the nbt stream. // * // * @param exp Expected type, {@code null} for no check. // * @param <T> The type. // * @return The root record. // * @throws IOException I/O Exception. // */ // @SuppressWarnings("unchecked") // public <T extends NBTRecord> T read(final NBTType exp) throws IOException { // final NBTRecord read = NBTType.readRecord(this); // if(exp != null && read.getType() != exp) throw new IllegalStateException( // "Expected: " + exp + " Got: " + read.getType()); // return (T) read; // } // // } // // Path: src/nbt/write/NBTWriter.java // public class NBTWriter extends ByteWriter { // // /** // * Creates a writer for a zipped nbt file. // * // * @param file The output file. // * @throws IOException I/O Exception. // */ // public NBTWriter(final File file) throws IOException { // this(file, true); // } // // /** // * Creates a writer for a maybe zipped nbt file. // * // * @param file The output file. // * @param wrapZip Whether the file is zipped or not. // * @throws IOException I/O Exception. // */ // public NBTWriter(final File file, final boolean wrapZip) throws IOException { // this(new BufferedOutputStream(new FileOutputStream(file)), wrapZip); // } // // /** // * Creates a writer for a maybe zipped nbt stream. // * // * @param out The output stream. // * @param wrapZip Whether the file is zipped or not. // * @throws IOException I/O Exception. // */ // public NBTWriter(final OutputStream out, final boolean wrapZip) // throws IOException { // super(wrapZip ? new GZIPOutputStream(out) : out); // } // // /** // * Writes the nbt content. // * // * @param record The root element. // * @throws IOException I/O Exception. // */ // public void write(final NBTRecord record) throws IOException { // record.write(this); // } // // }
import java.io.File; import java.io.IOException; import nbt.read.NBTReader; import nbt.write.NBTWriter;
package nbt.record; /** * Handles the loading and saving of nbt files. * * @author Joschi <josua.krause@googlemail.com> */ public class NBTHandler { private final File nbtFile; private final boolean wrapZip; private final NBTCompound root; /** * Creates a nbt handler. * * @param nbtFile The nbt file. * @param wrapZip Whether this file is zipped. * @throws IOException I/O Exception. */ public NBTHandler(final File nbtFile, final boolean wrapZip) throws IOException { this.nbtFile = nbtFile; this.wrapZip = wrapZip; root = new NBTReader(nbtFile).read(NBTType.COMPOUND); } /** * Constructs a filter handler. * * @param handler The handler to filter. */ public NBTHandler(final NBTHandler handler) { nbtFile = handler.nbtFile; wrapZip = handler.wrapZip; root = handler.root; } /** * Creates a nbt handler. * * @param nbtFile The nbt file. * @throws IOException I/O Exception. */ public NBTHandler(final File nbtFile) throws IOException { this(nbtFile, true); } /** * Saves the nbt file if it has been changed. * * @throws IOException I/O Exception. */ public void save() throws IOException { if(!root.hasChanged()) return;
// Path: src/nbt/read/NBTReader.java // public class NBTReader extends PushBackReader { // // /** // * Creates a reader for a nbt file. // * // * @param file The nbt file. // * @throws IOException I/O Exception. // */ // public NBTReader(final File file) throws IOException { // this(file, true); // } // // /** // * Creates a reader for a maybe zipped nbt file. // * // * @param file The nbt file. // * @param wrapZip Whether the file is zipped or not. // * @throws IOException I/O Exception. // */ // public NBTReader(final File file, final boolean wrapZip) throws IOException { // this(new BufferedInputStream(new FileInputStream(file)), wrapZip); // } // // /** // * Creates a reader for a maybe zipped nbt stream. // * // * @param is The input stream. // * @param wrapZip Whether the file is zipped or not. // * @throws IOException I/O Exception. // */ // public NBTReader(final InputStream is, final boolean wrapZip) // throws IOException { // super(wrapZip ? new GZIPInputStream(is) : is); // } // // /** // * Reads the nbt stream. // * // * @param exp Expected type, {@code null} for no check. // * @param <T> The type. // * @return The root record. // * @throws IOException I/O Exception. // */ // @SuppressWarnings("unchecked") // public <T extends NBTRecord> T read(final NBTType exp) throws IOException { // final NBTRecord read = NBTType.readRecord(this); // if(exp != null && read.getType() != exp) throw new IllegalStateException( // "Expected: " + exp + " Got: " + read.getType()); // return (T) read; // } // // } // // Path: src/nbt/write/NBTWriter.java // public class NBTWriter extends ByteWriter { // // /** // * Creates a writer for a zipped nbt file. // * // * @param file The output file. // * @throws IOException I/O Exception. // */ // public NBTWriter(final File file) throws IOException { // this(file, true); // } // // /** // * Creates a writer for a maybe zipped nbt file. // * // * @param file The output file. // * @param wrapZip Whether the file is zipped or not. // * @throws IOException I/O Exception. // */ // public NBTWriter(final File file, final boolean wrapZip) throws IOException { // this(new BufferedOutputStream(new FileOutputStream(file)), wrapZip); // } // // /** // * Creates a writer for a maybe zipped nbt stream. // * // * @param out The output stream. // * @param wrapZip Whether the file is zipped or not. // * @throws IOException I/O Exception. // */ // public NBTWriter(final OutputStream out, final boolean wrapZip) // throws IOException { // super(wrapZip ? new GZIPOutputStream(out) : out); // } // // /** // * Writes the nbt content. // * // * @param record The root element. // * @throws IOException I/O Exception. // */ // public void write(final NBTRecord record) throws IOException { // record.write(this); // } // // } // Path: src/nbt/record/NBTHandler.java import java.io.File; import java.io.IOException; import nbt.read.NBTReader; import nbt.write.NBTWriter; package nbt.record; /** * Handles the loading and saving of nbt files. * * @author Joschi <josua.krause@googlemail.com> */ public class NBTHandler { private final File nbtFile; private final boolean wrapZip; private final NBTCompound root; /** * Creates a nbt handler. * * @param nbtFile The nbt file. * @param wrapZip Whether this file is zipped. * @throws IOException I/O Exception. */ public NBTHandler(final File nbtFile, final boolean wrapZip) throws IOException { this.nbtFile = nbtFile; this.wrapZip = wrapZip; root = new NBTReader(nbtFile).read(NBTType.COMPOUND); } /** * Constructs a filter handler. * * @param handler The handler to filter. */ public NBTHandler(final NBTHandler handler) { nbtFile = handler.nbtFile; wrapZip = handler.wrapZip; root = handler.root; } /** * Creates a nbt handler. * * @param nbtFile The nbt file. * @throws IOException I/O Exception. */ public NBTHandler(final File nbtFile) throws IOException { this(nbtFile, true); } /** * Saves the nbt file if it has been changed. * * @throws IOException I/O Exception. */ public void save() throws IOException { if(!root.hasChanged()) return;
final NBTWriter out = new NBTWriter(nbtFile, wrapZip);
JosuaKrause/NBTEditor
src/nbt/record/NBTIntArray.java
// Path: src/nbt/write/ByteWriter.java // public class ByteWriter implements Closeable { // // /** // * The utf-8 charset. // */ // public static final Charset UTF8 = Charset.forName("UTF-8"); // // private OutputStream out; // // /** // * Creates a byte writer for an output stream. // * // * @param out The output stream. // */ // public ByteWriter(final OutputStream out) { // this.out = out; // } // // /** // * Writes a single byte. // * // * @param b The byte. // * @throws IOException I/O Exception. // */ // public final void write(final byte b) throws IOException { // out.write(b); // } // // /** // * Writes a short. // * // * @param s The short. // * @throws IOException I/O Exception. // */ // public final void write(final short s) throws IOException { // writeBigEndian(s, 2); // } // // /** // * Writes an integer. // * // * @param i The integer. // * @throws IOException I/O Exception. // */ // public final void write(final int i) throws IOException { // writeBigEndian(i, 4); // } // // /** // * Writes a long. // * // * @param l The long. // * @throws IOException I/O Exception. // */ // public final void write(final long l) throws IOException { // writeBigEndian(l, 8); // } // // /** // * Writes a float. // * // * @param f The float. // * @throws IOException I/O Exception. // */ // public final void write(final float f) throws IOException { // write(Float.floatToIntBits(f)); // } // // /** // * Writes a double. // * // * @param f The double. // * @throws IOException I/O Exception. // */ // public final void write(final double f) throws IOException { // write(Double.doubleToLongBits(f)); // } // // /** // * Writes a byte array. Note that this is <em>not</em> equivalent to // * successive {@link #write(byte)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final byte[] arr) throws IOException { // write(arr.length); // out.write(arr); // } // // /** // * Writes an integer array. Note that this is <em>not</em> equivalent to // * successive {@link #write(int)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final int[] arr) throws IOException { // write(arr.length); // for(final int i : arr) { // write(i); // } // } // // /** // * Writes a string. // * // * @param str The string. // * @throws IOException I/O Exception. // */ // public final void write(final String str) throws IOException { // final byte[] arr = str.getBytes(UTF8); // write((short) arr.length); // out.write(arr); // } // // private void writeBigEndian(final long bytes, final int count) // throws IOException { // long lb = bytes; // final byte[] b = new byte[count]; // int i = count; // while(--i >= 0) { // b[i] = (byte) lb; // lb >>>= 8; // } // out.write(b); // } // // @Override // public void close() throws IOException { // if(out != null) { // final OutputStream t = out; // out = null; // t.close(); // } // } // // @Override // protected void finalize() throws Throwable { // close(); // super.finalize(); // } // // }
import java.io.IOException; import java.text.ParseException; import nbt.write.ByteWriter;
final char h1 = str.charAt(i * 8 + 1); final char h2 = str.charAt(i * 8 + 2); final char h3 = str.charAt(i * 8 + 3); final char h4 = str.charAt(i * 8 + 4); final char h5 = str.charAt(i * 8 + 5); final char h6 = str.charAt(i * 8 + 6); final char h7 = str.charAt(i * 8 + 7); try { final int n = Integer.parseInt("" + h0 + h1 + h2 + h3 + h4 + h5 + h6 + h7, 16); arr[i] = n; } catch(final NumberFormatException e) { throw new ParseException("illegal characters " + h0 + h1 + h2 + h3 + h4 + h5 + h6 + h7, i * 8); } } setArray(arr); } @Override public boolean hasSize() { return true; } @Override public int size() { return getLength(); } @Override
// Path: src/nbt/write/ByteWriter.java // public class ByteWriter implements Closeable { // // /** // * The utf-8 charset. // */ // public static final Charset UTF8 = Charset.forName("UTF-8"); // // private OutputStream out; // // /** // * Creates a byte writer for an output stream. // * // * @param out The output stream. // */ // public ByteWriter(final OutputStream out) { // this.out = out; // } // // /** // * Writes a single byte. // * // * @param b The byte. // * @throws IOException I/O Exception. // */ // public final void write(final byte b) throws IOException { // out.write(b); // } // // /** // * Writes a short. // * // * @param s The short. // * @throws IOException I/O Exception. // */ // public final void write(final short s) throws IOException { // writeBigEndian(s, 2); // } // // /** // * Writes an integer. // * // * @param i The integer. // * @throws IOException I/O Exception. // */ // public final void write(final int i) throws IOException { // writeBigEndian(i, 4); // } // // /** // * Writes a long. // * // * @param l The long. // * @throws IOException I/O Exception. // */ // public final void write(final long l) throws IOException { // writeBigEndian(l, 8); // } // // /** // * Writes a float. // * // * @param f The float. // * @throws IOException I/O Exception. // */ // public final void write(final float f) throws IOException { // write(Float.floatToIntBits(f)); // } // // /** // * Writes a double. // * // * @param f The double. // * @throws IOException I/O Exception. // */ // public final void write(final double f) throws IOException { // write(Double.doubleToLongBits(f)); // } // // /** // * Writes a byte array. Note that this is <em>not</em> equivalent to // * successive {@link #write(byte)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final byte[] arr) throws IOException { // write(arr.length); // out.write(arr); // } // // /** // * Writes an integer array. Note that this is <em>not</em> equivalent to // * successive {@link #write(int)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final int[] arr) throws IOException { // write(arr.length); // for(final int i : arr) { // write(i); // } // } // // /** // * Writes a string. // * // * @param str The string. // * @throws IOException I/O Exception. // */ // public final void write(final String str) throws IOException { // final byte[] arr = str.getBytes(UTF8); // write((short) arr.length); // out.write(arr); // } // // private void writeBigEndian(final long bytes, final int count) // throws IOException { // long lb = bytes; // final byte[] b = new byte[count]; // int i = count; // while(--i >= 0) { // b[i] = (byte) lb; // lb >>>= 8; // } // out.write(b); // } // // @Override // public void close() throws IOException { // if(out != null) { // final OutputStream t = out; // out = null; // t.close(); // } // } // // @Override // protected void finalize() throws Throwable { // close(); // super.finalize(); // } // // } // Path: src/nbt/record/NBTIntArray.java import java.io.IOException; import java.text.ParseException; import nbt.write.ByteWriter; final char h1 = str.charAt(i * 8 + 1); final char h2 = str.charAt(i * 8 + 2); final char h3 = str.charAt(i * 8 + 3); final char h4 = str.charAt(i * 8 + 4); final char h5 = str.charAt(i * 8 + 5); final char h6 = str.charAt(i * 8 + 6); final char h7 = str.charAt(i * 8 + 7); try { final int n = Integer.parseInt("" + h0 + h1 + h2 + h3 + h4 + h5 + h6 + h7, 16); arr[i] = n; } catch(final NumberFormatException e) { throw new ParseException("illegal characters " + h0 + h1 + h2 + h3 + h4 + h5 + h6 + h7, i * 8); } } setArray(arr); } @Override public boolean hasSize() { return true; } @Override public int size() { return getLength(); } @Override
public void writePayload(final ByteWriter out) throws IOException {
JosuaKrause/NBTEditor
src/nbt/record/NBTEnd.java
// Path: src/nbt/write/ByteWriter.java // public class ByteWriter implements Closeable { // // /** // * The utf-8 charset. // */ // public static final Charset UTF8 = Charset.forName("UTF-8"); // // private OutputStream out; // // /** // * Creates a byte writer for an output stream. // * // * @param out The output stream. // */ // public ByteWriter(final OutputStream out) { // this.out = out; // } // // /** // * Writes a single byte. // * // * @param b The byte. // * @throws IOException I/O Exception. // */ // public final void write(final byte b) throws IOException { // out.write(b); // } // // /** // * Writes a short. // * // * @param s The short. // * @throws IOException I/O Exception. // */ // public final void write(final short s) throws IOException { // writeBigEndian(s, 2); // } // // /** // * Writes an integer. // * // * @param i The integer. // * @throws IOException I/O Exception. // */ // public final void write(final int i) throws IOException { // writeBigEndian(i, 4); // } // // /** // * Writes a long. // * // * @param l The long. // * @throws IOException I/O Exception. // */ // public final void write(final long l) throws IOException { // writeBigEndian(l, 8); // } // // /** // * Writes a float. // * // * @param f The float. // * @throws IOException I/O Exception. // */ // public final void write(final float f) throws IOException { // write(Float.floatToIntBits(f)); // } // // /** // * Writes a double. // * // * @param f The double. // * @throws IOException I/O Exception. // */ // public final void write(final double f) throws IOException { // write(Double.doubleToLongBits(f)); // } // // /** // * Writes a byte array. Note that this is <em>not</em> equivalent to // * successive {@link #write(byte)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final byte[] arr) throws IOException { // write(arr.length); // out.write(arr); // } // // /** // * Writes an integer array. Note that this is <em>not</em> equivalent to // * successive {@link #write(int)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final int[] arr) throws IOException { // write(arr.length); // for(final int i : arr) { // write(i); // } // } // // /** // * Writes a string. // * // * @param str The string. // * @throws IOException I/O Exception. // */ // public final void write(final String str) throws IOException { // final byte[] arr = str.getBytes(UTF8); // write((short) arr.length); // out.write(arr); // } // // private void writeBigEndian(final long bytes, final int count) // throws IOException { // long lb = bytes; // final byte[] b = new byte[count]; // int i = count; // while(--i >= 0) { // b[i] = (byte) lb; // lb >>>= 8; // } // out.write(b); // } // // @Override // public void close() throws IOException { // if(out != null) { // final OutputStream t = out; // out = null; // t.close(); // } // } // // @Override // protected void finalize() throws Throwable { // close(); // super.finalize(); // } // // }
import java.io.IOException; import nbt.write.ByteWriter;
package nbt.record; /** * The nbt end record signals the end of a compound list. * * @author Joschi <josua.krause@googlemail.com> */ public final class NBTEnd extends NBTRecord { private NBTEnd() { super(NBTType.END, null); } /** * The only nbt end instance. */ public static final NBTEnd INSTANCE = new NBTEnd(); @Override public String getPayloadString() { return ""; } @Override
// Path: src/nbt/write/ByteWriter.java // public class ByteWriter implements Closeable { // // /** // * The utf-8 charset. // */ // public static final Charset UTF8 = Charset.forName("UTF-8"); // // private OutputStream out; // // /** // * Creates a byte writer for an output stream. // * // * @param out The output stream. // */ // public ByteWriter(final OutputStream out) { // this.out = out; // } // // /** // * Writes a single byte. // * // * @param b The byte. // * @throws IOException I/O Exception. // */ // public final void write(final byte b) throws IOException { // out.write(b); // } // // /** // * Writes a short. // * // * @param s The short. // * @throws IOException I/O Exception. // */ // public final void write(final short s) throws IOException { // writeBigEndian(s, 2); // } // // /** // * Writes an integer. // * // * @param i The integer. // * @throws IOException I/O Exception. // */ // public final void write(final int i) throws IOException { // writeBigEndian(i, 4); // } // // /** // * Writes a long. // * // * @param l The long. // * @throws IOException I/O Exception. // */ // public final void write(final long l) throws IOException { // writeBigEndian(l, 8); // } // // /** // * Writes a float. // * // * @param f The float. // * @throws IOException I/O Exception. // */ // public final void write(final float f) throws IOException { // write(Float.floatToIntBits(f)); // } // // /** // * Writes a double. // * // * @param f The double. // * @throws IOException I/O Exception. // */ // public final void write(final double f) throws IOException { // write(Double.doubleToLongBits(f)); // } // // /** // * Writes a byte array. Note that this is <em>not</em> equivalent to // * successive {@link #write(byte)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final byte[] arr) throws IOException { // write(arr.length); // out.write(arr); // } // // /** // * Writes an integer array. Note that this is <em>not</em> equivalent to // * successive {@link #write(int)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final int[] arr) throws IOException { // write(arr.length); // for(final int i : arr) { // write(i); // } // } // // /** // * Writes a string. // * // * @param str The string. // * @throws IOException I/O Exception. // */ // public final void write(final String str) throws IOException { // final byte[] arr = str.getBytes(UTF8); // write((short) arr.length); // out.write(arr); // } // // private void writeBigEndian(final long bytes, final int count) // throws IOException { // long lb = bytes; // final byte[] b = new byte[count]; // int i = count; // while(--i >= 0) { // b[i] = (byte) lb; // lb >>>= 8; // } // out.write(b); // } // // @Override // public void close() throws IOException { // if(out != null) { // final OutputStream t = out; // out = null; // t.close(); // } // } // // @Override // protected void finalize() throws Throwable { // close(); // super.finalize(); // } // // } // Path: src/nbt/record/NBTEnd.java import java.io.IOException; import nbt.write.ByteWriter; package nbt.record; /** * The nbt end record signals the end of a compound list. * * @author Joschi <josua.krause@googlemail.com> */ public final class NBTEnd extends NBTRecord { private NBTEnd() { super(NBTType.END, null); } /** * The only nbt end instance. */ public static final NBTEnd INSTANCE = new NBTEnd(); @Override public String getPayloadString() { return ""; } @Override
public void writePayload(final ByteWriter out) throws IOException {
JosuaKrause/NBTEditor
src/nbt/gui/NBTFrame.java
// Path: src/nbt/record/NBTEnd.java // public final class NBTEnd extends NBTRecord { // // private NBTEnd() { // super(NBTType.END, null); // } // // /** // * The only nbt end instance. // */ // public static final NBTEnd INSTANCE = new NBTEnd(); // // @Override // public String getPayloadString() { // return ""; // } // // @Override // public void writePayload(final ByteWriter out) throws IOException { // // nothing to do // } // // }
import java.awt.BorderLayout; import java.awt.Dimension; import java.io.File; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.JTree; import javax.swing.WindowConstants; import nbt.record.NBTEnd;
package nbt.gui; /** * The nbt editor window. * * @author Joschi <josua.krause@googlemail.com> */ public class NBTFrame extends JFrame { private static final long serialVersionUID = -2257586634651534207L; private JFrame frame; /** * Creates a new nbt editor. */ public NBTFrame() { setTitle(null, false); setPreferredSize(new Dimension(800, 600));
// Path: src/nbt/record/NBTEnd.java // public final class NBTEnd extends NBTRecord { // // private NBTEnd() { // super(NBTType.END, null); // } // // /** // * The only nbt end instance. // */ // public static final NBTEnd INSTANCE = new NBTEnd(); // // @Override // public String getPayloadString() { // return ""; // } // // @Override // public void writePayload(final ByteWriter out) throws IOException { // // nothing to do // } // // } // Path: src/nbt/gui/NBTFrame.java import java.awt.BorderLayout; import java.awt.Dimension; import java.io.File; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.JTree; import javax.swing.WindowConstants; import nbt.record.NBTEnd; package nbt.gui; /** * The nbt editor window. * * @author Joschi <josua.krause@googlemail.com> */ public class NBTFrame extends JFrame { private static final long serialVersionUID = -2257586634651534207L; private JFrame frame; /** * Creates a new nbt editor. */ public NBTFrame() { setTitle(null, false); setPreferredSize(new Dimension(800, 600));
final JTree tree = new JTree(new NBTModel(NBTEnd.INSTANCE));
JosuaKrause/NBTEditor
src/nbt/record/NBTCompound.java
// Path: src/nbt/write/ByteWriter.java // public class ByteWriter implements Closeable { // // /** // * The utf-8 charset. // */ // public static final Charset UTF8 = Charset.forName("UTF-8"); // // private OutputStream out; // // /** // * Creates a byte writer for an output stream. // * // * @param out The output stream. // */ // public ByteWriter(final OutputStream out) { // this.out = out; // } // // /** // * Writes a single byte. // * // * @param b The byte. // * @throws IOException I/O Exception. // */ // public final void write(final byte b) throws IOException { // out.write(b); // } // // /** // * Writes a short. // * // * @param s The short. // * @throws IOException I/O Exception. // */ // public final void write(final short s) throws IOException { // writeBigEndian(s, 2); // } // // /** // * Writes an integer. // * // * @param i The integer. // * @throws IOException I/O Exception. // */ // public final void write(final int i) throws IOException { // writeBigEndian(i, 4); // } // // /** // * Writes a long. // * // * @param l The long. // * @throws IOException I/O Exception. // */ // public final void write(final long l) throws IOException { // writeBigEndian(l, 8); // } // // /** // * Writes a float. // * // * @param f The float. // * @throws IOException I/O Exception. // */ // public final void write(final float f) throws IOException { // write(Float.floatToIntBits(f)); // } // // /** // * Writes a double. // * // * @param f The double. // * @throws IOException I/O Exception. // */ // public final void write(final double f) throws IOException { // write(Double.doubleToLongBits(f)); // } // // /** // * Writes a byte array. Note that this is <em>not</em> equivalent to // * successive {@link #write(byte)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final byte[] arr) throws IOException { // write(arr.length); // out.write(arr); // } // // /** // * Writes an integer array. Note that this is <em>not</em> equivalent to // * successive {@link #write(int)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final int[] arr) throws IOException { // write(arr.length); // for(final int i : arr) { // write(i); // } // } // // /** // * Writes a string. // * // * @param str The string. // * @throws IOException I/O Exception. // */ // public final void write(final String str) throws IOException { // final byte[] arr = str.getBytes(UTF8); // write((short) arr.length); // out.write(arr); // } // // private void writeBigEndian(final long bytes, final int count) // throws IOException { // long lb = bytes; // final byte[] b = new byte[count]; // int i = count; // while(--i >= 0) { // b[i] = (byte) lb; // lb >>>= 8; // } // out.write(b); // } // // @Override // public void close() throws IOException { // if(out != null) { // final OutputStream t = out; // out = null; // t.close(); // } // } // // @Override // protected void finalize() throws Throwable { // close(); // super.finalize(); // } // // }
import java.io.IOException; import java.util.Collection; import java.util.SortedMap; import java.util.TreeMap; import nbt.write.ByteWriter;
for(final NBTRecord r : map.values()) { r.resetChange(); } } @Override public boolean hasChanged() { if(super.hasChanged()) return true; for(final NBTRecord r : map.values()) { if(r.hasChanged()) return true; } return false; } /** * Getter. * * @param index The index. * @return Gets the record at the given index. */ public NBTRecord get(final int index) { if(index < 0 || index >= map.size()) return null; if(list == null) { final Collection<NBTRecord> val = map.values(); list = val.toArray(new NBTRecord[val.size()]); } return list[index]; } @Override
// Path: src/nbt/write/ByteWriter.java // public class ByteWriter implements Closeable { // // /** // * The utf-8 charset. // */ // public static final Charset UTF8 = Charset.forName("UTF-8"); // // private OutputStream out; // // /** // * Creates a byte writer for an output stream. // * // * @param out The output stream. // */ // public ByteWriter(final OutputStream out) { // this.out = out; // } // // /** // * Writes a single byte. // * // * @param b The byte. // * @throws IOException I/O Exception. // */ // public final void write(final byte b) throws IOException { // out.write(b); // } // // /** // * Writes a short. // * // * @param s The short. // * @throws IOException I/O Exception. // */ // public final void write(final short s) throws IOException { // writeBigEndian(s, 2); // } // // /** // * Writes an integer. // * // * @param i The integer. // * @throws IOException I/O Exception. // */ // public final void write(final int i) throws IOException { // writeBigEndian(i, 4); // } // // /** // * Writes a long. // * // * @param l The long. // * @throws IOException I/O Exception. // */ // public final void write(final long l) throws IOException { // writeBigEndian(l, 8); // } // // /** // * Writes a float. // * // * @param f The float. // * @throws IOException I/O Exception. // */ // public final void write(final float f) throws IOException { // write(Float.floatToIntBits(f)); // } // // /** // * Writes a double. // * // * @param f The double. // * @throws IOException I/O Exception. // */ // public final void write(final double f) throws IOException { // write(Double.doubleToLongBits(f)); // } // // /** // * Writes a byte array. Note that this is <em>not</em> equivalent to // * successive {@link #write(byte)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final byte[] arr) throws IOException { // write(arr.length); // out.write(arr); // } // // /** // * Writes an integer array. Note that this is <em>not</em> equivalent to // * successive {@link #write(int)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final int[] arr) throws IOException { // write(arr.length); // for(final int i : arr) { // write(i); // } // } // // /** // * Writes a string. // * // * @param str The string. // * @throws IOException I/O Exception. // */ // public final void write(final String str) throws IOException { // final byte[] arr = str.getBytes(UTF8); // write((short) arr.length); // out.write(arr); // } // // private void writeBigEndian(final long bytes, final int count) // throws IOException { // long lb = bytes; // final byte[] b = new byte[count]; // int i = count; // while(--i >= 0) { // b[i] = (byte) lb; // lb >>>= 8; // } // out.write(b); // } // // @Override // public void close() throws IOException { // if(out != null) { // final OutputStream t = out; // out = null; // t.close(); // } // } // // @Override // protected void finalize() throws Throwable { // close(); // super.finalize(); // } // // } // Path: src/nbt/record/NBTCompound.java import java.io.IOException; import java.util.Collection; import java.util.SortedMap; import java.util.TreeMap; import nbt.write.ByteWriter; for(final NBTRecord r : map.values()) { r.resetChange(); } } @Override public boolean hasChanged() { if(super.hasChanged()) return true; for(final NBTRecord r : map.values()) { if(r.hasChanged()) return true; } return false; } /** * Getter. * * @param index The index. * @return Gets the record at the given index. */ public NBTRecord get(final int index) { if(index < 0 || index >= map.size()) return null; if(list == null) { final Collection<NBTRecord> val = map.values(); list = val.toArray(new NBTRecord[val.size()]); } return list[index]; } @Override
public void writePayload(final ByteWriter out) throws IOException {
JosuaKrause/NBTEditor
src/nbt/record/NBTString.java
// Path: src/nbt/write/ByteWriter.java // public class ByteWriter implements Closeable { // // /** // * The utf-8 charset. // */ // public static final Charset UTF8 = Charset.forName("UTF-8"); // // private OutputStream out; // // /** // * Creates a byte writer for an output stream. // * // * @param out The output stream. // */ // public ByteWriter(final OutputStream out) { // this.out = out; // } // // /** // * Writes a single byte. // * // * @param b The byte. // * @throws IOException I/O Exception. // */ // public final void write(final byte b) throws IOException { // out.write(b); // } // // /** // * Writes a short. // * // * @param s The short. // * @throws IOException I/O Exception. // */ // public final void write(final short s) throws IOException { // writeBigEndian(s, 2); // } // // /** // * Writes an integer. // * // * @param i The integer. // * @throws IOException I/O Exception. // */ // public final void write(final int i) throws IOException { // writeBigEndian(i, 4); // } // // /** // * Writes a long. // * // * @param l The long. // * @throws IOException I/O Exception. // */ // public final void write(final long l) throws IOException { // writeBigEndian(l, 8); // } // // /** // * Writes a float. // * // * @param f The float. // * @throws IOException I/O Exception. // */ // public final void write(final float f) throws IOException { // write(Float.floatToIntBits(f)); // } // // /** // * Writes a double. // * // * @param f The double. // * @throws IOException I/O Exception. // */ // public final void write(final double f) throws IOException { // write(Double.doubleToLongBits(f)); // } // // /** // * Writes a byte array. Note that this is <em>not</em> equivalent to // * successive {@link #write(byte)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final byte[] arr) throws IOException { // write(arr.length); // out.write(arr); // } // // /** // * Writes an integer array. Note that this is <em>not</em> equivalent to // * successive {@link #write(int)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final int[] arr) throws IOException { // write(arr.length); // for(final int i : arr) { // write(i); // } // } // // /** // * Writes a string. // * // * @param str The string. // * @throws IOException I/O Exception. // */ // public final void write(final String str) throws IOException { // final byte[] arr = str.getBytes(UTF8); // write((short) arr.length); // out.write(arr); // } // // private void writeBigEndian(final long bytes, final int count) // throws IOException { // long lb = bytes; // final byte[] b = new byte[count]; // int i = count; // while(--i >= 0) { // b[i] = (byte) lb; // lb >>>= 8; // } // out.write(b); // } // // @Override // public void close() throws IOException { // if(out != null) { // final OutputStream t = out; // out = null; // t.close(); // } // } // // @Override // protected void finalize() throws Throwable { // close(); // super.finalize(); // } // // }
import java.io.IOException; import java.text.ParseException; import nbt.write.ByteWriter;
* Setter. * * @param content The new content string. */ public void setContent(final String content) { this.content = content; change(); } @Override public boolean isTextEditable() { return true; } @Override public String getParseablePayload() { return getContent(); } @Override public void parsePayload(final String str) throws ParseException { setContent(str); } @Override public String getPayloadString() { return "\"" + content + "\""; } @Override
// Path: src/nbt/write/ByteWriter.java // public class ByteWriter implements Closeable { // // /** // * The utf-8 charset. // */ // public static final Charset UTF8 = Charset.forName("UTF-8"); // // private OutputStream out; // // /** // * Creates a byte writer for an output stream. // * // * @param out The output stream. // */ // public ByteWriter(final OutputStream out) { // this.out = out; // } // // /** // * Writes a single byte. // * // * @param b The byte. // * @throws IOException I/O Exception. // */ // public final void write(final byte b) throws IOException { // out.write(b); // } // // /** // * Writes a short. // * // * @param s The short. // * @throws IOException I/O Exception. // */ // public final void write(final short s) throws IOException { // writeBigEndian(s, 2); // } // // /** // * Writes an integer. // * // * @param i The integer. // * @throws IOException I/O Exception. // */ // public final void write(final int i) throws IOException { // writeBigEndian(i, 4); // } // // /** // * Writes a long. // * // * @param l The long. // * @throws IOException I/O Exception. // */ // public final void write(final long l) throws IOException { // writeBigEndian(l, 8); // } // // /** // * Writes a float. // * // * @param f The float. // * @throws IOException I/O Exception. // */ // public final void write(final float f) throws IOException { // write(Float.floatToIntBits(f)); // } // // /** // * Writes a double. // * // * @param f The double. // * @throws IOException I/O Exception. // */ // public final void write(final double f) throws IOException { // write(Double.doubleToLongBits(f)); // } // // /** // * Writes a byte array. Note that this is <em>not</em> equivalent to // * successive {@link #write(byte)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final byte[] arr) throws IOException { // write(arr.length); // out.write(arr); // } // // /** // * Writes an integer array. Note that this is <em>not</em> equivalent to // * successive {@link #write(int)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final int[] arr) throws IOException { // write(arr.length); // for(final int i : arr) { // write(i); // } // } // // /** // * Writes a string. // * // * @param str The string. // * @throws IOException I/O Exception. // */ // public final void write(final String str) throws IOException { // final byte[] arr = str.getBytes(UTF8); // write((short) arr.length); // out.write(arr); // } // // private void writeBigEndian(final long bytes, final int count) // throws IOException { // long lb = bytes; // final byte[] b = new byte[count]; // int i = count; // while(--i >= 0) { // b[i] = (byte) lb; // lb >>>= 8; // } // out.write(b); // } // // @Override // public void close() throws IOException { // if(out != null) { // final OutputStream t = out; // out = null; // t.close(); // } // } // // @Override // protected void finalize() throws Throwable { // close(); // super.finalize(); // } // // } // Path: src/nbt/record/NBTString.java import java.io.IOException; import java.text.ParseException; import nbt.write.ByteWriter; * Setter. * * @param content The new content string. */ public void setContent(final String content) { this.content = content; change(); } @Override public boolean isTextEditable() { return true; } @Override public String getParseablePayload() { return getContent(); } @Override public void parsePayload(final String str) throws ParseException { setContent(str); } @Override public String getPayloadString() { return "\"" + content + "\""; } @Override
public void writePayload(final ByteWriter out) throws IOException {
JosuaKrause/NBTEditor
src/nbt/record/NBTRecord.java
// Path: src/nbt/write/ByteWriter.java // public class ByteWriter implements Closeable { // // /** // * The utf-8 charset. // */ // public static final Charset UTF8 = Charset.forName("UTF-8"); // // private OutputStream out; // // /** // * Creates a byte writer for an output stream. // * // * @param out The output stream. // */ // public ByteWriter(final OutputStream out) { // this.out = out; // } // // /** // * Writes a single byte. // * // * @param b The byte. // * @throws IOException I/O Exception. // */ // public final void write(final byte b) throws IOException { // out.write(b); // } // // /** // * Writes a short. // * // * @param s The short. // * @throws IOException I/O Exception. // */ // public final void write(final short s) throws IOException { // writeBigEndian(s, 2); // } // // /** // * Writes an integer. // * // * @param i The integer. // * @throws IOException I/O Exception. // */ // public final void write(final int i) throws IOException { // writeBigEndian(i, 4); // } // // /** // * Writes a long. // * // * @param l The long. // * @throws IOException I/O Exception. // */ // public final void write(final long l) throws IOException { // writeBigEndian(l, 8); // } // // /** // * Writes a float. // * // * @param f The float. // * @throws IOException I/O Exception. // */ // public final void write(final float f) throws IOException { // write(Float.floatToIntBits(f)); // } // // /** // * Writes a double. // * // * @param f The double. // * @throws IOException I/O Exception. // */ // public final void write(final double f) throws IOException { // write(Double.doubleToLongBits(f)); // } // // /** // * Writes a byte array. Note that this is <em>not</em> equivalent to // * successive {@link #write(byte)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final byte[] arr) throws IOException { // write(arr.length); // out.write(arr); // } // // /** // * Writes an integer array. Note that this is <em>not</em> equivalent to // * successive {@link #write(int)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final int[] arr) throws IOException { // write(arr.length); // for(final int i : arr) { // write(i); // } // } // // /** // * Writes a string. // * // * @param str The string. // * @throws IOException I/O Exception. // */ // public final void write(final String str) throws IOException { // final byte[] arr = str.getBytes(UTF8); // write((short) arr.length); // out.write(arr); // } // // private void writeBigEndian(final long bytes, final int count) // throws IOException { // long lb = bytes; // final byte[] b = new byte[count]; // int i = count; // while(--i >= 0) { // b[i] = (byte) lb; // lb >>>= 8; // } // out.write(b); // } // // @Override // public void close() throws IOException { // if(out != null) { // final OutputStream t = out; // out = null; // t.close(); // } // } // // @Override // protected void finalize() throws Throwable { // close(); // super.finalize(); // } // // }
import java.io.IOException; import java.text.ParseException; import nbt.write.ByteWriter;
package nbt.record; /** * Represents an arbitrary nbt record. * * @author Joschi <josua.krause@googlemail.com> */ public abstract class NBTRecord { private final NBTType tagId; private final String name; /** * Creates a new nbt record. * * @param tagId The tag id of the record. * @param name The name of the record. */ protected NBTRecord(final NBTType tagId, final String name) { this.tagId = tagId; this.name = name; } /** * Getter. * * @return The name of the record. */ public String getName() { return name; } /** * Writes this record to a byte writer. * * @param out The writer. * @throws IOException I/O Exception. */
// Path: src/nbt/write/ByteWriter.java // public class ByteWriter implements Closeable { // // /** // * The utf-8 charset. // */ // public static final Charset UTF8 = Charset.forName("UTF-8"); // // private OutputStream out; // // /** // * Creates a byte writer for an output stream. // * // * @param out The output stream. // */ // public ByteWriter(final OutputStream out) { // this.out = out; // } // // /** // * Writes a single byte. // * // * @param b The byte. // * @throws IOException I/O Exception. // */ // public final void write(final byte b) throws IOException { // out.write(b); // } // // /** // * Writes a short. // * // * @param s The short. // * @throws IOException I/O Exception. // */ // public final void write(final short s) throws IOException { // writeBigEndian(s, 2); // } // // /** // * Writes an integer. // * // * @param i The integer. // * @throws IOException I/O Exception. // */ // public final void write(final int i) throws IOException { // writeBigEndian(i, 4); // } // // /** // * Writes a long. // * // * @param l The long. // * @throws IOException I/O Exception. // */ // public final void write(final long l) throws IOException { // writeBigEndian(l, 8); // } // // /** // * Writes a float. // * // * @param f The float. // * @throws IOException I/O Exception. // */ // public final void write(final float f) throws IOException { // write(Float.floatToIntBits(f)); // } // // /** // * Writes a double. // * // * @param f The double. // * @throws IOException I/O Exception. // */ // public final void write(final double f) throws IOException { // write(Double.doubleToLongBits(f)); // } // // /** // * Writes a byte array. Note that this is <em>not</em> equivalent to // * successive {@link #write(byte)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final byte[] arr) throws IOException { // write(arr.length); // out.write(arr); // } // // /** // * Writes an integer array. Note that this is <em>not</em> equivalent to // * successive {@link #write(int)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final int[] arr) throws IOException { // write(arr.length); // for(final int i : arr) { // write(i); // } // } // // /** // * Writes a string. // * // * @param str The string. // * @throws IOException I/O Exception. // */ // public final void write(final String str) throws IOException { // final byte[] arr = str.getBytes(UTF8); // write((short) arr.length); // out.write(arr); // } // // private void writeBigEndian(final long bytes, final int count) // throws IOException { // long lb = bytes; // final byte[] b = new byte[count]; // int i = count; // while(--i >= 0) { // b[i] = (byte) lb; // lb >>>= 8; // } // out.write(b); // } // // @Override // public void close() throws IOException { // if(out != null) { // final OutputStream t = out; // out = null; // t.close(); // } // } // // @Override // protected void finalize() throws Throwable { // close(); // super.finalize(); // } // // } // Path: src/nbt/record/NBTRecord.java import java.io.IOException; import java.text.ParseException; import nbt.write.ByteWriter; package nbt.record; /** * Represents an arbitrary nbt record. * * @author Joschi <josua.krause@googlemail.com> */ public abstract class NBTRecord { private final NBTType tagId; private final String name; /** * Creates a new nbt record. * * @param tagId The tag id of the record. * @param name The name of the record. */ protected NBTRecord(final NBTType tagId, final String name) { this.tagId = tagId; this.name = name; } /** * Getter. * * @return The name of the record. */ public String getName() { return name; } /** * Writes this record to a byte writer. * * @param out The writer. * @throws IOException I/O Exception. */
public void write(final ByteWriter out) throws IOException {
JosuaKrause/NBTEditor
src/nbt/map/ChunkPainter.java
// Path: src/nbt/map/pos/ChunkPosition.java // public final class ChunkPosition extends Pair { // // /** // * Creates an own chunk position. // * // * @param x The x coordinate. // * @param z The z coordinate. // */ // public ChunkPosition(final int x, final int z) { // super(x, z); // } // // } // // Path: src/nbt/map/pos/InChunkPosition.java // public class InChunkPosition extends Pair { // // /** // * Creates an in-chunk position. // * // * @param x The x coordinate. // * @param z The z coordinate. // */ // public InChunkPosition(final int x, final int z) { // super(x, z); // } // // }
import java.awt.Color; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Rectangle; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.Map; import java.util.Set; import nbt.map.pos.ChunkPosition; import nbt.map.pos.InChunkPosition;
private final Object drawLock = new Object(); private final UpdateReceiver user; private final Image loading; /** * Creates a chunk painter. * * @param user The user that is notified when something changes. * @param scale The scaling factor. */ public ChunkPainter(final UpdateReceiver user, final double scale) { this.user = user; this.scale = scale; loading = createLoadingImage(); int numThreads = Math.max(Runtime.getRuntime().availableProcessors(), 2); System.out.println("Using " + numThreads + " image loader"); while(--numThreads >= 0) { startOneImageThread(); } } private void drawChunk(final Chunk chunk) { final BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_RGB); final Graphics2D gi = (Graphics2D) img.getGraphics(); for(int x = 0; x < 16; ++x) { for(int z = 0; z < 16; ++z) { final Rectangle2D rect = new Rectangle2D.Double(x, z, 1, 1);
// Path: src/nbt/map/pos/ChunkPosition.java // public final class ChunkPosition extends Pair { // // /** // * Creates an own chunk position. // * // * @param x The x coordinate. // * @param z The z coordinate. // */ // public ChunkPosition(final int x, final int z) { // super(x, z); // } // // } // // Path: src/nbt/map/pos/InChunkPosition.java // public class InChunkPosition extends Pair { // // /** // * Creates an in-chunk position. // * // * @param x The x coordinate. // * @param z The z coordinate. // */ // public InChunkPosition(final int x, final int z) { // super(x, z); // } // // } // Path: src/nbt/map/ChunkPainter.java import java.awt.Color; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Rectangle; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.Map; import java.util.Set; import nbt.map.pos.ChunkPosition; import nbt.map.pos.InChunkPosition; private final Object drawLock = new Object(); private final UpdateReceiver user; private final Image loading; /** * Creates a chunk painter. * * @param user The user that is notified when something changes. * @param scale The scaling factor. */ public ChunkPainter(final UpdateReceiver user, final double scale) { this.user = user; this.scale = scale; loading = createLoadingImage(); int numThreads = Math.max(Runtime.getRuntime().availableProcessors(), 2); System.out.println("Using " + numThreads + " image loader"); while(--numThreads >= 0) { startOneImageThread(); } } private void drawChunk(final Chunk chunk) { final BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_RGB); final Graphics2D gi = (Graphics2D) img.getGraphics(); for(int x = 0; x < 16; ++x) { for(int z = 0; z < 16; ++z) { final Rectangle2D rect = new Rectangle2D.Double(x, z, 1, 1);
final InChunkPosition pos = new InChunkPosition(x, z);
JosuaKrause/NBTEditor
src/nbt/map/ChunkPainter.java
// Path: src/nbt/map/pos/ChunkPosition.java // public final class ChunkPosition extends Pair { // // /** // * Creates an own chunk position. // * // * @param x The x coordinate. // * @param z The z coordinate. // */ // public ChunkPosition(final int x, final int z) { // super(x, z); // } // // } // // Path: src/nbt/map/pos/InChunkPosition.java // public class InChunkPosition extends Pair { // // /** // * Creates an in-chunk position. // * // * @param x The x coordinate. // * @param z The z coordinate. // */ // public InChunkPosition(final int x, final int z) { // super(x, z); // } // // }
import java.awt.Color; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Rectangle; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.Map; import java.util.Set; import nbt.map.pos.ChunkPosition; import nbt.map.pos.InChunkPosition;
@Override public void run() { try { synchronized(ChunkPainter.this) { ++numberOfThreads; } while(!isInterrupted()) { for(;;) { if(hasPendingChunks()) { break; } waitOnDrawer(); } pollChunkAndDraw(); } } catch(final InterruptedException e) { interrupt(); } finally { synchronized(ChunkPainter.this) { --numberOfThreads; } } } }; t.setDaemon(true); t.start(); }
// Path: src/nbt/map/pos/ChunkPosition.java // public final class ChunkPosition extends Pair { // // /** // * Creates an own chunk position. // * // * @param x The x coordinate. // * @param z The z coordinate. // */ // public ChunkPosition(final int x, final int z) { // super(x, z); // } // // } // // Path: src/nbt/map/pos/InChunkPosition.java // public class InChunkPosition extends Pair { // // /** // * Creates an in-chunk position. // * // * @param x The x coordinate. // * @param z The z coordinate. // */ // public InChunkPosition(final int x, final int z) { // super(x, z); // } // // } // Path: src/nbt/map/ChunkPainter.java import java.awt.Color; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Rectangle; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.Map; import java.util.Set; import nbt.map.pos.ChunkPosition; import nbt.map.pos.InChunkPosition; @Override public void run() { try { synchronized(ChunkPainter.this) { ++numberOfThreads; } while(!isInterrupted()) { for(;;) { if(hasPendingChunks()) { break; } waitOnDrawer(); } pollChunkAndDraw(); } } catch(final InterruptedException e) { interrupt(); } finally { synchronized(ChunkPainter.this) { --numberOfThreads; } } } }; t.setDaemon(true); t.start(); }
private ChunkPosition pos;
JosuaKrause/NBTEditor
src/nbt/record/NBTByteArray.java
// Path: src/nbt/write/ByteWriter.java // public class ByteWriter implements Closeable { // // /** // * The utf-8 charset. // */ // public static final Charset UTF8 = Charset.forName("UTF-8"); // // private OutputStream out; // // /** // * Creates a byte writer for an output stream. // * // * @param out The output stream. // */ // public ByteWriter(final OutputStream out) { // this.out = out; // } // // /** // * Writes a single byte. // * // * @param b The byte. // * @throws IOException I/O Exception. // */ // public final void write(final byte b) throws IOException { // out.write(b); // } // // /** // * Writes a short. // * // * @param s The short. // * @throws IOException I/O Exception. // */ // public final void write(final short s) throws IOException { // writeBigEndian(s, 2); // } // // /** // * Writes an integer. // * // * @param i The integer. // * @throws IOException I/O Exception. // */ // public final void write(final int i) throws IOException { // writeBigEndian(i, 4); // } // // /** // * Writes a long. // * // * @param l The long. // * @throws IOException I/O Exception. // */ // public final void write(final long l) throws IOException { // writeBigEndian(l, 8); // } // // /** // * Writes a float. // * // * @param f The float. // * @throws IOException I/O Exception. // */ // public final void write(final float f) throws IOException { // write(Float.floatToIntBits(f)); // } // // /** // * Writes a double. // * // * @param f The double. // * @throws IOException I/O Exception. // */ // public final void write(final double f) throws IOException { // write(Double.doubleToLongBits(f)); // } // // /** // * Writes a byte array. Note that this is <em>not</em> equivalent to // * successive {@link #write(byte)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final byte[] arr) throws IOException { // write(arr.length); // out.write(arr); // } // // /** // * Writes an integer array. Note that this is <em>not</em> equivalent to // * successive {@link #write(int)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final int[] arr) throws IOException { // write(arr.length); // for(final int i : arr) { // write(i); // } // } // // /** // * Writes a string. // * // * @param str The string. // * @throws IOException I/O Exception. // */ // public final void write(final String str) throws IOException { // final byte[] arr = str.getBytes(UTF8); // write((short) arr.length); // out.write(arr); // } // // private void writeBigEndian(final long bytes, final int count) // throws IOException { // long lb = bytes; // final byte[] b = new byte[count]; // int i = count; // while(--i >= 0) { // b[i] = (byte) lb; // lb >>>= 8; // } // out.write(b); // } // // @Override // public void close() throws IOException { // if(out != null) { // final OutputStream t = out; // out = null; // t.close(); // } // } // // @Override // protected void finalize() throws Throwable { // close(); // super.finalize(); // } // // }
import java.io.IOException; import java.text.ParseException; import nbt.write.ByteWriter;
@Override public void parsePayload(final String str) throws ParseException { if(str.length() % 2 == 1) throw new ParseException("incorrect length", str.length()); final byte[] arr = new byte[str.length() / 2]; for(int i = 0; i < arr.length; ++i) { final char high = str.charAt(i * 2); final char low = str.charAt(i * 2 + 1); try { final int n = Integer.parseInt("" + high + low, 16); arr[i] = (byte) n; } catch(final NumberFormatException e) { throw new ParseException("illegal characters " + high + low, i * 2); } } setArray(arr); } @Override public boolean hasSize() { return true; } @Override public int size() { return getLength(); } @Override
// Path: src/nbt/write/ByteWriter.java // public class ByteWriter implements Closeable { // // /** // * The utf-8 charset. // */ // public static final Charset UTF8 = Charset.forName("UTF-8"); // // private OutputStream out; // // /** // * Creates a byte writer for an output stream. // * // * @param out The output stream. // */ // public ByteWriter(final OutputStream out) { // this.out = out; // } // // /** // * Writes a single byte. // * // * @param b The byte. // * @throws IOException I/O Exception. // */ // public final void write(final byte b) throws IOException { // out.write(b); // } // // /** // * Writes a short. // * // * @param s The short. // * @throws IOException I/O Exception. // */ // public final void write(final short s) throws IOException { // writeBigEndian(s, 2); // } // // /** // * Writes an integer. // * // * @param i The integer. // * @throws IOException I/O Exception. // */ // public final void write(final int i) throws IOException { // writeBigEndian(i, 4); // } // // /** // * Writes a long. // * // * @param l The long. // * @throws IOException I/O Exception. // */ // public final void write(final long l) throws IOException { // writeBigEndian(l, 8); // } // // /** // * Writes a float. // * // * @param f The float. // * @throws IOException I/O Exception. // */ // public final void write(final float f) throws IOException { // write(Float.floatToIntBits(f)); // } // // /** // * Writes a double. // * // * @param f The double. // * @throws IOException I/O Exception. // */ // public final void write(final double f) throws IOException { // write(Double.doubleToLongBits(f)); // } // // /** // * Writes a byte array. Note that this is <em>not</em> equivalent to // * successive {@link #write(byte)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final byte[] arr) throws IOException { // write(arr.length); // out.write(arr); // } // // /** // * Writes an integer array. Note that this is <em>not</em> equivalent to // * successive {@link #write(int)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final int[] arr) throws IOException { // write(arr.length); // for(final int i : arr) { // write(i); // } // } // // /** // * Writes a string. // * // * @param str The string. // * @throws IOException I/O Exception. // */ // public final void write(final String str) throws IOException { // final byte[] arr = str.getBytes(UTF8); // write((short) arr.length); // out.write(arr); // } // // private void writeBigEndian(final long bytes, final int count) // throws IOException { // long lb = bytes; // final byte[] b = new byte[count]; // int i = count; // while(--i >= 0) { // b[i] = (byte) lb; // lb >>>= 8; // } // out.write(b); // } // // @Override // public void close() throws IOException { // if(out != null) { // final OutputStream t = out; // out = null; // t.close(); // } // } // // @Override // protected void finalize() throws Throwable { // close(); // super.finalize(); // } // // } // Path: src/nbt/record/NBTByteArray.java import java.io.IOException; import java.text.ParseException; import nbt.write.ByteWriter; @Override public void parsePayload(final String str) throws ParseException { if(str.length() % 2 == 1) throw new ParseException("incorrect length", str.length()); final byte[] arr = new byte[str.length() / 2]; for(int i = 0; i < arr.length; ++i) { final char high = str.charAt(i * 2); final char low = str.charAt(i * 2 + 1); try { final int n = Integer.parseInt("" + high + low, 16); arr[i] = (byte) n; } catch(final NumberFormatException e) { throw new ParseException("illegal characters " + high + low, i * 2); } } setArray(arr); } @Override public boolean hasSize() { return true; } @Override public int size() { return getLength(); } @Override
public void writePayload(final ByteWriter out) throws IOException {
JosuaKrause/NBTEditor
src/nbt/map/Biomes.java
// Path: src/nbt/DynamicArray.java // public class DynamicArray<T> implements Iterable<T> { // // private final ArrayList<T> content; // // /** // * Creates a dynamic array with initial size. // * // * @param initialSize The initial size. // */ // public DynamicArray(final int initialSize) { // content = new ArrayList<T>(initialSize); // } // // /** // * Getter. // * // * @param i The index. // * @return The element at the given index. The default value for unassigned // * fields is <code>null</code>. // */ // public T get(final int i) { // if(i < 0) throw new IndexOutOfBoundsException( // "index may not be smaller than 0: " + i); // if(i >= content.size()) return null; // return content.get(i); // } // // /** // * Setter. // * // * @param i The index. // * @param t Sets the element at the given index. // */ // public void set(final int i, final T t) { // if(i < 0) throw new IndexOutOfBoundsException( // "index may not be smaller than 0: " + i); // ensureSize(i); // content.set(i, t); // } // // private void ensureSize(final int i) { // content.ensureCapacity(i + 1); // while(i >= content.size()) { // content.add(null); // } // } // // @Override // public Iterator<T> iterator() { // final Iterator<T> iter = content.iterator(); // return new Iterator<T>() { // // private final Iterator<T> it = iter; // // private T next; // // private boolean first = true; // // private void fetchIfFirst() { // if(first) { // fetchNext(); // first = false; // } // } // // private void fetchNext() { // while(it.hasNext()) { // final T t = it.next(); // if(t != null) { // next = t; // return; // } // } // next = null; // } // // @Override // public boolean hasNext() { // fetchIfFirst(); // return next != null; // } // // @Override // public T next() { // fetchIfFirst(); // final T res = next; // fetchNext(); // return res; // } // // @Override // public void remove() { // throw new UnsupportedOperationException(); // } // // }; // } // // }
import java.awt.Color; import nbt.DynamicArray;
package nbt.map; /** * Represents the biome data of chunks. * * @author Joschi <josua.krause@googlemail.com> */ public enum Biomes { /** Ocean biome. */ OCEAN(0, "Ocean", Color.BLUE), /** Plains biome. */ PLAINS(1, "Plains", Color.GREEN), /** Desert biome. */ DESERT(2, "Desert", Color.YELLOW), /** Extreme hills biome. */ EXT_HILLS(3, "Extreme Hills", new Color(0x964b00)), /** Forest biome. */ FOREST(4, "Forest", new Color(0x00a000)), /** Taiga biome. */ TAIGA(5, "Taiga", new Color(0x80a080)), /** Swamp biome. */ SWAMP(6, "Swampland", new Color(0x006000)), /** River biome. */ RIVER(7, "River", new Color(0x8080ff)), /** Nether biome. */ HELL(8, "Hell", Color.RED), /** End biome. */ SKY(9, "Sky", Color.CYAN), /** Frozen ocean biome. */ FROZEAN(10, "Frozen Ocean", new Color(0x8080ff)), /** Frozen river biome. */ FRIVER(11, "Frozen River", new Color(0x80a0a0)), /** Ice plains biome. */ ICE_PLAINS(12, "Ice Plains", new Color(0x80ff80)), /** Ice mountains biome. */ ICE_MOUNT(13, "Ice Mountains", new Color(0x964b00).brighter().brighter()), /** Mushroom island biome. */ MUSHR(14, "Mushroom Island", new Color(0xffa000)), /** Mushroom island shore biome. */ MUSHR_SHORE(15, "Mushroom Island Shore", new Color(0xffa060)), /** Beach biome. */ BEACH(16, "Beach", new Color(0xffff80)), /** Desert hills biome. */ DESERT_HILLS(17, "Desert Hills", new Color(0x808000)), /** Forest hills biome. */ FOREST_HILLS(18, "Forest Hills", new Color(0x80ff00)), /** Taiga hills biome. */ TAIGA_HILLS(19, "Taiga Hills", new Color(0x964b00).brighter()), /** Extreme hills edge biome. */ EXT_HILLS_EDGE(20, "Extreme Hills Edge", new Color(0x863b00).brighter()), /** Jungle biome. */ JUNGLE(21, "Jungle", new Color(0x00d000)), /** Jungle hills biome. */ JUNGLE_HILLS(22, "Jungle Hills", new Color(0x20d020)), /** * Signals that a biome id is currently unassigned. */ DEFAULT_UNASSIGNED(-1, "Unassigned", Color.MAGENTA), /* end of declaration */; /** * The id of the biome. */ public final int id; /** * The name of the biome. */ public final String name; /** * The color of the biome as in the overlay. */ public final Color color;
// Path: src/nbt/DynamicArray.java // public class DynamicArray<T> implements Iterable<T> { // // private final ArrayList<T> content; // // /** // * Creates a dynamic array with initial size. // * // * @param initialSize The initial size. // */ // public DynamicArray(final int initialSize) { // content = new ArrayList<T>(initialSize); // } // // /** // * Getter. // * // * @param i The index. // * @return The element at the given index. The default value for unassigned // * fields is <code>null</code>. // */ // public T get(final int i) { // if(i < 0) throw new IndexOutOfBoundsException( // "index may not be smaller than 0: " + i); // if(i >= content.size()) return null; // return content.get(i); // } // // /** // * Setter. // * // * @param i The index. // * @param t Sets the element at the given index. // */ // public void set(final int i, final T t) { // if(i < 0) throw new IndexOutOfBoundsException( // "index may not be smaller than 0: " + i); // ensureSize(i); // content.set(i, t); // } // // private void ensureSize(final int i) { // content.ensureCapacity(i + 1); // while(i >= content.size()) { // content.add(null); // } // } // // @Override // public Iterator<T> iterator() { // final Iterator<T> iter = content.iterator(); // return new Iterator<T>() { // // private final Iterator<T> it = iter; // // private T next; // // private boolean first = true; // // private void fetchIfFirst() { // if(first) { // fetchNext(); // first = false; // } // } // // private void fetchNext() { // while(it.hasNext()) { // final T t = it.next(); // if(t != null) { // next = t; // return; // } // } // next = null; // } // // @Override // public boolean hasNext() { // fetchIfFirst(); // return next != null; // } // // @Override // public T next() { // fetchIfFirst(); // final T res = next; // fetchNext(); // return res; // } // // @Override // public void remove() { // throw new UnsupportedOperationException(); // } // // }; // } // // } // Path: src/nbt/map/Biomes.java import java.awt.Color; import nbt.DynamicArray; package nbt.map; /** * Represents the biome data of chunks. * * @author Joschi <josua.krause@googlemail.com> */ public enum Biomes { /** Ocean biome. */ OCEAN(0, "Ocean", Color.BLUE), /** Plains biome. */ PLAINS(1, "Plains", Color.GREEN), /** Desert biome. */ DESERT(2, "Desert", Color.YELLOW), /** Extreme hills biome. */ EXT_HILLS(3, "Extreme Hills", new Color(0x964b00)), /** Forest biome. */ FOREST(4, "Forest", new Color(0x00a000)), /** Taiga biome. */ TAIGA(5, "Taiga", new Color(0x80a080)), /** Swamp biome. */ SWAMP(6, "Swampland", new Color(0x006000)), /** River biome. */ RIVER(7, "River", new Color(0x8080ff)), /** Nether biome. */ HELL(8, "Hell", Color.RED), /** End biome. */ SKY(9, "Sky", Color.CYAN), /** Frozen ocean biome. */ FROZEAN(10, "Frozen Ocean", new Color(0x8080ff)), /** Frozen river biome. */ FRIVER(11, "Frozen River", new Color(0x80a0a0)), /** Ice plains biome. */ ICE_PLAINS(12, "Ice Plains", new Color(0x80ff80)), /** Ice mountains biome. */ ICE_MOUNT(13, "Ice Mountains", new Color(0x964b00).brighter().brighter()), /** Mushroom island biome. */ MUSHR(14, "Mushroom Island", new Color(0xffa000)), /** Mushroom island shore biome. */ MUSHR_SHORE(15, "Mushroom Island Shore", new Color(0xffa060)), /** Beach biome. */ BEACH(16, "Beach", new Color(0xffff80)), /** Desert hills biome. */ DESERT_HILLS(17, "Desert Hills", new Color(0x808000)), /** Forest hills biome. */ FOREST_HILLS(18, "Forest Hills", new Color(0x80ff00)), /** Taiga hills biome. */ TAIGA_HILLS(19, "Taiga Hills", new Color(0x964b00).brighter()), /** Extreme hills edge biome. */ EXT_HILLS_EDGE(20, "Extreme Hills Edge", new Color(0x863b00).brighter()), /** Jungle biome. */ JUNGLE(21, "Jungle", new Color(0x00d000)), /** Jungle hills biome. */ JUNGLE_HILLS(22, "Jungle Hills", new Color(0x20d020)), /** * Signals that a biome id is currently unassigned. */ DEFAULT_UNASSIGNED(-1, "Unassigned", Color.MAGENTA), /* end of declaration */; /** * The id of the biome. */ public final int id; /** * The name of the biome. */ public final String name; /** * The color of the biome as in the overlay. */ public final Color color;
private static final DynamicArray<Biomes> BIOME_MAP;
JosuaKrause/NBTEditor
src/nbt/write/NBTWriter.java
// Path: src/nbt/record/NBTRecord.java // public abstract class NBTRecord { // // private final NBTType tagId; // // private final String name; // // /** // * Creates a new nbt record. // * // * @param tagId The tag id of the record. // * @param name The name of the record. // */ // protected NBTRecord(final NBTType tagId, final String name) { // this.tagId = tagId; // this.name = name; // } // // /** // * Getter. // * // * @return The name of the record. // */ // public String getName() { // return name; // } // // /** // * Writes this record to a byte writer. // * // * @param out The writer. // * @throws IOException I/O Exception. // */ // public void write(final ByteWriter out) throws IOException { // out.write(tagId.byteValue); // final String name = getName(); // if(name != null) { // out.write(name); // } // writePayload(out); // } // // /** // * Getter. // * // * @return Whether this record is text editable. // */ // public boolean isTextEditable() { // return false; // } // // /** // * Getter. // * // * @return The text editable string when this record is text editable. // */ // public String getParseablePayload() { // throw new UnsupportedOperationException("is not text editable"); // } // // /** // * Setter. // * // * @param str The string that is interpreted as new content of the record when // * the record is text editable. // * @throws ParseException If the text could not be interpreted. // */ // @SuppressWarnings("unused") // public void parsePayload(final String str) throws ParseException { // throw new UnsupportedOperationException("is not text editable"); // } // // /** // * Writes the payload of the record into a byte writer. // * // * @param out The writer. // * @throws IOException I/O Exception. // */ // public abstract void writePayload(ByteWriter out) throws IOException; // // /** // * Getter. // * // * @return A string representation of the payload. // */ // public abstract String getPayloadString(); // // /** // * Getter. // * // * @return The full text representation. // */ // public String getFullRepresentation() { // final String name = getName(); // return tagId.toString() // + (name == null ? ": " : "(\"" + name + "\"): ") // + getPayloadString(); // } // // private boolean hasChanged; // // /** // * Signals that the record has been changed. // */ // protected void change() { // hasChanged = true; // } // // /** // * Resets the change flag. // */ // public void resetChange() { // hasChanged = false; // } // // /** // * Getter. // * // * @return Whether the record has been changed. // */ // public boolean hasChanged() { // return hasChanged; // } // // /** // * Getter. // * // * @return The type of record. // */ // public NBTType getType() { // return tagId; // } // // /** // * Getter. // * // * @return A type info string. // */ // public String getTypeInfo() { // return getType() + (hasSize() ? " " + size() : ""); // } // // /** // * Getter. // * // * @return Whether the record has an associated size. // */ // public boolean hasSize() { // return false; // } // // /** // * Getter. // * // * @return The associated size or 0 if the record has no associated size. // */ // public int size() { // return 0; // } // // }
import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.zip.GZIPOutputStream; import nbt.record.NBTRecord;
package nbt.write; /** * Writes a nbt file. * * @author Joschi <josua.krause@googlemail.com> */ public class NBTWriter extends ByteWriter { /** * Creates a writer for a zipped nbt file. * * @param file The output file. * @throws IOException I/O Exception. */ public NBTWriter(final File file) throws IOException { this(file, true); } /** * Creates a writer for a maybe zipped nbt file. * * @param file The output file. * @param wrapZip Whether the file is zipped or not. * @throws IOException I/O Exception. */ public NBTWriter(final File file, final boolean wrapZip) throws IOException { this(new BufferedOutputStream(new FileOutputStream(file)), wrapZip); } /** * Creates a writer for a maybe zipped nbt stream. * * @param out The output stream. * @param wrapZip Whether the file is zipped or not. * @throws IOException I/O Exception. */ public NBTWriter(final OutputStream out, final boolean wrapZip) throws IOException { super(wrapZip ? new GZIPOutputStream(out) : out); } /** * Writes the nbt content. * * @param record The root element. * @throws IOException I/O Exception. */
// Path: src/nbt/record/NBTRecord.java // public abstract class NBTRecord { // // private final NBTType tagId; // // private final String name; // // /** // * Creates a new nbt record. // * // * @param tagId The tag id of the record. // * @param name The name of the record. // */ // protected NBTRecord(final NBTType tagId, final String name) { // this.tagId = tagId; // this.name = name; // } // // /** // * Getter. // * // * @return The name of the record. // */ // public String getName() { // return name; // } // // /** // * Writes this record to a byte writer. // * // * @param out The writer. // * @throws IOException I/O Exception. // */ // public void write(final ByteWriter out) throws IOException { // out.write(tagId.byteValue); // final String name = getName(); // if(name != null) { // out.write(name); // } // writePayload(out); // } // // /** // * Getter. // * // * @return Whether this record is text editable. // */ // public boolean isTextEditable() { // return false; // } // // /** // * Getter. // * // * @return The text editable string when this record is text editable. // */ // public String getParseablePayload() { // throw new UnsupportedOperationException("is not text editable"); // } // // /** // * Setter. // * // * @param str The string that is interpreted as new content of the record when // * the record is text editable. // * @throws ParseException If the text could not be interpreted. // */ // @SuppressWarnings("unused") // public void parsePayload(final String str) throws ParseException { // throw new UnsupportedOperationException("is not text editable"); // } // // /** // * Writes the payload of the record into a byte writer. // * // * @param out The writer. // * @throws IOException I/O Exception. // */ // public abstract void writePayload(ByteWriter out) throws IOException; // // /** // * Getter. // * // * @return A string representation of the payload. // */ // public abstract String getPayloadString(); // // /** // * Getter. // * // * @return The full text representation. // */ // public String getFullRepresentation() { // final String name = getName(); // return tagId.toString() // + (name == null ? ": " : "(\"" + name + "\"): ") // + getPayloadString(); // } // // private boolean hasChanged; // // /** // * Signals that the record has been changed. // */ // protected void change() { // hasChanged = true; // } // // /** // * Resets the change flag. // */ // public void resetChange() { // hasChanged = false; // } // // /** // * Getter. // * // * @return Whether the record has been changed. // */ // public boolean hasChanged() { // return hasChanged; // } // // /** // * Getter. // * // * @return The type of record. // */ // public NBTType getType() { // return tagId; // } // // /** // * Getter. // * // * @return A type info string. // */ // public String getTypeInfo() { // return getType() + (hasSize() ? " " + size() : ""); // } // // /** // * Getter. // * // * @return Whether the record has an associated size. // */ // public boolean hasSize() { // return false; // } // // /** // * Getter. // * // * @return The associated size or 0 if the record has no associated size. // */ // public int size() { // return 0; // } // // } // Path: src/nbt/write/NBTWriter.java import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.zip.GZIPOutputStream; import nbt.record.NBTRecord; package nbt.write; /** * Writes a nbt file. * * @author Joschi <josua.krause@googlemail.com> */ public class NBTWriter extends ByteWriter { /** * Creates a writer for a zipped nbt file. * * @param file The output file. * @throws IOException I/O Exception. */ public NBTWriter(final File file) throws IOException { this(file, true); } /** * Creates a writer for a maybe zipped nbt file. * * @param file The output file. * @param wrapZip Whether the file is zipped or not. * @throws IOException I/O Exception. */ public NBTWriter(final File file, final boolean wrapZip) throws IOException { this(new BufferedOutputStream(new FileOutputStream(file)), wrapZip); } /** * Creates a writer for a maybe zipped nbt stream. * * @param out The output stream. * @param wrapZip Whether the file is zipped or not. * @throws IOException I/O Exception. */ public NBTWriter(final OutputStream out, final boolean wrapZip) throws IOException { super(wrapZip ? new GZIPOutputStream(out) : out); } /** * Writes the nbt content. * * @param record The root element. * @throws IOException I/O Exception. */
public void write(final NBTRecord record) throws IOException {
JosuaKrause/NBTEditor
src/nbt/record/NBTNumeric.java
// Path: src/nbt/write/ByteWriter.java // public class ByteWriter implements Closeable { // // /** // * The utf-8 charset. // */ // public static final Charset UTF8 = Charset.forName("UTF-8"); // // private OutputStream out; // // /** // * Creates a byte writer for an output stream. // * // * @param out The output stream. // */ // public ByteWriter(final OutputStream out) { // this.out = out; // } // // /** // * Writes a single byte. // * // * @param b The byte. // * @throws IOException I/O Exception. // */ // public final void write(final byte b) throws IOException { // out.write(b); // } // // /** // * Writes a short. // * // * @param s The short. // * @throws IOException I/O Exception. // */ // public final void write(final short s) throws IOException { // writeBigEndian(s, 2); // } // // /** // * Writes an integer. // * // * @param i The integer. // * @throws IOException I/O Exception. // */ // public final void write(final int i) throws IOException { // writeBigEndian(i, 4); // } // // /** // * Writes a long. // * // * @param l The long. // * @throws IOException I/O Exception. // */ // public final void write(final long l) throws IOException { // writeBigEndian(l, 8); // } // // /** // * Writes a float. // * // * @param f The float. // * @throws IOException I/O Exception. // */ // public final void write(final float f) throws IOException { // write(Float.floatToIntBits(f)); // } // // /** // * Writes a double. // * // * @param f The double. // * @throws IOException I/O Exception. // */ // public final void write(final double f) throws IOException { // write(Double.doubleToLongBits(f)); // } // // /** // * Writes a byte array. Note that this is <em>not</em> equivalent to // * successive {@link #write(byte)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final byte[] arr) throws IOException { // write(arr.length); // out.write(arr); // } // // /** // * Writes an integer array. Note that this is <em>not</em> equivalent to // * successive {@link #write(int)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final int[] arr) throws IOException { // write(arr.length); // for(final int i : arr) { // write(i); // } // } // // /** // * Writes a string. // * // * @param str The string. // * @throws IOException I/O Exception. // */ // public final void write(final String str) throws IOException { // final byte[] arr = str.getBytes(UTF8); // write((short) arr.length); // out.write(arr); // } // // private void writeBigEndian(final long bytes, final int count) // throws IOException { // long lb = bytes; // final byte[] b = new byte[count]; // int i = count; // while(--i >= 0) { // b[i] = (byte) lb; // lb >>>= 8; // } // out.write(b); // } // // @Override // public void close() throws IOException { // if(out != null) { // final OutputStream t = out; // out = null; // t.close(); // } // } // // @Override // protected void finalize() throws Throwable { // close(); // super.finalize(); // } // // }
import java.io.IOException; import java.text.ParseException; import nbt.write.ByteWriter;
package nbt.record; /** * A numerical value record. * * @author Joschi <josua.krause@googlemail.com> * @param <T> The number type. */ public class NBTNumeric<T extends Number> extends NBTRecord { private T payload; /** * Creates a numerical value. * * @param type The type of the numerical value. * @param name The name of the record. * @param payload The numerical value. */ public NBTNumeric(final NBTType type, final String name, final T payload) { super(type, name); this.payload = payload; } /** * Getter. * * @return The number. */ public T getPayload() { return payload; } /** * Setter. * * @param value The payload. */ public void setPayload(final T value) { if(value.equals(payload)) return; this.payload = value; change(); } @Override public String getPayloadString() { return payload.toString(); } @Override
// Path: src/nbt/write/ByteWriter.java // public class ByteWriter implements Closeable { // // /** // * The utf-8 charset. // */ // public static final Charset UTF8 = Charset.forName("UTF-8"); // // private OutputStream out; // // /** // * Creates a byte writer for an output stream. // * // * @param out The output stream. // */ // public ByteWriter(final OutputStream out) { // this.out = out; // } // // /** // * Writes a single byte. // * // * @param b The byte. // * @throws IOException I/O Exception. // */ // public final void write(final byte b) throws IOException { // out.write(b); // } // // /** // * Writes a short. // * // * @param s The short. // * @throws IOException I/O Exception. // */ // public final void write(final short s) throws IOException { // writeBigEndian(s, 2); // } // // /** // * Writes an integer. // * // * @param i The integer. // * @throws IOException I/O Exception. // */ // public final void write(final int i) throws IOException { // writeBigEndian(i, 4); // } // // /** // * Writes a long. // * // * @param l The long. // * @throws IOException I/O Exception. // */ // public final void write(final long l) throws IOException { // writeBigEndian(l, 8); // } // // /** // * Writes a float. // * // * @param f The float. // * @throws IOException I/O Exception. // */ // public final void write(final float f) throws IOException { // write(Float.floatToIntBits(f)); // } // // /** // * Writes a double. // * // * @param f The double. // * @throws IOException I/O Exception. // */ // public final void write(final double f) throws IOException { // write(Double.doubleToLongBits(f)); // } // // /** // * Writes a byte array. Note that this is <em>not</em> equivalent to // * successive {@link #write(byte)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final byte[] arr) throws IOException { // write(arr.length); // out.write(arr); // } // // /** // * Writes an integer array. Note that this is <em>not</em> equivalent to // * successive {@link #write(int)} calls! // * // * @param arr The array. // * @throws IOException I/O Exception. // */ // public final void write(final int[] arr) throws IOException { // write(arr.length); // for(final int i : arr) { // write(i); // } // } // // /** // * Writes a string. // * // * @param str The string. // * @throws IOException I/O Exception. // */ // public final void write(final String str) throws IOException { // final byte[] arr = str.getBytes(UTF8); // write((short) arr.length); // out.write(arr); // } // // private void writeBigEndian(final long bytes, final int count) // throws IOException { // long lb = bytes; // final byte[] b = new byte[count]; // int i = count; // while(--i >= 0) { // b[i] = (byte) lb; // lb >>>= 8; // } // out.write(b); // } // // @Override // public void close() throws IOException { // if(out != null) { // final OutputStream t = out; // out = null; // t.close(); // } // } // // @Override // protected void finalize() throws Throwable { // close(); // super.finalize(); // } // // } // Path: src/nbt/record/NBTNumeric.java import java.io.IOException; import java.text.ParseException; import nbt.write.ByteWriter; package nbt.record; /** * A numerical value record. * * @author Joschi <josua.krause@googlemail.com> * @param <T> The number type. */ public class NBTNumeric<T extends Number> extends NBTRecord { private T payload; /** * Creates a numerical value. * * @param type The type of the numerical value. * @param name The name of the record. * @param payload The numerical value. */ public NBTNumeric(final NBTType type, final String name, final T payload) { super(type, name); this.payload = payload; } /** * Getter. * * @return The number. */ public T getPayload() { return payload; } /** * Setter. * * @param value The payload. */ public void setPayload(final T value) { if(value.equals(payload)) return; this.payload = value; change(); } @Override public String getPayloadString() { return payload.toString(); } @Override
public void writePayload(final ByteWriter out) throws IOException {
JosuaKrause/NBTEditor
src/nbt/MainEditor.java
// Path: src/nbt/gui/NBTFrame.java // public class NBTFrame extends JFrame { // // private static final long serialVersionUID = -2257586634651534207L; // // private JFrame frame; // // /** // * Creates a new nbt editor. // */ // public NBTFrame() { // setTitle(null, false); // setPreferredSize(new Dimension(800, 600)); // final JTree tree = new JTree(new NBTModel(NBTEnd.INSTANCE)); // tree.setRootVisible(true); // tree.setCellRenderer(new NBTCellRenderer()); // setLayout(new BorderLayout()); // add(new JScrollPane(tree), BorderLayout.CENTER); // add(new NBTEdit(tree, this), BorderLayout.SOUTH); // pack(); // setLocationRelativeTo(null); // setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); // } // // /** // * Sets the title of the window. // * // * @param file The currently open file. // * @param changed Whether the content of the nbt file has been changed. // */ // public void setTitle(final File file, final boolean changed) { // setTitle("NBTEdit: " + (changed ? "*" : "") // + (file != null ? file.toString() : "-")); // } // // /** // * Sets the additional frame. E.g. the frame that is opened when a chunk has // * been opened. // * // * @param newFrame The additional frame. // */ // public void setAdditionalFrame(final JFrame newFrame) { // if(frame != null) { // final JFrame f = frame; // frame = null; // f.setVisible(false); // f.dispose(); // } // frame = newFrame; // } // // @Override // public void dispose() { // setAdditionalFrame(null); // super.dispose(); // } // // }
import nbt.gui.NBTFrame;
package nbt; /** * Starts the nbt editor. Arguments are ignored. * * @author Joschi <josua.krause@googlemail.com> */ public final class MainEditor { private MainEditor() { // no constructor } /** * Starts the nbt editor. * * @param args Ignored. */ public static void main(final String[] args) {
// Path: src/nbt/gui/NBTFrame.java // public class NBTFrame extends JFrame { // // private static final long serialVersionUID = -2257586634651534207L; // // private JFrame frame; // // /** // * Creates a new nbt editor. // */ // public NBTFrame() { // setTitle(null, false); // setPreferredSize(new Dimension(800, 600)); // final JTree tree = new JTree(new NBTModel(NBTEnd.INSTANCE)); // tree.setRootVisible(true); // tree.setCellRenderer(new NBTCellRenderer()); // setLayout(new BorderLayout()); // add(new JScrollPane(tree), BorderLayout.CENTER); // add(new NBTEdit(tree, this), BorderLayout.SOUTH); // pack(); // setLocationRelativeTo(null); // setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); // } // // /** // * Sets the title of the window. // * // * @param file The currently open file. // * @param changed Whether the content of the nbt file has been changed. // */ // public void setTitle(final File file, final boolean changed) { // setTitle("NBTEdit: " + (changed ? "*" : "") // + (file != null ? file.toString() : "-")); // } // // /** // * Sets the additional frame. E.g. the frame that is opened when a chunk has // * been opened. // * // * @param newFrame The additional frame. // */ // public void setAdditionalFrame(final JFrame newFrame) { // if(frame != null) { // final JFrame f = frame; // frame = null; // f.setVisible(false); // f.dispose(); // } // frame = newFrame; // } // // @Override // public void dispose() { // setAdditionalFrame(null); // super.dispose(); // } // // } // Path: src/nbt/MainEditor.java import nbt.gui.NBTFrame; package nbt; /** * Starts the nbt editor. Arguments are ignored. * * @author Joschi <josua.krause@googlemail.com> */ public final class MainEditor { private MainEditor() { // no constructor } /** * Starts the nbt editor. * * @param args Ignored. */ public static void main(final String[] args) {
new NBTFrame().setVisible(true);
JosuaKrause/NBTEditor
src/nbt/MainMap.java
// Path: src/nbt/gui/MapFrame.java // public class MapFrame extends JFrame { // // private static final long serialVersionUID = 9004371841431541418L; // // private final MapViewer view; // // /** // * Creates a new map editor window. // */ // public MapFrame() { // setTitle(null, false); // setPreferredSize(new Dimension(800, 600)); // view = new MapViewer(this, 2.0); // setLayout(new BorderLayout()); // add(view, BorderLayout.CENTER); // add(new MapEdit(view, this), BorderLayout.SOUTH); // pack(); // setLocationRelativeTo(null); // setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); // } // // /** // * The window title prefix. // */ // public static final String TITLE = "MapViewer: "; // // private File file; // // private boolean chg; // // private String str; // // private String brush; // // /** // * Setter. // * // * @param str Sets the title text. // */ // public void setTitleText(final String str) { // this.str = str; // setTitle(file, chg); // } // // /** // * Setter. // * // * @param brush Sets the used brush. // */ // public void setBrush(final String brush) { // this.brush = brush; // } // // /** // * Sets the title of the window. // * // * @param file The currently opened map file. // * @param changed Whether something has been changed on the map. // */ // public void setTitle(final File file, final boolean changed) { // this.file = file; // chg = changed; // setTitle(TITLE + (changed ? "*" : "") // + (file != null ? file.toString() : "-") // + (str != null ? " - " + str : "") // + (brush != null ? " Brush: " + brush : "")); // } // // @Override // public void dispose() { // view.setControls(null); // super.dispose(); // } // // }
import nbt.gui.MapFrame;
package nbt; /** * Starts the map editor. Arguments are ignored. * * @author Joschi <josua.krause@googlemail.com> */ public final class MainMap { private MainMap() { // no constructor } /** * Starts the map editor. * * @param args Ignored. */ public static void main(final String[] args) {
// Path: src/nbt/gui/MapFrame.java // public class MapFrame extends JFrame { // // private static final long serialVersionUID = 9004371841431541418L; // // private final MapViewer view; // // /** // * Creates a new map editor window. // */ // public MapFrame() { // setTitle(null, false); // setPreferredSize(new Dimension(800, 600)); // view = new MapViewer(this, 2.0); // setLayout(new BorderLayout()); // add(view, BorderLayout.CENTER); // add(new MapEdit(view, this), BorderLayout.SOUTH); // pack(); // setLocationRelativeTo(null); // setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); // } // // /** // * The window title prefix. // */ // public static final String TITLE = "MapViewer: "; // // private File file; // // private boolean chg; // // private String str; // // private String brush; // // /** // * Setter. // * // * @param str Sets the title text. // */ // public void setTitleText(final String str) { // this.str = str; // setTitle(file, chg); // } // // /** // * Setter. // * // * @param brush Sets the used brush. // */ // public void setBrush(final String brush) { // this.brush = brush; // } // // /** // * Sets the title of the window. // * // * @param file The currently opened map file. // * @param changed Whether something has been changed on the map. // */ // public void setTitle(final File file, final boolean changed) { // this.file = file; // chg = changed; // setTitle(TITLE + (changed ? "*" : "") // + (file != null ? file.toString() : "-") // + (str != null ? " - " + str : "") // + (brush != null ? " Brush: " + brush : "")); // } // // @Override // public void dispose() { // view.setControls(null); // super.dispose(); // } // // } // Path: src/nbt/MainMap.java import nbt.gui.MapFrame; package nbt; /** * Starts the map editor. Arguments are ignored. * * @author Joschi <josua.krause@googlemail.com> */ public final class MainMap { private MainMap() { // no constructor } /** * Starts the map editor. * * @param args Ignored. */ public static void main(final String[] args) {
new MapFrame().setVisible(true);
JosuaKrause/NBTEditor
src/nbt/gui/NBTCellRenderer.java
// Path: src/nbt/record/NBTRecord.java // public abstract class NBTRecord { // // private final NBTType tagId; // // private final String name; // // /** // * Creates a new nbt record. // * // * @param tagId The tag id of the record. // * @param name The name of the record. // */ // protected NBTRecord(final NBTType tagId, final String name) { // this.tagId = tagId; // this.name = name; // } // // /** // * Getter. // * // * @return The name of the record. // */ // public String getName() { // return name; // } // // /** // * Writes this record to a byte writer. // * // * @param out The writer. // * @throws IOException I/O Exception. // */ // public void write(final ByteWriter out) throws IOException { // out.write(tagId.byteValue); // final String name = getName(); // if(name != null) { // out.write(name); // } // writePayload(out); // } // // /** // * Getter. // * // * @return Whether this record is text editable. // */ // public boolean isTextEditable() { // return false; // } // // /** // * Getter. // * // * @return The text editable string when this record is text editable. // */ // public String getParseablePayload() { // throw new UnsupportedOperationException("is not text editable"); // } // // /** // * Setter. // * // * @param str The string that is interpreted as new content of the record when // * the record is text editable. // * @throws ParseException If the text could not be interpreted. // */ // @SuppressWarnings("unused") // public void parsePayload(final String str) throws ParseException { // throw new UnsupportedOperationException("is not text editable"); // } // // /** // * Writes the payload of the record into a byte writer. // * // * @param out The writer. // * @throws IOException I/O Exception. // */ // public abstract void writePayload(ByteWriter out) throws IOException; // // /** // * Getter. // * // * @return A string representation of the payload. // */ // public abstract String getPayloadString(); // // /** // * Getter. // * // * @return The full text representation. // */ // public String getFullRepresentation() { // final String name = getName(); // return tagId.toString() // + (name == null ? ": " : "(\"" + name + "\"): ") // + getPayloadString(); // } // // private boolean hasChanged; // // /** // * Signals that the record has been changed. // */ // protected void change() { // hasChanged = true; // } // // /** // * Resets the change flag. // */ // public void resetChange() { // hasChanged = false; // } // // /** // * Getter. // * // * @return Whether the record has been changed. // */ // public boolean hasChanged() { // return hasChanged; // } // // /** // * Getter. // * // * @return The type of record. // */ // public NBTType getType() { // return tagId; // } // // /** // * Getter. // * // * @return A type info string. // */ // public String getTypeInfo() { // return getType() + (hasSize() ? " " + size() : ""); // } // // /** // * Getter. // * // * @return Whether the record has an associated size. // */ // public boolean hasSize() { // return false; // } // // /** // * Getter. // * // * @return The associated size or 0 if the record has no associated size. // */ // public int size() { // return 0; // } // // }
import java.awt.Component; import javax.swing.JLabel; import javax.swing.JTree; import javax.swing.tree.TreeCellRenderer; import nbt.record.NBTRecord;
package nbt.gui; /** * Renders a nbt editor cell. * * @author Joschi <josua.krause@googlemail.com> */ public class NBTCellRenderer implements TreeCellRenderer { @Override public Component getTreeCellRendererComponent(final JTree tree, final Object value, final boolean selected, final boolean expanded, final boolean leaf, final int row, final boolean hasFocus) {
// Path: src/nbt/record/NBTRecord.java // public abstract class NBTRecord { // // private final NBTType tagId; // // private final String name; // // /** // * Creates a new nbt record. // * // * @param tagId The tag id of the record. // * @param name The name of the record. // */ // protected NBTRecord(final NBTType tagId, final String name) { // this.tagId = tagId; // this.name = name; // } // // /** // * Getter. // * // * @return The name of the record. // */ // public String getName() { // return name; // } // // /** // * Writes this record to a byte writer. // * // * @param out The writer. // * @throws IOException I/O Exception. // */ // public void write(final ByteWriter out) throws IOException { // out.write(tagId.byteValue); // final String name = getName(); // if(name != null) { // out.write(name); // } // writePayload(out); // } // // /** // * Getter. // * // * @return Whether this record is text editable. // */ // public boolean isTextEditable() { // return false; // } // // /** // * Getter. // * // * @return The text editable string when this record is text editable. // */ // public String getParseablePayload() { // throw new UnsupportedOperationException("is not text editable"); // } // // /** // * Setter. // * // * @param str The string that is interpreted as new content of the record when // * the record is text editable. // * @throws ParseException If the text could not be interpreted. // */ // @SuppressWarnings("unused") // public void parsePayload(final String str) throws ParseException { // throw new UnsupportedOperationException("is not text editable"); // } // // /** // * Writes the payload of the record into a byte writer. // * // * @param out The writer. // * @throws IOException I/O Exception. // */ // public abstract void writePayload(ByteWriter out) throws IOException; // // /** // * Getter. // * // * @return A string representation of the payload. // */ // public abstract String getPayloadString(); // // /** // * Getter. // * // * @return The full text representation. // */ // public String getFullRepresentation() { // final String name = getName(); // return tagId.toString() // + (name == null ? ": " : "(\"" + name + "\"): ") // + getPayloadString(); // } // // private boolean hasChanged; // // /** // * Signals that the record has been changed. // */ // protected void change() { // hasChanged = true; // } // // /** // * Resets the change flag. // */ // public void resetChange() { // hasChanged = false; // } // // /** // * Getter. // * // * @return Whether the record has been changed. // */ // public boolean hasChanged() { // return hasChanged; // } // // /** // * Getter. // * // * @return The type of record. // */ // public NBTType getType() { // return tagId; // } // // /** // * Getter. // * // * @return A type info string. // */ // public String getTypeInfo() { // return getType() + (hasSize() ? " " + size() : ""); // } // // /** // * Getter. // * // * @return Whether the record has an associated size. // */ // public boolean hasSize() { // return false; // } // // /** // * Getter. // * // * @return The associated size or 0 if the record has no associated size. // */ // public int size() { // return 0; // } // // } // Path: src/nbt/gui/NBTCellRenderer.java import java.awt.Component; import javax.swing.JLabel; import javax.swing.JTree; import javax.swing.tree.TreeCellRenderer; import nbt.record.NBTRecord; package nbt.gui; /** * Renders a nbt editor cell. * * @author Joschi <josua.krause@googlemail.com> */ public class NBTCellRenderer implements TreeCellRenderer { @Override public Component getTreeCellRendererComponent(final JTree tree, final Object value, final boolean selected, final boolean expanded, final boolean leaf, final int row, final boolean hasFocus) {
final NBTRecord rec = (NBTRecord) value;