Esempio n. 1
0
 // Dump the content of this bean returning it as a String
 public void dump(StringBuffer str, String indent) {
   String s;
   Object o;
   org.netbeans.modules.schema2beans.BaseBean n;
   str.append(indent);
   str.append("FileEntry[" + this.sizeFileEntry() + "]"); // NOI18N
   for (int i = 0; i < this.sizeFileEntry(); i++) {
     str.append(indent + "\t");
     str.append("#" + i + ":");
     n = (org.netbeans.modules.schema2beans.BaseBean) this.getFileEntry(i);
     if (n != null) n.dump(str, indent + "\t"); // NOI18N
     else str.append(indent + "\tnull"); // NOI18N
     this.dumpAttributes(FILE_ENTRY, i, str, indent);
   }
 }
Esempio n. 2
0
  // Dump the content of this bean returning it as a String
  public void dump(StringBuffer str, String indent) {
    String s;
    Object o;
    org.netbeans.modules.schema2beans.BaseBean n;
    str.append(indent);
    str.append("PropertyOne"); // NOI18N
    str.append(indent + "\t"); // NOI18N
    str.append("<"); // NOI18N
    s = this.getPropertyOne();
    str.append((s == null ? "null" : s.trim())); // NOI18N
    str.append(">\n"); // NOI18N
    this.dumpAttributes(PROPERTY_ONE, 0, str, indent);

    str.append(indent);
    str.append("PropertyTwo"); // NOI18N
    str.append(indent + "\t"); // NOI18N
    str.append("<"); // NOI18N
    s = this.getPropertyTwo();
    str.append((s == null ? "null" : s.trim())); // NOI18N
    str.append(">\n"); // NOI18N
    this.dumpAttributes(PROPERTY_TWO, 0, str, indent);
  }
Esempio n. 3
0
 public String dumpBeanNode() {
   StringBuffer str = new StringBuffer();
   str.append("EjbRefType\n"); // NOI18N
   this.dump(str, "\n  "); // NOI18N
   return str.toString();
 }
Esempio n. 4
0
  // Dump the content of this bean returning it as a String
  public void dump(StringBuffer str, String indent) {
    String s;
    Object o;
    org.netbeans.modules.schema2beans.BaseBean n;
    str.append(indent);
    str.append("Description[" + this.sizeDescription() + "]"); // NOI18N
    for (int i = 0; i < this.sizeDescription(); i++) {
      str.append(indent + "\t");
      str.append("#" + i + ":");
      str.append(indent + "\t"); // NOI18N
      str.append("<"); // NOI18N
      s = this.getDescription(i);
      str.append((s == null ? "null" : s.trim())); // NOI18N
      str.append(">\n"); // NOI18N
      this.dumpAttributes(DESCRIPTION, i, str, indent);
    }

    str.append(indent);
    str.append("EjbRefName"); // NOI18N
    str.append(indent + "\t"); // NOI18N
    str.append("<"); // NOI18N
    s = this.getEjbRefName();
    str.append((s == null ? "null" : s.trim())); // NOI18N
    str.append(">\n"); // NOI18N
    this.dumpAttributes(EJB_REF_NAME, 0, str, indent);

    str.append(indent);
    str.append("EjbRefType"); // NOI18N
    str.append(indent + "\t"); // NOI18N
    str.append("<"); // NOI18N
    s = this.getEjbRefType();
    str.append((s == null ? "null" : s.trim())); // NOI18N
    str.append(">\n"); // NOI18N
    this.dumpAttributes(EJB_REF_TYPE, 0, str, indent);

    str.append(indent);
    str.append("Home"); // NOI18N
    str.append(indent + "\t"); // NOI18N
    str.append("<"); // NOI18N
    s = this.getHome();
    str.append((s == null ? "null" : s.trim())); // NOI18N
    str.append(">\n"); // NOI18N
    this.dumpAttributes(HOME, 0, str, indent);

    str.append(indent);
    str.append("Remote"); // NOI18N
    str.append(indent + "\t"); // NOI18N
    str.append("<"); // NOI18N
    s = this.getRemote();
    str.append((s == null ? "null" : s.trim())); // NOI18N
    str.append(">\n"); // NOI18N
    this.dumpAttributes(REMOTE, 0, str, indent);

    str.append(indent);
    str.append("EjbLink"); // NOI18N
    str.append(indent + "\t"); // NOI18N
    str.append("<"); // NOI18N
    s = this.getEjbLink();
    str.append((s == null ? "null" : s.trim())); // NOI18N
    str.append(">\n"); // NOI18N
    this.dumpAttributes(EJB_LINK, 0, str, indent);
  }
Esempio n. 5
0
  // Dump the content of this bean returning it as a String
  public void dump(StringBuffer str, String indent) {
    String s;
    Object o;
    org.netbeans.modules.schema2beans.BaseBean n;
    str.append(indent);
    str.append("CheckpointLocation"); // NOI18N
    str.append(indent + "\t"); // NOI18N
    str.append("<"); // NOI18N
    s = this.getCheckpointLocation();
    str.append((s == null ? "null" : s.trim())); // NOI18N
    str.append(">\n"); // NOI18N
    this.dumpAttributes(CHECKPOINT_LOCATION, 0, str, indent);

    str.append(indent);
    str.append("QuickCheckpoint"); // NOI18N
    str.append(indent + "\t"); // NOI18N
    str.append("<"); // NOI18N
    s = this.getQuickCheckpoint();
    str.append((s == null ? "null" : s.trim())); // NOI18N
    str.append(">\n"); // NOI18N
    this.dumpAttributes(QUICK_CHECKPOINT, 0, str, indent);

    str.append(indent);
    str.append("CheckpointedMethods"); // NOI18N
    n = (org.netbeans.modules.schema2beans.BaseBean) this.getCheckpointedMethods();
    if (n != null) n.dump(str, indent + "\t"); // NOI18N
    else str.append(indent + "\tnull"); // NOI18N
    this.dumpAttributes(CHECKPOINTED_METHODS, 0, str, indent);
  }
Esempio n. 6
0
 public String dumpBeanNode() {
   StringBuffer str = new StringBuffer();
   str.append("DeploymentPlan\n"); // NOI18N
   this.dump(str, "\n  "); // NOI18N
   return str.toString();
 }
Esempio n. 7
0
  /** Parse the document, calling back the handler */
  void parse() throws IOException, SchemaParseException {
    char c;
    StringBuffer curWord = new StringBuffer();
    int wordContext = WORD_NO_CONTEXT;
    int level = 0;

    while ((c = this.getNext()) != '\0') {
      switch (c) {
        case '<':
          //	Check if we have <! or <--
          char c1 = this.getNext();
          if (c1 == '!') {
            //	Check if the next word is reserved
            if (wordContext != WORD_NO_CONTEXT && wordContext != WORD_COMMENT) {
              System.err.println(
                  "Error: found a '<!' sequence within another '<!' sequence"); // NOI18N
              throw new SchemaParseException(
                  "Warning: found a '<!' sequence within another '<!' sequence"); // NOI18N
            }
            if (wordContext != WORD_COMMENT) wordContext = WORD_CHECK;
          } else if (c1 == '?') {
            wordContext = WORD_PI;
          } else {
            curWord.append(c);
            curWord.append(c1);
          }
          break;
        case '>':
          //	Might be the end of a comment or <!element
          switch (wordContext) {
            case WORD_NO_CONTEXT:
              // System.err.println("Error: Found '>' without '<!'");// NOI18N
              throw new SchemaParseException("Error: Found '>' without '<!'"); // NOI18N
            case WORD_PI:
              String word = curWord.toString();
              int len = word.length();
              if (word.endsWith("?")) { // NOI18N
                //	Ignore any PI
                curWord.delete(0, len);
                wordContext = WORD_NO_CONTEXT;
              } else curWord.append(c);
              break;
            case WORD_COMMENT:
              word = curWord.toString();
              len = word.length();
              if (word.endsWith("--")) { // NOI18N
                this.handler.endElement();
                curWord.delete(0, len);
                wordContext = WORD_NO_CONTEXT;
              } else curWord.append(c);
              break;
            case WORD_ENTITY:
              wordContext = WORD_NO_CONTEXT;
              break;
            default:
              wordContext = this.processWord(curWord, wordContext);
              this.handler.endElement();
              wordContext = WORD_NO_CONTEXT;
          }
          break;
        case '(':
          if (wordContext == WORD_ELEMENT || wordContext == WORD_ATTLIST) {
            wordContext = this.processWord(curWord, wordContext);
            this.handler.startGroupElements();
          } else curWord.append(c);
          break;
        case ')':
          wordContext = this.processWord(curWord, wordContext);
          if (wordContext == WORD_ELEMENT || wordContext == WORD_ATTLIST) {
            int instance = this.getInstanceValue(this.peekNext());
            //	Get rid of the extra character
            if (instance != Common.TYPE_1) this.getNext();
            this.handler.endGroupElements(instance);
          } else curWord.append(c);
          break;
        case '|':
          wordContext = this.processWord(curWord, wordContext);
          if (wordContext == WORD_ELEMENT || wordContext == WORD_ATTLIST) this.handler.character(c);
          else curWord.append(c);
          break;
        case '\n':
        case '\r':
        case '\t':
        case ' ':
        case ',':
          wordContext = this.processWord(curWord, wordContext);
          break;
          //
        default:
          curWord.append(c);
      }
    }

    if (wordContext != WORD_NO_CONTEXT) System.out.println("Warning: unexpected EOF"); // NOI18N
  }