Пример #1
0
  /**
   * This is used to acquire the attribute path using this XPath expression. The attribute path is
   * simply the fully qualified path for this expression with the provided name appended. If this is
   * an empty path, the provided name is returned.
   *
   * @param name this is the name of the attribute to be used
   * @return a fully qualified path for the specified name
   */
  public String getAttribute(String name) {
    if (!isEmpty(location)) {
      String path = attributes.fetch(name);

      if (path == null) {
        path = getAttributePath(location, name);

        if (path != null) {
          attributes.cache(name, path);
        }
      }
      return path;
    }
    return style.getAttribute(name);
  }
Пример #2
0
  /**
   * This is used to acquire the element path using this XPath expression. The element path is
   * simply the fully qualified path for this expression with the provided name appended. If this is
   * an empty path, the provided name is returned.
   *
   * @param name this is the name of the element to be used
   * @return a fully qualified path for the specified name
   */
  public String getElement(String name) {
    if (!isEmpty(location)) {
      String path = elements.fetch(name);

      if (path == null) {
        path = getElementPath(location, name);

        if (path != null) {
          elements.cache(name, path);
        }
      }
      return path;
    }
    return style.getElement(name);
  }
Пример #3
0
 private Converter getConverter(Class class1, Constructor constructor) throws Exception {
   constructor = (Converter) constructor.newInstance(new Object[0]);
   if (constructor != null) {
     cache.cache(class1, constructor);
   }
   return constructor;
 }
Пример #4
0
 public Converter getInstance(Class class1) throws Exception {
   Converter converter1 = (Converter) cache.fetch(class1);
   Converter converter = converter1;
   if (converter1 == null) {
     converter = getConverter(class1);
   }
   return converter;
 }