Beispiel #1
0
  /**
   * Adds the given FieldInfo to this ClassInfo
   *
   * @param fieldInfo the FieldInfo to add
   */
  public void addFieldInfo(FieldInfo fieldInfo) {

    if (fieldInfo == null) return;

    switch (fieldInfo.getNodeType()) {
      case FieldInfo.ATTRIBUTE_TYPE:
        if (atts == null) atts = new Vector(3);
        if (!atts.contains(fieldInfo)) atts.addElement(fieldInfo);
        break;
      case FieldInfo.TEXT_TYPE:
        textField = fieldInfo;
        break;
      default:
        if (elements == null) elements = new Vector(5);
        if (!elements.contains(fieldInfo)) elements.addElement(fieldInfo);
        break;
    }
  } // -- addFieldInfo
Beispiel #2
0
  /**
   * Returns true if the given FieldInfo is contained within this ClassInfo
   *
   * @return true if the given FieldInfo is contained within this ClassInfo
   */
  public boolean contains(FieldInfo fieldInfo) {
    boolean val = false;

    if (fieldInfo == null) return false;

    switch (fieldInfo.getNodeType()) {
      case FieldInfo.ATTRIBUTE_TYPE:
        if (atts != null) return atts.contains(fieldInfo);
        break;
      case FieldInfo.TEXT_TYPE:
        return (fieldInfo == textField);
      default:
        if (elements != null) return elements.contains(fieldInfo);
        break;
    }

    // if (sourceInfo != null)
    //    return sourceInfo.contains(fieldInfo);

    return false;
  } // -- contains