Ejemplo n.º 1
0
 /**
  * Returns a fieldInfo that corresponds to an element with the given node name. A ClassInfo cannot
  * have 2 elements with the same xml name.
  *
  * @param nodeName the NodeName of the field to get.
  * @return a fieldInfo that corresponds to an element with the given node name.
  */
 public FieldInfo getElementField(final String nodeName) {
   if (_elements != null) {
     for (int i = 0; i < _elements.size(); i++) {
       FieldInfo temp = (FieldInfo) _elements.get(i);
       String elementNodeName = temp.getNodeName();
       if (elementNodeName != null && elementNodeName.equals(nodeName)) {
         return temp;
       }
     }
   }
   return null;
 }
Ejemplo n.º 2
0
  /**
   * Returns a fieldInfo that corresponds to an attribute with the given node name. A ClassInfo
   * cannot have 2 attributes with the same xml name.
   *
   * @param nodeName the NodeName of the field to get.
   * @return a fieldInfo that corresponds to an attribute with the given node name.
   */
  public FieldInfo getAttributeField(final String nodeName) {
    if (_atts == null) {
      return null;
    }

    for (int i = 0; i < _atts.size(); i++) {
      FieldInfo temp = (FieldInfo) _atts.get(i);
      if (temp.getNodeName().equals(nodeName)) {
        return temp;
      }
    }

    return null;
  }