Back to index

wims  3.65+svn20090927
Static Package Functions | Static Package Attributes
rene.util.xml.XmlTranslator Class Reference
Collaboration diagram for rene.util.xml.XmlTranslator:
Collaboration graph
[legend]

List of all members.

Static Package Functions

static String toXml (String s)
static void toH (String s)
static String toText (String s)
static boolean find (String s, int pos, String t)

Static Package Attributes

static SimpleStringBuffer H = new SimpleStringBuffer(10000)

Detailed Description

Definition at line 5 of file XmlTranslator.java.


Member Function Documentation

static boolean rene.util.xml.XmlTranslator.find ( String  s,
int  pos,
String  t 
) [inline, static, package]

Definition at line 61 of file XmlTranslator.java.

       {      try
              {      for (int i=0; i<t.length(); i++)
                     {      if (s.charAt(pos+i)!=t.charAt(i)) return false;
                     }
                     return true;
              }
              catch (Exception e)
              {      return false;
              }
       }

Here is the caller graph for this function:

static void rene.util.xml.XmlTranslator.toH ( String  s) [inline, static, package]

Definition at line 23 of file XmlTranslator.java.

       {      int m=s.length();
              for (int i=0; i<m; i++)
              {      H.append(s.charAt(i));
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

static String rene.util.xml.XmlTranslator.toText ( String  s) [inline, static, package]

Definition at line 29 of file XmlTranslator.java.

       {      int m=s.length();
              H.clear();
              for (int i=0; i<m; i++)
              {      char c=s.charAt(i);
                     if (c=='&')
                     {      if (find(s,i,"&lt;"))
                            {      H.append('<');
                                   i+=3;
                            }
                            else if (find(s,i,"&gt;"))
                            {      H.append('>');
                                   i+=3;
                            }
                            else if (find(s,i,"&quot;"))
                            {      H.append('\"');
                                   i+=5;
                            }
                            else if (find(s,i,"&apos;"))
                            {      H.append('\'');
                                   i+=5;
                            }
                            else if (find(s,i,"&amp;"))
                            {      H.append('&');
                                   i+=4;
                            }
                            else H.append(c);
                     }
                     else H.append(c);
              }
              return H.toString();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

static String rene.util.xml.XmlTranslator.toXml ( String  s) [inline, static, package]

Definition at line 7 of file XmlTranslator.java.

       {      int m=s.length();
              H.clear();
              for (int i=0; i<m; i++)
              {      char c=s.charAt(i);
                     switch(c)
                     {      case '<' : toH("&lt;"); break;
                            case '>' : toH("&gt;"); break;
                            case '&' : toH("&amp;"); break;
                            case '\'' : toH("&apos;"); break;
                            case '\"' : toH("&quot;"); break;
                            default : H.append(c);
                     }
              }
              return H.toString();
       }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 6 of file XmlTranslator.java.


The documentation for this class was generated from the following file: