if (!TranslatorContext.isStringType(b))
throw new XMLValidationException("String expression expected " + b, origin);
return sa.getAutomaton(b);
}
public Automaton getAutomatonFromObjectExp(ValueBox b) { // TODO: cache results of getAutomatonFromObjectExp?
Type t = b.getValue().getType();
if (t instanceof NullType)
return Automaton.makeString("null");
while (t instanceof ArrayType)
t = ((ArrayType) t).getElementType();
if (t instanceof RefType) {
if (t.equals(RefType.v("java.lang.String")) || t.equals(RefType.v("java.lang.Object"))) { // for (arrays of) String, ask the string analyzer
return sa.getAutomaton(b);
} else { // for other reference types, take the union of the type automata for the possible types
List<Automaton> auts = new ArrayList<Automaton>();
for (SootClass sc : context.getSubclassesOfIncluding((RefType)t))
if (!context.implementsToXMLable(sc))