class ArticleTools::ArticleSerializer

Public Class Methods

new() click to toggle source
# File lib/sentra/opr.rb, line 55
def initialize
  @simpleFormat = OprData::SimpleFormat.new(OprData::Article)
end

Public Instance Methods

read_from_xml_string(str) click to toggle source
# File lib/sentra/opr.rb, line 67
def read_from_xml_string str
  java_str = java.lang.String.new(str)
  input = java.io.ByteArrayInputStream.new(java_str.getBytes("UTF-8"))
  @simpleFormat.parse(input)
end
write_to_xml_string(article) click to toggle source
# File lib/sentra/opr.rb, line 59
def write_to_xml_string article

  out = java.io.ByteArrayOutputStream.new()
  @simpleFormat.format(out, article)
  out.close()
  out.toString("UTF-8")
end