Example #1
0
        public static String substituteVars(Object[] list, IData pipeline)
        {
            StringBuilder sb     = new StringBuilder();
            int           length = list.Length / 2 * 2;

            for (int i = 0; i < length; i += 2)
            {
                sb.Append(list[i] as string);
                MapWmPathInfo pathInfo = list[(i + 1)] as MapWmPathInfo;
                Object        ob       = IDataWmPathProcessor.getNode(pipeline, pathInfo.getPathItems());
                if ((ob is String))
                {
                    sb.Append((String)ob);
                }
                else
                {
                    sb.Append("%" + pathInfo.path + "%");
                }
            }
            if (list.Length / 2 * 2 != list.Length)
            {
                sb.Append((String)list[(list.Length - 1)]);
            }
            return(sb.ToString());
        }
Example #2
0
 public static MapWmPathInfo create(String path)
 {
     if ((path == null) || (path.Length == 0))
     {
         return(null);
     }
     try
     {
         MapWmPathInfo aPathInfo = new MapWmPathInfo(path);
         if (aPathInfo.getPathItems() == null)
         {
             return(null);
         }
         return(aPathInfo);
     }
     catch (Exception e) { }
     return(null);
 }
Example #3
0
 public static MapWmPathInfo create(String path)
 {
     if ((path == null) || (path.Length == 0))
     {
         return null;
     }
     try
     {
         MapWmPathInfo aPathInfo = new MapWmPathInfo(path);
         if (aPathInfo.getPathItems() == null)
         {
             return null;
         }
         return aPathInfo;
     }
     catch (Exception e) { }
     return null;
 }
Example #4
0
        public static Object[] processPath(String[] list)
        {
            if ((list == null) || (list.Length < 1))
            {
                return(null);
            }
            Object[] result = new Object[list.Length];
            int      length = list.Length / 2 * 2;

            for (int i = 0; i < length; i += 2)
            {
                result[i]       = list[i];
                result[(i + 1)] = MapWmPathInfo.create(list[(i + 1)]);
            }
            if (list.Length / 2 * 2 != list.Length)
            {
                result[(result.Length - 1)] = list[(list.Length - 1)];
            }
            return(result);
        }