コード例 #1
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;
 }
コード例 #2
0
ファイル: PathParser.java プロジェクト: unisx/simplexml
  /**
   * 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);
  }
コード例 #3
0
ファイル: PathParser.java プロジェクト: unisx/simplexml
  /**
   * 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);
  }