Back to index

wims  3.65+svn20090927
Public Member Functions | Protected Attributes | Package Functions | Package Attributes
rene.util.xml.XmlTag Class Reference
Inheritance diagram for rene.util.xml.XmlTag:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 XmlTag (String s)
String name ()
int countParams ()
String getParam (int i)
String getValue (int i)
boolean hasParam (String param)
boolean hasTrueParam (String param)
String getValue (String param)

Protected Attributes

String Tag = ""

Package Functions

int skipBlanks (String s, int n)
int endItem (String s, int n)

Package Attributes

String Param []
String Value []
int N = 0

Detailed Description

Definition at line 4 of file XmlTag.java.


Constructor & Destructor Documentation

rene.util.xml.XmlTag.XmlTag ( String  s) [inline]

Definition at line 9 of file XmlTag.java.

       {      int n=0;
              int k=0;
              n=skipBlanks(s,n);
              while (n<s.length())
              {      n=endItem(s,n);
                     k++;
                     n=skipBlanks(s,n);
              }
              if (k==0) return;
              n=0;
              n=skipBlanks(s,n);
              int m=endItem(s,n);
              Tag=s.substring(n,m);
              n=m;
              N=k-1;
              Param=new String[N];
              Value=new String[N];
              for (int i=0; i<N; i++)
              {      n=skipBlanks(s,n);
                     m=endItem(s,n);
                     String p=s.substring(n,m);
                     n=m;
                     int kp=p.indexOf('=');
                     if (kp>=0)
                     {      Param[i]=p.substring(0,kp);
                            Value[i]=XmlTranslator.toText(p.substring(kp+1));
                            if (Value[i].startsWith("\"") && Value[i].endsWith("\""))
                            {      Value[i]=Value[i].substring(1,Value[i].length()-1);
                            }
                            else if (Value[i].startsWith("\'") && Value[i].endsWith("\'"))
                            {      Value[i]=Value[i].substring(1,Value[i].length()-1);
                            }
                     }
                     else
                     {      Param[i]=p;
                            Value[i]="";
                     }
              }
       }

Here is the call graph for this function:


Member Function Documentation

Definition at line 84 of file XmlTag.java.

       {      return N;
       }

Here is the caller graph for this function:

int rene.util.xml.XmlTag.endItem ( String  s,
int  n 
) [inline, package]

Definition at line 57 of file XmlTag.java.

       {      while (n<s.length())
              {      char c=s.charAt(n);
                     if (c==' ' || c=='\t' || c=='\n') break;
                     if (c=='\"')
                     {      n++;
                            while (true)
                            {      if (n>=s.length()) return n;
                                   if (s.charAt(n)=='\"') break;
                                   n++;
                            }
                     }
                     else if (c=='\'')
                     {      n++;
                            while (true)
                            {      if (n>=s.length()) return n;
                                   if (s.charAt(n)=='\'') break;
                                   n++;
                            }
                     }
                     n++;
              }
              return n;
       }

Here is the caller graph for this function:

String rene.util.xml.XmlTag.getParam ( int  i) [inline]

Definition at line 87 of file XmlTag.java.

       {      return Param[i];
       }

Here is the caller graph for this function:

String rene.util.xml.XmlTag.getValue ( int  i) [inline]

Definition at line 90 of file XmlTag.java.

       {      return Value[i];
       }

Here is the caller graph for this function:

String rene.util.xml.XmlTag.getValue ( String  param) [inline]

Definition at line 106 of file XmlTag.java.

       {      for (int i=0; i<N; i++)
                     if (Param[i].equals(param)) return Value[i];
              return null;
       }
boolean rene.util.xml.XmlTag.hasParam ( String  param) [inline]

Definition at line 93 of file XmlTag.java.

       {      for (int i=0; i<N; i++)
                     if (Param[i].equals(param)) return true;
              return false;
       }

Here is the caller graph for this function:

boolean rene.util.xml.XmlTag.hasTrueParam ( String  param) [inline]

Definition at line 98 of file XmlTag.java.

       {      for (int i=0; i<N; i++)
                     if (Param[i].equals(param))
                     {      if (Value[i].equals("true")) return true;
                            return false;
                     }
              return false;
       }

Here is the caller graph for this function:

String rene.util.xml.XmlTag.name ( ) [inline]

Definition at line 81 of file XmlTag.java.

       {      return Tag;
       }

Here is the caller graph for this function:

int rene.util.xml.XmlTag.skipBlanks ( String  s,
int  n 
) [inline, package]

Definition at line 49 of file XmlTag.java.

       {      while (n<s.length())
              {      char c=s.charAt(n);
                     if (c==' ' || c=='\t' || c=='\n') n++;
                     else break;
              }
              return n;
       }

Here is the caller graph for this function:


Member Data Documentation

int rene.util.xml.XmlTag.N = 0 [package]

Definition at line 8 of file XmlTag.java.

String rene.util.xml.XmlTag.Param[] [package]

Definition at line 6 of file XmlTag.java.

String rene.util.xml.XmlTag.Tag = "" [protected]

Definition at line 5 of file XmlTag.java.

String rene.util.xml.XmlTag.Value[] [package]

Definition at line 7 of file XmlTag.java.


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