Пример #1
0
  /**
   * Adds the given FieldInfo to this ClassInfo
   *
   * @param fieldInfo the FieldInfo to add
   */
  public void addFieldInfo(final FieldInfo fieldInfo) {
    if (fieldInfo == null) {
      return;
    }

    fieldInfo.setDeclaringClassInfo(this);

    switch (fieldInfo.getNodeType()) {
      case XMLInfo.ATTRIBUTE_TYPE:
        if (_atts == null) {
          _atts = new Vector(3);
        }
        if (!_atts.contains(fieldInfo)) {
          _atts.addElement(fieldInfo);
        }
        break;
      case XMLInfo.TEXT_TYPE:
        _textField = fieldInfo;
        break;
      default:
        if (_elements == null) {
          _elements = new Vector(5);
        }
        if (!_elements.contains(fieldInfo)) {
          _elements.addElement(fieldInfo);
        }
        break;
    }
  } // -- addFieldInfo
Пример #2
0
  /**
   * Returns true if the given FieldInfo is contained within this ClassInfo
   *
   * @param fieldInfo the FieldInfo to check
   * @return true if the given FieldInfo is contained within this ClassInfo
   */
  public boolean contains(final FieldInfo fieldInfo) {
    if (fieldInfo == null) {
      return false;
    }

    switch (fieldInfo.getNodeType()) {
      case XMLInfo.ATTRIBUTE_TYPE:
        if (_atts != null) {
          return _atts.contains(fieldInfo);
        }
        break;
      case XMLInfo.TEXT_TYPE:
        return (fieldInfo == _textField);
      default:
        if (_elements != null) {
          return _elements.contains(fieldInfo);
        }
        break;
    }

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

    return false;
  } // -- contains
Пример #3
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
Пример #4
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