Class: FileTypeJavaProperties

Inherits:
FileType show all
Defined in:
lib/ontomde-core/fileTypes.rb

Instance Attribute Summary

Attributes inherited from FileType

#re_begin, #re_end

Instance Method Summary collapse

Methods inherited from FileType

#beginMarkerSkip, #endMarkerSkip, #escape, getFileType, #unescape

Constructor Details

#initialize(ext = '.properties') ⇒ FileTypeJavaProperties

Returns a new instance of FileTypeJavaProperties.



110
111
112
113
114
# File 'lib/ontomde-core/fileTypes.rb', line 110

def initialize(ext='.properties')
  super(ext)
  @re_begin=/^[ \t]*#[_ ]*XMDA_BEGIN_reverse="([^"]*)"_uri="([^"]*)"[ _]*$/
  @re_end=/^[ \t]*#[ _]*XMDA_END_uri="([^"]*)"[ _]*$/
end

Instance Method Details

#beginMarker(uri, reverse) ⇒ Object



118
119
120
# File 'lib/ontomde-core/fileTypes.rb', line 118

def beginMarker(uri,reverse)
  return %{\n#_XMDA_BEGIN_reverse="#{reverse ? 'yes':'no'}"_uri="#{uri}"\n}
end

#endMarker(uri) ⇒ Object



121
122
123
# File 'lib/ontomde-core/fileTypes.rb', line 121

def endMarker(uri)
  return %{\n#_XMDA_END_uri="#{uri}"\n}
end

#writeComment(str, writer) ⇒ Object



115
116
117
# File 'lib/ontomde-core/fileTypes.rb', line 115

def writeComment(str,writer)
  writer.write("#  #{str} ")
end