Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/ontomde-java/java/refactor.rb,
lib/ontomde-java/vmware/vso.rb,
lib/ontomde-java/java/javadoc.rb,
lib/ontomde-java/struts/mappingToJavaHierarchy.rb

Overview

refactor generates a single file that contains a report of what java code was generated. This file is designed to be easy to diff.

In order to know what to refactor, version this file and run a diff on it. You will know what has changed.

Constant Summary collapse

JAVA_ESCAPEJAVADOC_RE =
/\*\\/

Instance Method Summary collapse

Instance Method Details

#java_stringEscapeObject



98
99
100
# File 'lib/ontomde-java/struts/mappingToJavaHierarchy.rb', line 98

def java_stringEscape
	return self.gsub(/\\/,'\\\\\\\\')
end

#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-java/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/,"").gsub(/\\n/,"\n").gsub(/\*\//,'--').gsub(/\/\*/,'--').each { |line|
    res.write("\t * #{line}".tr("\n"," ").rstrip)
    res.write("\n")
  }
end

#mtk_xmlObject



9
10
11
# File 'lib/ontomde-java/java/refactor.rb', line 9

def mtk_xml
	return self.tr('<','_').tr('>','_')
end

#tabObject



304
305
306
# File 'lib/ontomde-java/vmware/vso.rb', line 304

def tab
	return self+'  '
end