Package com.uic.ase.proj.xbn.string

Examples of com.uic.ase.proj.xbn.string.SOBStringBuffer


    @param  b_subTS  If true, then display all toStrings for the sub-Named objects.  If false, then display the <I>names</I> of all internal Named objects.
   **/
  public String toString(boolean b_subTS)  {
    String sName = uStr.getConditional("getName()=", getName(), ", ");

    SOBStringBuffer ssbSubTS = new SOBStringBuffer(sES);
    if(b_subTS)  {
      (new UtilArray()).appendTSList(ssbSubTS, getAPNamed().getAONShallowClone(), null, "  |  ", null, null, null, null);
    else  {
      ssbSubTS.append("SUB TO STRINGS NOT DISPLAYED");
    }

    return this.getClass().getName() + ":  " + sName + "[" + ssbSubTS.toString() + "]";
  }
View Full Code Here


    if(optr_dbg.isOn())  {
      optr_dbg.write("------------------\nGetting dependencies...START\n------------------");
      optr_dbg.write(df.toString());
    }

    acsdAllPkgs = analyzeDependencies(acsdAllPkgs, optr_dbg, df, getPackageName(df, iIdxSlashB4Pkg), iIdxSlashB4Pkg, acsAcceptPre, b_crashIfSelfDependent, (new SOBStringBuffer(sES)), (new UtilSOB()));

    optr_dbg.write("------------------\nGetting dependencies...END\n------------------");

    s_acs_acs[] aSacsacs = new s_acs_acs[acsdAllPkgs.size()];
    for(int i = 0; i < acsdAllPkgs.size(); i++)  {
View Full Code Here

      util_sob.replaceUntil(sob_sb, sLINE_SEP + sLINE_SEP, sLINE_SEP);

      FLRString flrs = new FLRString(sob_sb.getStringBuffer());

      while(flrs.hasMoreLines())  {
        SOBStringBuffer ssbLine = new SOBStringBuffer(flrs.getNextLine());
        ssbLine.trim();
        if(ssbLine.length() < ||  ssbLine.startsWith("package"))  {
          continue;
        }

        if(ssbLine.startsWith("import"))  {

          //7 is the character *2* after the "t", because
          //there's expected to be a space or tab there.

          //We want to eliminate the final dot, class name
          //and ending semicolon;
          ssbLine.trim();
          ssbLine.delete(0, "import".length());
          ssbLine.trim();
          ssbLine.deleteCharAt(ssbLine.length() - ";".length());
          String sFQImportClass = ssbLine.toString();
          String sFQImportPkg = ssbLine.substring(0, sFQImportClass.lastIndexOf(sPD));

          if(b_crashIfSelfDependent  &&
               s_package.equals(sFQImportPkg))  {
            throwAX("getPackageDependencies:  Package '" + s_package + "' is dependent on itself, and b_crashIfSelfDependent equals true.  The class '" + sJavaFile + "' is importing '" + sFQImportClass + "'.");
          }

          //If acs_acceptPre is non-null
          boolean bAccept = false;
          if(acs_acceptPre.size() == 0)  {
            bAccept = true;
          else  {
            String sPkgPre = sFQImportPkg.substring(0, ssbLine.indexOf(sPD));
            sPkgPre = sPkgPre.trim();
            bAccept = acs_acceptPre.doesExist(sPkgPre);
          }

          if(bAccept)  {
View Full Code Here

    <P>Get the element at the requested array index, as an SOBStringBuffer.</P>

    @return  <CODE>(new <A HREF="~JD~ssb#ssb(s)~EJD~">SOBStringBuffer</A>(<A HREF="~JD~pa#getString(i)~EJD~">getString</A>(i_dx)))</CODE>
   **/
  public SOBStringBuffer getSOBStringBuffer(int i_dx)  {
    return(new SOBStringBuffer(getString(i_dx)));
  }
View Full Code Here

    @param  s_callingClsFnc  The function from which the potential error message should appear as if it is coming from.
    @return  <CODE>(new <A HREF="~JD~ssb#ssb(sb)~EJD~">SOBStringBuffer</A>(str_buffer))</CODE>
   **/
  public final SOBStringBuffer getSOBSB(StringBuffer str_buffer, String s_sbDesc, String s_callingClsFnc)  {
    try  {
      return (new SOBStringBuffer(str_buffer));
    catch(NullPointerException npx)  {
      throwAXSpoof(s_callingClsFnc + ":  " + s_sbDesc + " is null.");
    }

    //Never reached.  Required for compile.
View Full Code Here

    for(int i = 0; i < a_stringBuffer.length; i++)  {
      if(a_stringBuffer[i] == null)  {
        assb[i] = null;

      else  {
        assb[i] = new SOBStringBuffer(a_stringBuffer[i]);
      }
    }

    return assb;
  }
View Full Code Here

    @param  optr_dbg  The Outputter to use for debugging.  May not be null.
    @exception  ConfigFormatException  If any of the formatting rules for the source text of a <A HREF="~JD~cr~EJD~">ConfigReader</A> are violated.
   **/
  public CRLineAnalyzer(StringBuffer sb_line, int i_lineNumber, int i_mlcStartLine, int i_varStartLine, StringOrBuffer sob_varStartName, char c_varStartDelim, Outputter optr_dbg, CRLAObjects crla_objectsthrows ConfigFormatException  {
    //Validate parameters...START
      SOBStringBuffer ssbLine = new SOBStringBuffer(sb_line);

      if(!ssbLine.endsWith(sLINE_SEP))  {
        //This is the last line in the source text.
        bLastLine = true;

      else  {
        //The line *does* end with the line separator.
        int iAnotherLS = ssbLine.indexOf(sLINE_SEP, 0, ssbLine.length() - sLINE_SEP.length());
        if(iAnotherLS != -1)  {
          throwAX("constructor:  sb_line contains a line separator (sLINE_SEP: '" + crlao.uStr.getVisible(sLINE_SEP) + "') at somewhere other than the end (at array index " + iAnotherLS + ").");
        }
      }

      if(i_lineNumber < 1)  {
        throwAX("constructor:  i_lineNumber (" + i_lineNumber + ") is less than one.");
      }

      cibMLCVarStartLines(i_lineNumber, i_mlcStartLine, "mlc", i_varStartLine, "var");
      cibMLCVarStartLines(i_lineNumber, i_varStartLine, "var", i_mlcStartLine, "mlc");

      if(i_varStartLine != -&&
          (sob_varStartName == null  ||  sob_varStartName.length() < 1))  {
        throwAX("constructor:  i_varStartLine equals (" + i_varStartLine + "), but sob_varStartName ('" + sob_varStartName + "') is null or zero characters in length.");
      }

      throwAXIfNull(optr_dbg, "optr_dbg", sCNSTR);
    //Validate parameters...END

    //To shorten code, and for better error messages (see
    //throwCFX)
    crlao = crla_objects;
    iLineNumber = i_lineNumber;
    iMLCStartLine = i_mlcStartLine;
    iVarStartLine = i_varStartLine;
    sobVarStartName = sob_varStartName;
    if(sobVarStartName == null)  {
      cVarStartDelim = ' ';
     else  {
      cVarStartDelim = c_varStartDelim;
    }
    optr = optr_dbg;

    InsideWhitespace iwLine = new InsideWhitespace(ssbLine, crlao.uSOB);

    if(isComment(iwLine))  {
      return;
    }

    //This line is not a comment.  It is either the first line
    //in a variable, or the second or subsequent line in the
    //value.

    int iDelimIW = -1;
    int iDelimActual = -1;
    if(iwLine.length() > 0)  {
      iDelimIW = crlao.usVarDelims.getIdx1stUnesc2BEsc(iwLine);
      iDelimActual = iwLine.getActualIdx(iDelimIW);
    }

    if(iDelimIW == -1)  {
      //No delimiters exist on this line.  This line is
      //either not part of any variable, value or comment, or
      //this is the second or subsequent line in a value.

      if(iVarStartLine != -1)  {
        //This is the second or subsequent line in a
        //variable's value.
        sVarValue = ssbLine.toString();

      else  {
        //This line is not the second/subsequent line in a
        //value.  It is a line *between* variables or
        //comments.

        if(iwLine.length() > 0)  {
          String sMLCEnd = sES;
          if(iwLine.charAt(iwLine.length() - 1) == crlao.crc.getCRCDelimiters().getMLCEnd())  {
            //Special condition, for a clearer error message
            sMLCEnd = ".  Also note:  The last character in this line is a multi-line comment end delimiter ('" + crlao.crc.getCRCDelimiters().getMLCEnd() + "').  If this is meant to be the end of a multi-line comment, it was never started";
          }

          throwCFX(iwLine, "Stray text found.  This line is not part of any variable or comment, but contains non-whitespace characters.  Note that cr_config.getCRCVariable().is1stLineWSEmptyString() equals " + crlao.crc.getCRCVariable().is1stLineWSEmptyString() + sMLCEnd);
        }
      }
      //This line is whitespace only, and can be safely ignored.


    else  {
      //This line contains an unescaped variable delimiter
      //and is therefore the first in a variable's value.

      sVarName = ssbLine.substring(0, iDelimActual);
      cDelimiter = ssbLine.charAt(iDelimActual);

      iVarStartLine = iLineNumber;
      sobVarStartName = new SOBString(sVarName);
      cVarStartDelim = cDelimiter;

      if(iDelimIW == (iwLine.length() - 1))  {
        //The delimiter is the last non-whitespace character on
        //the line.  There is no space after it for other
        //unescaped variable delimiters to exist.

        if(iDelimActual == (ssbLine.length() - 1))  {
          //The delimiter is truly the last character in the
          //line.

          sVarValue = sES;

          //(This actually means that this line is the last in
          //the file.  All lines previous to it end with a
          //line separator.)

        else  {
          //The delimiter is followed by some whitespace.
          sVarValue = ssbLine.substring(iDelimActual + 1);
        }

      }  else  {
        //There are non-whitespace characters following the
        //delimiter.

        int iDelimOther = crlao.usVarDelims.getIdx1stUnesc2BEsc(iwLine, (iDelimIW + 1));
        if(iDelimOther != -1)  {
          throwCFX(iwLine, iDelimOther, "A second unescaped variable delimiter was found");
        }

        //No other (unescaped) variable delimiters exist.
        String s = ssbLine.substring(iDelimActual + 1);

        String sPotentiallyNull = s.trim();
        if(sPotentiallyNull.equals(crlao.crc.getCRCVariable().getNullValue()))  {
          sVarValue = null;
          bValueNull = true;
View Full Code Here

          //  if(!crla.hasValue())  {
          //    throwAX("SANITY CHECK FAILURE:  crla has a name '" + crla.getName() + "', but not a value for it.  Bad programmer.  Bad *bad* programmer.");
          //  }
          //SANITY CHECK...end

          ssbVarName = new SOBStringBuffer(crla.getName());
          cVarDelim = crla.getDelimiter();
          iVarStartLine = iLine;
          if(crla.getValue() == null)  {
            bSLValue = true;
          else if(cr_config.getCRCVariable().is1stLineWSEmptyString()  &&
                     crlao.uStr.hasLegalChars(crla.getValue(), UtilChar.getAOCInvisible()))  {
            bSLValue = true;
          }

          if(bSLValue)  {
            //This is a single-line value.  Process it.
            String sValue = ((crla.getValue() != null""  null);
            addVariable(iVarStartLine, ssbVarName, cVarDelim, null, sValue, optr_dbg, cr_filter, false, crlao, acoSbsbc_cfgVars);
            initVarState();
            continue;
          }

        }

        if(!bSLValue  &&  crla.hasValue())  {
          //This is the second or subseqent line in a
          //*multi*-line value (at least, it's multi-line
          //before trimming, which potentially happens
          //below).
          if(ssbValue == null)  {
            ssbValue = new SOBStringBuffer(crla.getValue());
          else  {
            ssbValue.append(crla.getValue());
          }
        }

View Full Code Here

    if(sTmplDir.equals(sZERO))  {
      optrDbg.write("No templates supplied.  Will output plain text only...");
    else  {
      optrDbg.write("Templates exist in '" + sTmplDir + "'.  Loading...");

      SOBStringBuffer ssb = new SOBStringBuffer(sES);
      util.appendFileText(ssb, sTmplDir + sTMPL_DOS_NOTHING);
      sDOSctnNothing = ssb.toString();

      ssb.deleteAll();
      util.appendFileText(ssb, sTmplDir + sTMPL_DOBS_NOTHING);
      sDOBSctnNothing = ssb.toString();

      ssb.deleteAll();
      util.appendFileText(ssb, sTmplDir + sTMPL_DOS_ROW_NEWLINE);
      sDOSRNewline = ssb.toString();

      ssb.deleteAll();
      util.appendFileText(ssb, sTmplDir + sTMPL_DOBS_ROW_NEWLINE);
      sDOBSRNewline = ssb.toString();

      try  {
        tog3Pkg = (new GetTOG3FFile(
          sTmplDir + sTMPL_PACKAGE,
          sTMPL_PKG_package_name,
View Full Code Here

    return ao;
  }

  public String toString()  {
    StringBuffer sb = new StringBuffer(this.getClass().getName()).append(":  ");
    (new UtilArray()).appendTSList((new SOBStringBuffer(sb)), ao, "[", "  |  ", "]", "isNull()=true", "length()=0", null);

    return sb.toString();
  }
View Full Code Here

TOP

Related Classes of com.uic.ase.proj.xbn.string.SOBStringBuffer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.