public Terminated<Element> create() { if (ready() == false) { throw new IllegalStateException(); } final Terminated<String> next = dataSource.next(); final String text = next.getElement(); final UFont font = new UFont("Default", Font.PLAIN, 12); return new Terminated<Element>( new ElementTextField(text.substring(1, text.length() - 1), font, spriteContainer), next.getTerminator()); }
public boolean ready() { final String text = dataSource.peek(0).getElement(); return text.startsWith("\"") && text.endsWith("\""); }