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.



103
104
105
106
107
# File 'lib/ontomde-core/fileTypes.rb', line 103

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



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

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

#endMarker(uri) ⇒ Object



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

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

#writeComment(str, writer) ⇒ Object



108
109
110
# File 'lib/ontomde-core/fileTypes.rb', line 108

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