示例#1
0
 /**
  * Appends the given String to the last line in this JSourceCode.
  *
  * @param segment The String to append.
  */
 public void append(final String segment) {
   if (_source.isEmpty()) {
     add(segment);
   } else {
     JCodeStatement jcs = (JCodeStatement) _source.lastElement();
     jcs.append(segment);
   }
 }
示例#2
0
 /**
  * Adds the given JCodeStatement to this JSourceCode.
  *
  * @param jcs The JCodeStatement to add.
  */
 private void addCodeStatement(final JCodeStatement jcs) {
   short indent = (short) (jcs.getIndent() + _currentIndent - DEFAULT_INDENT_SIZE);
   _source.addElement(new JCodeStatement(jcs.getStatement(), indent));
 }