Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/ontomde-uml2-java/javadoc.rb

Constant Summary collapse

JAVA_ESCAPEJAVADOC_RE =
/\*\\/

Instance Method Summary collapse

Instance Method Details

#java_writeJavadoc(res) ⇒ Object

write string as javadoc NOTE: source strings should not include javadoc comments open/close

(javadoc comments open/closed are removed)


8
9
10
11
12
13
14
15
# File 'lib/ontomde-uml2-java/javadoc.rb', line 8

def java_writeJavadoc(res)
  # replace escaped carriage return by true carriage return
  # remove java comments (we are already inside a javadoc)
  self.gsub(/\\r\\n/,"\n").gsub(/\*\//,'--').gsub(/\/\*/,'--').each { |line|
    res.write("   * #{line}".tr("\n"," ").rstrip)
    res.write("\n")
  }
end