Changeset 10372


Ignore:
Timestamp:
01/23/08 19:45:25 (4 years ago)
Author:
sys
Message:

Remplacement StringBuffer -> StringBuilder

Location:
trunk
Files:
1 deleted
205 edited
4 moved

Legend:

Unmodified
Added
Removed
  • trunk/Jav_Audio/com/scenari/s/audio/Util.java

    r6863 r10372  
    109109         */ 
    110110        public static String joinMap(List pList, List pKeys, List pValues) { 
    111                 StringBuffer vBuf = new StringBuffer(); 
     111                StringBuilder vBuf = new StringBuilder(); 
    112112                for (int i = 0; i < pList.size(); i++) { 
    113113                        Object vKey = pList.get(i); 
  • trunk/Jav_Audio/com/scenari/s/audio/transform/TransformerSox.java

    r9961 r10372  
    161161                } 
    162162                if(vH == null && vM == null) return Float.toString(pTc); 
    163                 StringBuffer vBuf = new StringBuffer(12); 
     163                StringBuilder vBuf = new StringBuilder(12); 
    164164                if(vH != null) { 
    165165                        vBuf.append(vH); 
  • trunk/Jav_BDP/com/scenari/m/bdp/facet/chain/FacetChainLoader.java

    r10215 r10372  
    125125        protected ArrayList fListAlreadyImported = null; 
    126126         
    127         protected StringBuffer fBuf = null; 
     127        protected StringBuilder fBuf = null; 
    128128 
    129129        /** 
     
    203203                // 
    204204                else if (TAG_BEANSHELL.equals(pLocalName)) { 
    205                         fBuf = new StringBuffer(4096); 
     205                        fBuf = new StringBuilder(4096); 
    206206                } 
    207207 
  • trunk/Jav_BDP/com/scenari/m/bdp/facet/outline/FacetOutline.java

    r10086 r10372  
    215215                        if (pIdSubItem != null && pIdSubItem.length() > 0) vTransf.setParameter("pIdSubItem", pIdSubItem); 
    216216                        InputStream vSream = vWsp.hGetRepository().hGetContentAccess().hReadStream(pItemDef.hGetId(), null, null, null, null); 
    217                         //StringBuffer vBufUrl = new StringBuffer(pItemDef.hGetSpace().length()+pItemDef.hGetCode().length()+20); 
     217                        //StringBuilder vBufUrl = new StringBuilder(pItemDef.hGetSpace().length()+pItemDef.hGetCode().length()+20); 
    218218                        //vBufUrl.append("intern://"); 
    219219                        //HQCode.hBuildURL(vBufUrl, pItemDef.hGetSpace(), pItemDef.hGetCode()); 
  • trunk/Jav_BDP/com/scenari/m/bdp/item/HQCode.java

    r8485 r10372  
    111111         */ 
    112112        public static final String hGetUri(String pSpace, String pCode) { 
    113                 return new StringBuffer(pSpace.length()+pCode.length()+1).append(pSpace).append(URI_SEPARATOR).append(pCode).toString(); 
     113                return new StringBuilder(pSpace.length()+pCode.length()+1).append(pSpace).append(URI_SEPARATOR).append(pCode).toString(); 
    114114        } 
    115115         
     
    216216                        return pSuffixe;         
    217217                } 
    218                 StringBuffer vBuf = new StringBuffer(pStr.length() + pSuffixe.length() + 2); 
     218                StringBuilder vBuf = new StringBuilder(pStr.length() + pSuffixe.length() + 2); 
    219219                if(pStr.indexOf('%') >= 0 || pStr.indexOf('_') >= 0) { 
    220220                        for (int i = 0; i < pStr.length(); i++) { 
     
    253253         *  
    254254         * Note : Le caractère simple guillement (') EST protégé. Le chaine ajoutée 
    255          * au StringBuffer ne peut donc être utilisé QUE "en dur" dans un statement 
     255         * au StringBuilder ne peut donc être utilisé QUE "en dur" dans un statement 
    256256         * et PAS en paramètre dynamique dans un prepareStatement.  
    257257         *  
    258258         * @param pStr Code à protéger 
    259259         */ 
    260         public static final void hEscapeCodeInSql(StringBuffer pBuf, String pStr, String pSuffixe) { 
     260        public static final void hEscapeCodeInSql(StringBuilder pBuf, String pStr, String pSuffixe) { 
    261261                if(pStr == null || pStr.length() == 0) { 
    262262                        if(pSuffixe!= null) pBuf.append(pSuffixe); 
     
    299299         * @since 3.0 
    300300         */ 
    301         public static final void hBuildUri(StringBuffer pBuf, String pSpace, String pCode) { 
     301        public static final void hBuildUri(StringBuilder pBuf, String pSpace, String pCode) { 
    302302                pBuf.append(URI_SEPARATOR); 
    303303                pBuf.append(pSpace); 
     
    312312         * @since 3.0 
    313313         */ 
    314         public static final void hBuildUri(StringBuffer pBuf, String pSpace, String pCode, String pUriRes, String pIdSubItem) { 
     314        public static final void hBuildUri(StringBuilder pBuf, String pSpace, String pCode, String pUriRes, String pIdSubItem) { 
    315315                pBuf.append(URI_SEPARATOR); 
    316316                pBuf.append(pSpace); 
     
    334334                if(pUriRes!=null) vLen += pUriRes.length(); 
    335335                if(pIdSubItem!=null) vLen += pIdSubItem.length(); 
    336                 StringBuffer vBuf = new StringBuffer(vLen); 
     336                StringBuilder vBuf = new StringBuilder(vLen); 
    337337                hBuildUri(vBuf, pSpace, pCode, pUriRes, pIdSubItem); 
    338338                return vBuf.toString(); 
  • trunk/Jav_BDP/com/scenari/m/bdp/item/IWReqItemJdbc.java

    r1701 r10372  
    5757         * @throws Exception 
    5858         */ 
    59         public void wWriteClauseFrom(StringBuffer pBuf, IHRepository pRepository) throws Exception; 
     59        public void wWriteClauseFrom(StringBuilder pBuf, IHRepository pRepository) throws Exception; 
    6060         
    6161        /** 
     
    6464         * @param pRepository Permettra de gérer des cas particuliers en fonction du type de repository et du SGBD (version Oracle, driver...) 
    6565         */ 
    66         public void wWriteClauseWhere(StringBuffer pBuf, IHRepository pRepository) throws Exception; 
     66        public void wWriteClauseWhere(StringBuilder pBuf, IHRepository pRepository) throws Exception; 
    6767         
    6868        /** 
     
    7171         * @param pRepository Permettra de gérer des cas particuliers en fonction du type de repository et du SGBD (version Oracle, driver...) 
    7272         */ 
    73         public void wWriteClauseExtension(StringBuffer pBuf, IHRepository pRepository) throws Exception; 
     73        public void wWriteClauseExtension(StringBuilder pBuf, IHRepository pRepository) throws Exception; 
    7474 
    7575        /** 
     
    7979         * @throws Exception 
    8080         */ 
    81         public void wWriteClauseHint(StringBuffer pBuf, IHRepository pRepository) throws Exception; 
     81        public void wWriteClauseHint(StringBuilder pBuf, IHRepository pRepository) throws Exception; 
    8282         
    8383        /** 
  • trunk/Jav_BDP/com/scenari/m/bdp/item/base/HItem.java

    r10086 r10372  
    204204 
    205205                /** Buffer pour les contenus des tags. */ 
    206                 protected StringBuffer fBuf = new StringBuffer(); 
     206                protected StringBuilder fBuf = new StringBuilder(); 
    207207 
    208208                /** ContentHandler déporté. */ 
  • trunk/Jav_BDP/com/scenari/m/bdp/itemtype/XItemTypeSaxHandler.java

    r10086 r10372  
    9191 
    9292        /** Buffer. */ 
    93         //protected StringBuffer fBuf = new StringBuffer(); 
     93        //protected StringBuilder fBuf = new StringBuilder(); 
    9494        /** 
    9595         * Constructor for XItemTypeSaxHandler. 
  • trunk/Jav_BDP/com/scenari/m/bdp/module/genitem/HModuleGenItemBeanshellLoader.java

    r7979 r10372  
    5959 
    6060        /** Script. */ 
    61         protected StringBuffer fTextBuf = new StringBuffer(256); 
     61        protected StringBuilder fTextBuf = new StringBuilder(256); 
    6262 
    6363        /** 
  • trunk/Jav_BDP/com/scenari/m/bdp/module/genpresc/HModuleGenPrescWsp.java

    r10086 r10372  
    176176         */ 
    177177        protected final String xGetUriIhm() { 
    178                 StringBuffer vBuf = new StringBuffer(fUiiIhm.length() + 48); 
     178                StringBuilder vBuf = new StringBuilder(fUiiIhm.length() + 48); 
    179179                vBuf.append('/'); 
    180180                vBuf.append(fItemType.hGetWorkspace().hGetCodeWorkspace()); 
     
    191191                String vCd = pItem.hGetCode(); 
    192192                String vWsp = pItem.hGetWorkspace().hGetCodeWorkspace(); 
    193                 StringBuffer vBuf = new StringBuffer(vSp.length() + vCd.length() + vWsp.length() + 8); 
     193                StringBuilder vBuf = new StringBuilder(vSp.length() + vCd.length() + vWsp.length() + 8); 
    194194                vBuf.append('/'); 
    195195                vBuf.append(vWsp); 
     
    204204         */ 
    205205        public final String hCreateUriFc() throws Exception { 
    206                 StringBuffer vBuf = new StringBuffer(fUiiJeuFc.length() + 48); 
     206                StringBuilder vBuf = new StringBuilder(fUiiJeuFc.length() + 48); 
    207207                vBuf.append('/'); 
    208208                vBuf.append(fItemType.hGetWorkspace().hGetCodeWorkspace()); 
  • trunk/Jav_BDP/com/scenari/m/bdp/module/rename/uii/WRenamedUiiStream.java

    r10214 r10372  
    8686                                                // On clone cette liste d'attributs. 
    8787                                                AttributesImpl vAtts = new AttributesImpl(pAtts); 
    88                                                 StringBuffer vBuf = new StringBuffer(vNewSpace.length() + vNewCode.length() + 10); 
     88                                                StringBuilder vBuf = new StringBuilder(vNewSpace.length() + vNewCode.length() + 10); 
    8989                                                HQCode.hBuildUri(vBuf, vNewSpace, vNewCode); 
    9090                                                vAtts.setValue(vIdx, vBuf.toString()); 
  • trunk/Jav_BDP/com/scenari/m/bdp/module/viewvirtualfolder/HVirtualFolder.java

    r7417 r10372  
    210210                                        vResult = ((IHSourceServer) fServer).hFindElemByUri(pUriRes); 
    211211                                } else { 
    212                                         String vUri = new StringBuffer(((String) fUriRootRes).length() + pUriRes.length()).append(fUriRootRes).append(pUriRes).toString(); 
     212                                        String vUri = new StringBuilder(((String) fUriRootRes).length() + pUriRes.length()).append(fUriRootRes).append(pUriRes).toString(); 
    213213                                        vResult = ((IHSourceServer) fServer).hFindElemByUri(vUri); 
    214214                                } 
     
    219219                                        String vUri = (String) ((Object[]) fUriRootRes)[i]; 
    220220                                        if (vUri != null) { 
    221                                                 vUri = new StringBuffer(vUri.length() + pUriRes.length()).append(vUri).append(pUriRes).toString(); 
     221                                                vUri = new StringBuilder(vUri.length() + pUriRes.length()).append(vUri).append(pUriRes).toString(); 
    222222                                        } else { 
    223223                                                vUri = pUriRes; 
     
    229229                        if (vResult.hGetStatus() == IHSourceElem.STATUS_NONE) { 
    230230                                if (fParent != null) { 
    231                                         String vUri = new StringBuffer(fName.length() + 1 + pUriRes.length()).append('/').append(fName).append(pUriRes).toString(); 
     231                                        String vUri = new StringBuilder(fName.length() + 1 + pUriRes.length()).append('/').append(fName).append(pUriRes).toString(); 
    232232                                        vResult = fParent.wFindElem(vUri); 
    233233                                } 
     
    321321                                if (vSource.fParent != null) { 
    322322                                        if (vPrefixUri != null) { 
    323                                                 vPrefixUri = new StringBuffer(1 + vSource.fName.length() + vPrefixUri.length()).append('/').append(vSource.fName).append(vPrefixUri).toString(); 
     323                                                vPrefixUri = new StringBuilder(1 + vSource.fName.length() + vPrefixUri.length()).append('/').append(vSource.fName).append(vPrefixUri).toString(); 
    324324                                        } else { 
    325325                                                vPrefixUri = "/".concat(vSource.fName); 
  • trunk/Jav_BDP/com/scenari/m/bdp/service/tabpresc/HSDialogTabPresc.java

    r10169 r10372  
    488488        protected final String xCreateUriPublication(IHModuleGenPresc pModule, String pUriSubInst) throws Exception { 
    489489                String vCdWsp = fWorkspace.hGetCodeWorkspace(); 
    490                 StringBuffer vBuf = new StringBuffer(vCdWsp.length() + fItem.fSpace.length() + fItem.fCode.length() + ((pUriSubInst == null) ? pModule.hGetCodeModule().length() : pUriSubInst.length()) + 20); 
     490                StringBuilder vBuf = new StringBuilder(vCdWsp.length() + fItem.fSpace.length() + fItem.fCode.length() + ((pUriSubInst == null) ? pModule.hGetCodeModule().length() : pUriSubInst.length()) + 20); 
    491491                vBuf.append('/'); 
    492492                vBuf.append(vCdWsp); 
     
    505505         */ 
    506506        protected final String xCreateUriGenInWsp(IHModuleGenPresc pModule, String pUriSubInst) throws Exception { 
    507                 StringBuffer vBuf = new StringBuffer(fItem.fSpace.length() + fItem.fCode.length() + ((pUriSubInst == null) ? pModule.hGetCodeModule().length() : pUriSubInst.length()) + 20); 
     507                StringBuilder vBuf = new StringBuilder(fItem.fSpace.length() + fItem.fCode.length() + ((pUriSubInst == null) ? pModule.hGetCodeModule().length() : pUriSubInst.length()) + 20); 
    508508                HQCode.hBuildUri(vBuf, fItem.fSpace, fItem.fCode); 
    509509                vBuf.append('/'); 
  • trunk/Jav_BDP/com/scenari/m/bdp/service/tabsupport/HSDialogTabSupport.java

    r10138 r10372  
    426426         */ 
    427427        protected final String xCreateUriGenInWsp(IHModuleGenPresc pModule, String pUriSubInst) throws Exception { 
    428                 StringBuffer vBuf = new StringBuffer(fItem.hGetSpace().length() + fItem.hGetCode().length() + ((pUriSubInst == null) ? pModule.hGetCodeModule().length() :  pUriSubInst.length()) + 20); 
     428                StringBuilder vBuf = new StringBuilder(fItem.hGetSpace().length() + fItem.hGetCode().length() + ((pUriSubInst == null) ? pModule.hGetCodeModule().length() :  pUriSubInst.length()) + 20); 
    429429                HQCode.hBuildUri(vBuf, fItem.hGetSpace(), fItem.hGetCode()); 
    430430                vBuf.append('/'); 
     
    442442        protected final String xCreateUriPublication(IHModuleGenPresc pModule, String pUriSubInst) throws Exception { 
    443443                String vCdWsp = fWorkspace.hGetCodeWorkspace(); 
    444                 StringBuffer vBuf = new StringBuffer(vCdWsp.length() + fItem.hGetSpace().length() + fItem.hGetCode().length() + ((pUriSubInst == null) ? pModule.hGetCodeModule().length() :  pUriSubInst.length()) + 20); 
     444                StringBuilder vBuf = new StringBuilder(vCdWsp.length() + fItem.hGetSpace().length() + fItem.hGetCode().length() + ((pUriSubInst == null) ? pModule.hGetCodeModule().length() :  pUriSubInst.length()) + 20); 
    445445                vBuf.append('/'); 
    446446                vBuf.append(vCdWsp); 
  • trunk/Jav_BDP/com/scenari/m/bdp/service/viewfiles/HFileZipper.java

    r8395 r10372  
    124124                                } 
    125125                                String vName = pSource.hGetName(); 
    126                                 vPath = new StringBuffer(pParentPath.length() + vName.length() + 1).append(pParentPath).append(vName).append('/').toString(); 
     126                                vPath = new StringBuilder(pParentPath.length() + vName.length() + 1).append(pParentPath).append(vName).append('/').toString(); 
    127127                                ZipEntry vEntry = new ZipEntry(vPath); 
    128128                                Date vDate = pSource.hGetModifDate(); 
  • trunk/Jav_BDP/com/scenari/m/bdp/source/WSourceBdpItem.java

    r1757 r10372  
    184184                        vSubUri = "/".concat(pName); 
    185185                } else { 
    186                         vSubUri = new StringBuffer(fSubUri.length()+1+pName.length()).append(fSubUri).append('/').append(pName).toString(); 
     186                        vSubUri = new StringBuilder(fSubUri.length()+1+pName.length()).append(fSubUri).append('/').append(pName).toString(); 
    187187                } 
    188188                return new WSourceBdpItem(fParams, fWsp, fSpace, fCode, vSubUri, fItem, fAliasResolver).wInit(fStockSpace, this); 
  • trunk/Jav_BDP/com/scenari/m/bdp/source/WSourceBdpSpace.java

    r9979 r10372  
    113113                        //On est sur un espace 
    114114                        if (fSpace != null) { 
    115                                 return new WSourceBdpSpace(fParams, fWsp, new StringBuffer(fSpace.length() + 1 + pName.length()).append(fSpace).append(HQCode.SPACES_SEPARATOR).append(pName).toString(), false, fAliasResolver).wInit(fStockSpace, this); 
     115                                return new WSourceBdpSpace(fParams, fWsp, new StringBuilder(fSpace.length() + 1 + pName.length()).append(fSpace).append(HQCode.SPACES_SEPARATOR).append(pName).toString(), false, fAliasResolver).wInit(fStockSpace, this); 
    116116                        } else { 
    117117                                return new WSourceBdpSpace(fParams, fWsp, pName, false, fAliasResolver).wInit(fStockSpace, this); 
  • trunk/Jav_BDP/com/scenari/m/bdp/univers/support/WInstancesMgrBdp.java

    r10170 r10372  
    138138                String vIdInst; 
    139139                if (pUriSubInst != null) { 
    140                         vIdInst = new StringBuffer(vWsp.length() + vSp.length() + vCd.length() + pUriSubInst.length() + 5).append("D*").append(vWsp).append('*').append(vSp).append('*').append(vCd).append('*').append(pUriSubInst).toString(); 
    141                 } else { 
    142                         vIdInst = new StringBuffer(vWsp.length() + vSp.length() + vCd.length() + 4).append("D*").append(vWsp).append('*').append(vSp).append('*').append(vCd).toString(); 
     140                        vIdInst = new StringBuilder(vWsp.length() + vSp.length() + vCd.length() + pUriSubInst.length() + 5).append("D*").append(vWsp).append('*').append(vSp).append('*').append(vCd).append('*').append(pUriSubInst).toString(); 
     141                } else { 
     142                        vIdInst = new StringBuilder(vWsp.length() + vSp.length() + vCd.length() + 4).append("D*").append(vWsp).append('*').append(vSp).append('*').append(vCd).toString(); 
    143143                } 
    144144                if (pForceReload) { 
     
    187187                String vIdInst; 
    188188                if (pUriSubInst != null) { 
    189                         vIdInst = new StringBuffer(vWsp.length() + vSp.length() + vCd.length() + pUriSubInst.length() + 6).append("N*").append(vWsp).append('*').append(vSp).append('*').append(vCd).append('*').append(pCdGen).append('*').append(pUriSubInst).toString(); 
    190                 } else { 
    191                         vIdInst = new StringBuffer(vWsp.length() + vSp.length() + vCd.length() + pCdGen.length() + 5).append("N*").append(vWsp).append('*').append(vSp).append('*').append(vCd).append('*').append(pCdGen).toString(); 
     189                        vIdInst = new StringBuilder(vWsp.length() + vSp.length() + vCd.length() + pUriSubInst.length() + 6).append("N*").append(vWsp).append('*').append(vSp).append('*').append(vCd).append('*').append(pCdGen).append('*').append(pUriSubInst).toString(); 
     190                } else { 
     191                        vIdInst = new StringBuilder(vWsp.length() + vSp.length() + vCd.length() + pCdGen.length() + 5).append("N*").append(vWsp).append('*').append(vSp).append('*').append(vCd).append('*').append(pCdGen).toString(); 
    192192                } 
    193193                if (pForceReload) { 
  • trunk/Jav_BDP_FS/com/scenari/m/bdp/item/fs/FacetCache.java

    r9982 r10372  
    6464        protected File fFileCache; 
    6565 
    66         protected StringBuffer fNewDef; 
     66        protected StringBuilder fNewDef; 
    6767 
    6868        protected File fOldFile = null; 
     
    9797                                        } 
    9898                                        fCachDef.fStatus = CacheMgr.STATUS_INWRITE; 
    99                                         fNewDef = new StringBuffer(fCachDef.fDef.length() + 128); 
     99                                        fNewDef = new StringBuilder(fCachDef.fDef.length() + 128); 
    100100                                        fNewDef.append(fCachDef.fDef); 
    101101                                        return false; 
     
    170170                                fFileCache = File.createTempFile("fac", "", fCacheMgr); 
    171171                                int vTab = fCachDef.fDef.indexOf('\t'); 
    172                                 fNewDef = new StringBuffer(vTab + 128); 
     172                                fNewDef = new StringBuilder(vTab + 128); 
    173173                                fNewDef.append(fCachDef.fDef.substring(0, vTab)); 
    174174                        } 
  • trunk/Jav_BDP_FS/com/scenari/m/bdp/item/fs/HRepositoryFs2.java

    r10289 r10372  
    17041704                        } else if (fSsOverlay != null && pName == "ssOverlay") { 
    17051705                                // Surcharge d'une SS 
    1706                                 fSsOverlay.fContentOverlay = fSerilizerXml.hGetStringBuffer().toString(); 
     1706                                fSsOverlay.fContentOverlay = fSerilizerXml.hGetStringBuilder().toString(); 
    17071707                                if (fSsOverlay.fCodeeSs != null && fSsOverlay.fCodeeSs.length() > 0 && fSsOverlay.fSpaceSs != null && fSsOverlay.fSpaceSs.length() > 0 && fSsOverlay.fContentOverlay != null && fSsOverlay.fContentOverlay.length() > 0) { 
    17081708                                        if (fWspType.fOverlaysSs == null) { 
     
    17141714                                } 
    17151715                        } else if (pName == "config") { 
    1716                                 fWspType.fConfig = fSerilizerXml.hGetStringBuffer().toString(); 
     1716                                fWspType.fConfig = fSerilizerXml.hGetStringBuilder().toString(); 
    17171717                        } else if (pName == "wspOption") { 
    17181718                                WspType vParent = (WspType) fStackWspType.get(fStackWspType.size() - 1); 
     
    17591759                                fSsOverlay.fCodeeSs = pAttributes.getValue("code"); 
    17601760                                fSerilizerXml = new HExtraitSaxHandlerToXml(); 
    1761                                 fSerilizerXml.hSetStringBuffer(new StringBuffer(256)); 
     1761                                fSerilizerXml.hSetStringBuilder(new StringBuilder(256)); 
    17621762                                fSerilizerXml.hSetXmlReader(fXmlReader); 
    17631763                                if (fListPrefixesNs != null) { 
     
    17711771                                // Config pour les options. 
    17721772                                fSerilizerXml = new HExtraitSaxHandlerToXml(); 
    1773                                 fSerilizerXml.hSetStringBuffer(new StringBuffer(256)); 
     1773                                fSerilizerXml.hSetStringBuilder(new StringBuilder(256)); 
    17741774                                fSerilizerXml.hSetXmlReader(fXmlReader); 
    17751775                                if (fListPrefixesNs != null) { 
     
    24752475                                        if (vList.size() != vNbRoles) { 
    24762476                                                // Si le user a tous les droits, on ne spécifie rien. 
    2477                                                 StringBuffer vBuf = new StringBuffer(vList.size() * 12); 
     2477                                                StringBuilder vBuf = new StringBuilder(vList.size() * 12); 
    24782478                                                vBuf.append((String) vList.get(0)); 
    24792479                                                for (int j = 1; j < vList.size(); j++) { 
  • trunk/Jav_BDP_FS/com/scenari/m/bdp/item/fs/HRepositoryFsAsp.java

    r10289 r10372  
    341341         */ 
    342342        protected String xFilterDomainKey(String pDomainKey) { 
    343                 StringBuffer vBuf = new StringBuffer(16); 
     343                StringBuilder vBuf = new StringBuilder(16); 
    344344                for (int i = pDomainKey.length() - 1; i >= 0; i--) { 
    345345                        char vCh = pDomainKey.charAt(i); 
  • trunk/Jav_BDP_FS/com/scenari/m/bdp/item/fs/HWorkspaceFs.java

    r10124 r10372  
    799799                                                // C'est un sous-espace 
    800800                                                if (HQCode.hValidSpacePart(vName, false) == HQCode.VALID_STRING_OK) { 
    801                                                         String vNewSpaceStr = new StringBuffer(pSpace.length() + vName.length() + 1).append(pSpace).append(HQCode.SPACES_SEPARATOR).append(vName).toString(); 
     801                                                        String vNewSpaceStr = new StringBuilder(pSpace.length() + vName.length() + 1).append(pSpace).append(HQCode.SPACES_SEPARATOR).append(vName).toString(); 
    802802                                                        XSpaceSystem vNewSpace = (XSpaceSystem) pSpaceSystem.hGetOrCreateSpace(vNewSpaceStr, pSpace.length() + 1); 
    803803                                                        xLoadSystemSpace(vNewSpaceStr, vChild, vNewSpace); 
     
    963963        protected String xGetPrivateDataPath(String pSpace, String pCode) throws Exception { 
    964964                String vRoot = fPrivateData.getAbsolutePath(); 
    965                 StringBuffer vBuf = new StringBuffer(vRoot.length() + 1 + pSpace.length() + (pCode != null ? 1 + pCode.length() : 0)); 
     965                StringBuilder vBuf = new StringBuilder(vRoot.length() + 1 + pSpace.length() + (pCode != null ? 1 + pCode.length() : 0)); 
    966966                vBuf.append(vRoot); 
    967967                vBuf.append('/'); 
  • trunk/Jav_BDP_FS/com/scenari/m/bdp/item/fs/XItemCache.java

    r10215 r10372  
    288288        } 
    289289 
    290         public XString(StringBuffer pBuf, String pValToAdd) { 
     290        public XString(StringBuilder pBuf, String pValToAdd) { 
    291291            super(); 
    292292            fStart = pBuf.length(); 
     
    335335            if (fCurrentPb != null) { 
    336336                if (fCurrentPb.fMessage != null) { 
    337                     fCurrentPb.fMessage = new StringBuffer(fCurrentPb.fMessage.length() + pLength).append((String) fCurrentPb.fMessage).append(pChar, pStart, pLength).toString(); 
     337                    fCurrentPb.fMessage = new StringBuilder(fCurrentPb.fMessage.length() + pLength).append((String) fCurrentPb.fMessage).append(pChar, pStart, pLength).toString(); 
    338338                } else { 
    339339                    fCurrentPb.fMessage = new String(pChar, pStart, pLength); 
     
    469469                } 
    470470        } else { 
    471             StringBuffer vBuf = new StringBuffer(fSpace.length() + 1 + fCode.length()); 
     471            StringBuilder vBuf = new StringBuilder(fSpace.length() + 1 + fCode.length()); 
    472472            vBuf.append(fSpace); 
    473473            vBuf.append('/'); 
     
    601601     */ 
    602602    public final void hSaveInCache(IHItem pItem, boolean pFireEventUpdated, int pClientId) throws Exception { 
    603         StringBuffer vBuf = HPoolBuffer.get().hGetStringBuffer(); 
     603        StringBuilder vBuf = HPoolBuffer.get().hGetStringBuilder(); 
    604604        try { 
    605605            //On se délie des anciens fils. 
     
    707707            throw (Exception) HLogMgr.hAddMessage(e, "Echec au stockage d'un item dans le cache. (" + pItem.toString() + ")"); 
    708708        } finally { 
    709             HPoolBuffer.get().hFreeStringBuffer(vBuf); 
     709            HPoolBuffer.get().hFreeStringBuilder(vBuf); 
    710710        } 
    711711 
     
    730730        if (fFirstPointer != null) { 
    731731            //On ne peut pas supprimer physiquement cet item car d'autres items pointent dessus. 
    732             StringBuffer vBuf = HPoolBuffer.get().hGetStringBuffer(); 
     732            StringBuilder vBuf = HPoolBuffer.get().hGetStringBuilder(); 
    733733            try { 
    734734                fData = ""; 
     
    742742                throw (Exception) HLogMgr.hAddMessage(e, "Echec au stockage d'un item dans le cache."); 
    743743            } finally { 
    744                 HPoolBuffer.get().hFreeStringBuffer(vBuf); 
     744                HPoolBuffer.get().hFreeStringBuilder(vBuf); 
    745745            } 
    746746            //Revalidation des items pointeurs 
     
    10391039    public synchronized CacheMgr xGetCacheMgr() throws Exception { 
    10401040        if (fCacheMgr == null) { 
    1041             StringBuffer vBuf = new StringBuffer(fSpace.length() + 1 + fCode.length()); 
     1041            StringBuilder vBuf = new StringBuilder(fSpace.length() + 1 + fCode.length()); 
    10421042            vBuf.append(fSpace); 
    10431043            vBuf.append('/'); 
     
    10511051     * Construit une CharSequence si la valeur n'est pas null. 
    10521052     */ 
    1053     protected final XString xGetCharSeq(StringBuffer pBuf, String pValToAdd) { 
     1053    protected final XString xGetCharSeq(StringBuilder pBuf, String pValToAdd) { 
    10541054        if (pValToAdd != null) { 
    10551055            return new XString(pBuf, pValToAdd); 
  • trunk/Jav_BDP_FS/com/scenari/m/bdp/item/fs/XSpace.java

    r9453 r10372  
    477477                                        //Ce n'est pas un item de type dossier 
    478478                                        if (pParentsSpaces != null) { 
    479                                                 StringBuffer vBuf = new StringBuffer(pParentsSpaces.length() + 1 + vName.length()); 
     479                                                StringBuilder vBuf = new StringBuilder(pParentsSpaces.length() + 1 + vName.length()); 
    480480                                                vBuf.append(pParentsSpaces); 
    481481                                                vBuf.append(HQCode.SPACES_SEPARATOR); 
     
    616616                                                        vSp = vSpaceCache.fFirstChildItem.fSpace; 
    617617                                                } else { 
    618                                                         vSp = new StringBuffer(pSpace.length() + 1 + vSp.length()).append(pSpace).append(HQCode.SPACES_SEPARATOR).append(vSp).toString(); 
     618                                                        vSp = new StringBuilder(pSpace.length() + 1 + vSp.length()).append(pSpace).append(HQCode.SPACES_SEPARATOR).append(vSp).toString(); 
    619619                                                } 
    620620                                        } 
     
    626626                                                String vSp = (String) vChilds.get(vIdx); //On récupère le name avec la bonne casse 
    627627                                                if (pSpace != null) { 
    628                                                         vSp = new StringBuffer(pSpace.length() + 1 + vSp.length()).append(pSpace).append(HQCode.SPACES_SEPARATOR).append(vSp).toString(); 
     628                                                        vSp = new StringBuilder(pSpace.length() + 1 + vSp.length()).append(pSpace).append(HQCode.SPACES_SEPARATOR).append(vSp).toString(); 
    629629                                                } 
    630630                                                vSpaceCache.hRefreshAll(vSp, pWsp, pRefreshRootSystemSpaceToo); 
     
    657657                                                        vNewSpace.fNextSpace = fFirstChildSpace; 
    658658                                                        fFirstChildSpace = vNewSpace; 
    659                                                         String vSp = pSpace == null ? vName : new StringBuffer(pSpace.length() + 1 + vName.length()).append(pSpace).append(HQCode.SPACES_SEPARATOR).append(vName).toString(); 
     659                                                        String vSp = pSpace == null ? vName : new StringBuilder(pSpace.length() + 1 + vName.length()).append(pSpace).append(HQCode.SPACES_SEPARATOR).append(vName).toString(); 
    660660                                                        vNewSpace.hRefreshAll(vSp, pWsp, pRefreshRootSystemSpaceToo); 
    661661                                                } 
     
    764764         */ 
    765765        protected final String xGetUriSource(String pSpace, String pCode) { 
    766                 StringBuffer vBuf = new StringBuffer(pSpace.length() + pCode.length() + 2); 
     766                StringBuilder vBuf = new StringBuilder(pSpace.length() + pCode.length() + 2); 
    767767                vBuf.append('/'); 
    768768                vBuf.append(pSpace); 
  • trunk/Jav_BDP_FS/com/scenari/m/bdp/item/fs/XSpaceSystem.java

    r7927 r10372  
    7878    protected XSpace xCreateSpace(CharSequence pName, int pStart, int pEnd) throws Exception { 
    7979        String vRealName = pName.subSequence(pStart, pEnd).toString(); 
    80         StringBuffer vBuf = new StringBuffer(fSpace.length() + pEnd - pStart + 1); 
     80        StringBuilder vBuf = new StringBuilder(fSpace.length() + pEnd - pStart + 1); 
    8181        vBuf.append(fSpace); 
    8282        vBuf.append(HQCode.SPACES_SEPARATOR); 
  • trunk/Jav_BDP_FS/com/scenari/m/bdp/itemtype/fs/XItemTypeFsSaxHandler.java

    r10215 r10372  
    219219        } else if (fIsInPb && fValidPtr != null) { 
    220220            if(fValidPtr.fPbContent != null) { 
    221                 fValidPtr.fPbContent = new StringBuffer().append(fValidPtr.fPbContent).append(pChar, pStart, pLength).toString(); 
     221                fValidPtr.fPbContent = new StringBuilder().append(fValidPtr.fPbContent).append(pChar, pStart, pLength).toString(); 
    222222            } else { 
    223223                fValidPtr.fPbContent = new String(pChar, pStart, pLength); 
  • trunk/Jav_Builder/com/scenari/m/builder/gen/HModelGenerator.java

    r10138 r10372  
    294294                 * Charge la page d'URL pUrl. 
    295295                 */ 
    296                 public void loadPage(StringBuffer pBuf, IDynamicFile pPage) throws Exception { 
     296                public void loadPage(StringBuilder pBuf, IDynamicFile pPage) throws Exception { 
    297297                        pBuf.append(resolveDestUri2DestUrl(pPage.getDestUri())); 
    298298                } 
     
    301301                 *  
    302302                 */ 
    303                 public void loadUrl(StringBuffer pBuf, String pUrl) throws Exception { 
     303                public void loadUrl(StringBuilder pBuf, String pUrl) throws Exception { 
    304304                        pBuf.append(pUrl); 
    305305                } 
     
    309309                 *  
    310310                 * @param pBuf 
    311                  *            java.lang.StringBuffer 
     311                 *            java.lang.StringBuilder 
    312312                 * @exception java.lang.Exception 
    313313                 *                The exception description. 
    314314                 */ 
    315                 public void quit(StringBuffer pBuf) throws Exception { 
     315                public void quit(StringBuilder pBuf) throws Exception { 
    316316                } 
    317317 
     
    320320                 *  
    321321                 * @param pBuf 
    322                  *            java.lang.StringBuffer 
     322                 *            java.lang.StringBuilder 
    323323                 * @exception java.lang.Exception 
    324324                 *                The exception description. 
    325325                 */ 
    326                 public void goHome(StringBuffer pBuf) throws Exception { 
     326                public void goHome(StringBuilder pBuf) throws Exception { 
    327327                } 
    328328 
     
    895895                                String vExt = pModelePage != null ? pModelePage.hGetExtension(pDialog) : ""; 
    896896                                String vNameFile = vRoot.hNewRandomFile("a", vExt); 
    897                                 vPathFile = new StringBuffer(1 + vNameFile.length() + vExt.length()).append('a').append(vNameFile).append(vExt).toString(); 
     897                                vPathFile = new StringBuilder(1 + vNameFile.length() + vExt.length()).append('a').append(vNameFile).append(vExt).toString(); 
    898898                        } 
    899899                        vResult.fDocument = vRoot.hFindSource(vPathFile); 
     
    918918                                String vExt = pModelePage != null ? pModelePage.hGetExtension(pDialog) : ""; 
    919919                                String vNameFile = vRoot.hNewRandomFile("a", vExt); 
    920                                 vPathFile = new StringBuffer(1 + vNameFile.length() + vExt.length()).append('a').append(vNameFile).append(vExt).toString(); 
     920                                vPathFile = new StringBuilder(1 + vNameFile.length() + vExt.length()).append('a').append(vNameFile).append(vExt).toString(); 
    921921                        } 
    922922                        vResult.fDocument = vRoot.hFindSource(vPathFile); 
  • trunk/Jav_Builder/com/scenari/m/builder/gen/XhtmlXslTemplatePage.java

    r10346 r10372  
    6161import com.scenari.s.co.source.IHSource; 
    6262import com.scenari.s.co.source.IHSourceElem; 
     63import com.scenari.s.fw.util.xml.HEncodingXml; 
    6364import com.scenari.s.fw.utils.stream.HBufferStreamChar; 
    6465import com.scenari.xpath.XStringHelper; 
     
    234235                                pWriter.write("<style type=\"text/css\">\n"); 
    235236                                for (int i = 0; i < vList.size(); i++) { 
    236                                         pWriter.write((String) vList.get(i)); 
     237                                        HEncodingXml.hWriteTextValue(pWriter, (String) vList.get(i)); 
    237238                                        pWriter.write('\n'); 
    238239                                } 
  • trunk/Jav_Builder/com/scenari/m/builder/xpath/dom/ZXPathBuildGUID.java

    r2435 r10372  
    116116    public XObject xExecute(XPathContext pCtx) throws Exception { 
    117117        String vString = wGetAsString(pCtx, fArg.execute(pCtx)); 
    118         StringBuffer vBuf = new StringBuffer(36); 
     118        StringBuilder vBuf = new StringBuilder(36); 
    119119        BigInteger vVal = BigInteger.ZERO; 
    120120        //On construit le BigInt sur une Base 30 
  • trunk/Jav_Builder/com/scenari/m/builder/xpath/dom/ZXPathEncodeNameOd.java

    r2563 r10372  
    130130        boolean wroteUnencodedChar = false; 
    131131        int maxBytesPerChar = 10; // rather arbitrary limit, but safe for now 
    132         StringBuffer out = new StringBuffer(vString.length()); 
     132        StringBuilder out = new StringBuilder(vString.length()); 
    133133        ByteArrayOutputStream buf = new ByteArrayOutputStream(maxBytesPerChar); 
    134134 
  • trunk/Jav_Builder/com/scenari/m/builder/xpath/dom/ZXPathListXmlFromBuffer.java

    r4833 r10372  
    8989 
    9090        String vCdBuffer = wGetAsString(pCtx, fArg.execute(pCtx)); 
    91         StringBuffer vBuf = new StringBuffer(256); 
     91        StringBuilder vBuf = new StringBuilder(256); 
    9292        IHDialog vDialog = wGetDialogFromCtx(pCtx); 
    9393        IHContextBuffers vContext = ((IHContextBuffers) vDialog.hGetContext()); 
  • trunk/Jav_CO/Description fonctions XPath.xml

    r10347 r10372  
    782782                <morphologie format="initBuffer(pKeyBuffer, [pBuffer])"> 
    783783                        <parametre numero="1" type="String" resume="Clé du buffer."/> 
    784                         <parametre numero="2" type="Object" resume="buffer (objet java) : StringBuffer, Map, List, etc. Si pBuffer est nul ou non renseigné, il est supprimé."/> 
     784                        <parametre numero="2" type="Object" resume="buffer (objet java) : StringBuilder, Map, List, etc. Si pBuffer est nul ou non renseigné, il est supprimé."/> 
    785785                </morphologie> 
    786786        </fonction> 
  • trunk/Jav_CO/com/scenari/m/co/agent/HADialog.java

    r10037 r10372  
    549549         */ 
    550550        public String toString() { 
    551                 StringBuffer vBuf = new StringBuffer(256); 
     551                StringBuilder vBuf = new StringBuilder(256); 
    552552                vBuf.append("<dialogue cdAction=\""); 
    553553                vBuf.append(hGetCdAction()); 
  • trunk/Jav_CO/com/scenari/m/co/composant/HComposantTypeLoader.java

    r7458 r10372  
    222222                if (fCurrentDonnee != null) { 
    223223                        // On est revenu à la cloture de l'élément donnée. 
    224                         if (fSaxHandlerToText.hGetStringBuffer().length() > 0) { 
     224                        if (fSaxHandlerToText.hGetStringBuilder().length() > 0) { 
    225225                                try { 
    226                                         fCurrentDonnee.wSetValue(fCurrentCompType, fSaxHandlerToText.hGetStringBuffer().substring(0), fContextDonnee); 
     226                                        fCurrentDonnee.wSetValue(fCurrentCompType, fSaxHandlerToText.hGetStringBuilder().substring(0), fContextDonnee); 
    227227                                } catch (Exception e) { 
    228228                                        throw (Exception) HLogMgr.hAddMessage(e, "Echec lors de l'affectation du contenu d'une donnée de type " + fCurrentDonnee.getClass().getName()); 
     
    281281                                        if (fSaxHandlerToText == null) { 
    282282                                                fSaxHandlerToText = new HExtraitSaxHandlerToText(); 
    283                                                 fSaxHandlerToText.hSetStringBuffer(new StringBuffer(256)); 
     283                                                fSaxHandlerToText.hSetStringBuilder(new StringBuilder(256)); 
    284284                                        } 
    285                                         fSaxHandlerToText.hGetStringBuffer().setLength(0); 
     285                                        fSaxHandlerToText.hGetStringBuilder().setLength(0); 
    286286                                        fSaxHandlerToText.hSetXmlReader(fXMLReader); 
    287287                                } 
  • trunk/Jav_CO/com/scenari/m/co/composant/WComposant.java

    r7523 r10372  
    490490                fCompPere = pComposantPere; 
    491491                String vPathPere = fCompPere.hGetComposantPath(); 
    492                 StringBuffer vBuf = new StringBuffer(vPathPere.length() + pCode.length() + 1); 
     492                StringBuilder vBuf = new StringBuilder(vPathPere.length() + pCode.length() + 1); 
    493493                vBuf.append(vPathPere); 
    494494                vBuf.append("/"); 
  • trunk/Jav_CO/com/scenari/m/co/context/HContextInteractif.java

    r7252 r10372  
    5454    /** 
    5555     * Permet de placer en mémoire des données au cours d'une génération et de les récupérer ultérieurement. Tout type 
    56      * d'objet java peut être un buffer. Les objets de type Collection, Map et StringBuffer sont gérés spécifiquement et 
     56     * d'objet java peut être un buffer. Les objets de type Collection, Map et StringBuilder sont gérés spécifiquement et 
    5757     * les méthodes utilitaires sont proposées. 
    5858     */ 
     
    113113     * Si pEntry est null, retourne le buffer pKeyBuffer. Si pEntry non null : Retourne la valeur d'une entrée de buffer 
    114114     * de type Map. Retourne True ou False si l'entrée existe dans un buffer de type Collection. Retourne une String 
    115      * représentant le StringBuffer dans un buffer de type StringBuffer. 
     115     * représentant le StringBuilder dans un buffer de type StringBuilder. 
    116116     */ 
    117117    public Object getEntryBuffer(String pKeyBuffer, Object pEntry) { 
     
    123123            } else if (vBuf instanceof Map) { 
    124124                return ((Map) vBuf).get(pEntry); 
    125             } else if (vBuf instanceof StringBuffer) { 
     125            } else if (vBuf instanceof StringBuilder) { 
    126126                return vBuf.toString(); 
    127127            } 
     
    133133     * Ajout d'une entrée dans un buffer. 
    134134     *  
    135      * @param pEntry Objet ajouté à un buffer de type Collexction ou StringBuffer, Key de l'entry pour un buffer de type 
     135     * @param pEntry Objet ajouté à un buffer de type Collexction ou StringBuilder, Key de l'entry pour un buffer de type 
    136136     *            Map. 
    137137     * @param pEntryValue Utile que pour les buffers de type Map 
     
    144144            } else if (vBuf instanceof Map) { 
    145145                return (((Map) vBuf).put(pEntry, pEntryValue) == null); 
    146             } else if (vBuf instanceof StringBuffer) { 
    147                 ((StringBuffer) vBuf).append(pEntry); 
     146            } else if (vBuf instanceof StringBuilder) { 
     147                ((StringBuilder) vBuf).append(pEntry); 
    148148                return true; 
    149149            } 
  • trunk/Jav_CO/com/scenari/m/co/context/IHContextBuffers.java

    r4831 r10372  
    1919     * Si pEntry est null, retourne le buffer pKeyBuffer. Si pEntry non null : Retourne la valeur d'une entrée de buffer 
    2020     * de type Map. Retourne True ou False si l'entrée existe dans un buffer de type Collection. Retourne une String 
    21      * représentant le StringBuffer dans un buffer de type StringBuffer. 
     21     * représentant le StringBuilder dans un buffer de type StringBuilder. 
    2222     */ 
    2323    public Object getEntryBuffer(String pKeyBuffer, Object pEntry); 
     
    2626     * Ajout d'une entrée dans un buffer. 
    2727     *  
    28      * @param pEntry Objet ajouté à un buffer de type Collexction ou StringBuffer, Key de l'entry pour un buffer de type 
     28     * @param pEntry Objet ajouté à un buffer de type Collexction ou StringBuilder, Key de l'entry pour un buffer de type 
    2929     *            Map. 
    3030     * @param pValueEntry Utile que pour les buffers de type Map 
  • trunk/Jav_CO/com/scenari/m/co/dialog/webdav/WResultatOptions.java

    r4311 r10372  
    140140         */ 
    141141        protected void xBuildAllow() { 
    142                 StringBuffer vBuf = new StringBuffer(100); 
     142                StringBuilder vBuf = new StringBuilder(100); 
    143143                if(fOPTIONS) vBuf.append("OPTIONS,"); 
    144144                if(fGET) vBuf.append("GET,"); 
  • trunk/Jav_CO/com/scenari/m/co/donnee/WDonneeFixeSystemProps.java

    r7747 r10372  
    9292        /** Remplace les propriétés systèmes. Utilisable de l'extérieur. */ 
    9393        public static String hReplace(String pSrc){ 
    94            StringBuffer  vRes = null; 
     94           StringBuilder  vRes = null; 
    9595           if(pSrc != null) { 
    9696               int vIdx = pSrc.indexOf('{'); 
    9797               if(vIdx >= 0) { 
    98                    vRes = new StringBuffer(pSrc.length()+128); 
     98                   vRes = new StringBuilder(pSrc.length()+128); 
    9999                   if(vIdx>0) vRes.append(pSrc.substring(0, vIdx)); 
    100100                   int vIdxEnd = vIdx; 
  • trunk/Jav_CO/com/scenari/m/co/donnee/WDonneeXPath.java

    r7458 r10372  
    124124        public String toString() { 
    125125 
    126                 StringBuffer vBuf = HPoolBuffer.get().hGetStringBuffer(); 
     126                StringBuilder vBuf = HPoolBuffer.get().hGetStringBuilder(); 
    127127 
    128128                vBuf.append("<donnee type=\""); 
     
    142142 
    143143                String vResult = vBuf.substring(0); 
    144                 HPoolBuffer.get().hFreeStringBuffer(vBuf); 
     144                HPoolBuffer.get().hFreeStringBuilder(vBuf); 
    145145 
    146146                return vResult; 
  • trunk/Jav_CO/com/scenari/m/co/donnee/WDonneeXslMonoTemplate.java

    r7519 r10372  
    109109                if (vXslDyn != null && !vXslDyn.equals("")) { 
    110110                        // Construction du XSL complet 
    111                         StringBuffer vBuf = new StringBuffer(vXslDyn.length() + 512); 
     111                        StringBuilder vBuf = new StringBuilder(vXslDyn.length() + 512); 
    112112                        vBuf.append("<?xml version=\"1.0\"?>"); // encoding=\"iso-8859-1\" 
    113113                        vBuf.append("<xsl2:stylesheet xmlns:xsl2=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">"); 
  • trunk/Jav_CO/com/scenari/m/co/donnee/XSaxHandlerDonnees.java

    r9610 r10372  
    9898        if (fCurrentDonnee != null) { 
    9999            //On est revenu à la cloture de l'élément donnée. 
    100                 StringBuffer vBuf = fCurrentSubSaxHandlerIsXml ? fSaxHandlerToXml.hGetStringBuffer() : fSaxHandlerToText.hGetStringBuffer(); 
     100                StringBuilder vBuf = fCurrentSubSaxHandlerIsXml ? fSaxHandlerToXml.hGetStringBuilder() : fSaxHandlerToText.hGetStringBuilder(); 
    101101            if (vBuf.length() > 0) { 
    102102                try { 
     
    148148                            if (fSaxHandlerToXml == null) { 
    149149                                fSaxHandlerToXml = new HExtraitSaxHandlerToXml(); 
    150                                 fSaxHandlerToXml.hSetStringBuffer(new StringBuffer(256)); 
     150                                fSaxHandlerToXml.hSetStringBuilder(new StringBuilder(256)); 
    151151                            } else { 
    152                                 fSaxHandlerToXml.hGetStringBuffer().setLength(0); 
     152                                fSaxHandlerToXml.hGetStringBuilder().setLength(0); 
    153153                            } 
    154154                            fSaxHandlerToXml.hSetXmlReader(fXMLReader); 
     
    157157                            if (fSaxHandlerToText == null) { 
    158158                                fSaxHandlerToText = new HExtraitSaxHandlerToText(); 
    159                                 fSaxHandlerToText.hSetStringBuffer(new StringBuffer(256)); 
     159                                fSaxHandlerToText.hSetStringBuilder(new StringBuilder(256)); 
    160160                            } else { 
    161                                 fSaxHandlerToText.hGetStringBuffer().setLength(0); 
     161                                fSaxHandlerToText.hGetStringBuilder().setLength(0); 
    162162                            } 
    163163                            fSaxHandlerToText.hSetXmlReader(fXMLReader); 
  • trunk/Jav_CO/com/scenari/m/co/donnee/XSaxHandlerToDom.java

    r7479 r10372  
    5757/** 
    5858 * Permet de reconstruire une chaine texte représentant le document XML en cours de parsing. 
    59  * Attention le reset du StringBuffer doit être assuré avant la transmission à ce SaxHandler. 
     59 * Attention le reset du StringBuilder doit être assuré avant la transmission à ce SaxHandler. 
    6060 * Cette implémentation nécessite une réfrence au XmlReader générant les évènements Sax pour réaffecter 
    6161 * le content handler père lorsque le parsing sort du noeud racine où ce content handler a comencé. 
  • trunk/Jav_CO/com/scenari/m/co/donnee/XSaxHandlerToXml.java

    r7458 r10372  
    6363        fCompType = pCompType; 
    6464        fContextDonnee = pContextDonnee; 
    65         fStringBuffer = HPoolBuffer.get().hGetStringBuffer(); 
     65        fStringBuilder = HPoolBuffer.get().hGetStringBuilder(); 
    6666} 
    6767/** 
     
    7373                //Fini 
    7474                try { 
    75                         fDonnee.wSetValue(fCompType, fStringBuffer.substring(0).trim(), fContextDonnee); 
     75                        fDonnee.wSetValue(fCompType, fStringBuilder.substring(0).trim(), fContextDonnee); 
    7676                } catch (Exception e) { 
    7777                        throw (SAXException) HLogMgr.hAddMessage(new SAXException("Erreur au cours de l'affectation de la valeur à la donnee " + fDonnee), HLogMgr.hGetMessage(e)); 
    7878                } finally { 
    79                         HPoolBuffer.get().hFreeStringBuffer(fStringBuffer); 
    80                         fStringBuffer = null; 
     79                        HPoolBuffer.get().hFreeStringBuilder(fStringBuilder); 
     80                        fStringBuilder = null; 
    8181                } 
    8282 
     
    8787 *  
    8888 *  
    89  * @param pBuffer java.lang.StringBuffer 
     89 * @param pBuffer java.lang.StringBuilder 
    9090 */ 
    91 public void hSetStringBuffer(StringBuffer pBuffer) { 
    92         //Gestion interne du StringBuffer 
     91public void hSetStringBuilder(StringBuilder pBuffer) { 
     92        //Gestion interne du StringBuilder 
    9393} 
    9494} 
  • trunk/Jav_CO/com/scenari/m/co/donnee/composition/XCompositionSaxHandler.java

    r7458 r10372  
    117117 
    118118    /** Chaine statique en cours de création. */ 
    119     protected StringBuffer fStringBuffer = new StringBuffer(); 
     119    protected StringBuilder fStringBuilder = new StringBuilder(); 
    120120 
    121121    /** Offset du car '>' du dernier startElement lu. */ 
     
    139139     */ 
    140140    public void characters(char[] pCh, int pStart, int pLength) throws org.xml.sax.SAXException { 
    141         fStringBuffer.append(pCh, pStart, pLength); 
     141        fStringBuilder.append(pCh, pStart, pLength); 
    142142    } 
    143143 
     
    146146     */ 
    147147    public void xAddStringFix(boolean pExcludeWhiteSpace, boolean pTrim) throws Exception { 
    148         if (fStringBuffer.length() > 0) { 
     148        if (fStringBuilder.length() > 0) { 
    149149            String vVal = null; 
    150150            if (pExcludeWhiteSpace) { 
    151                 if (!XMLCharacterRecognizer.isWhiteSpace(fStringBuffer)) { 
    152                     vVal = fStringBuffer.substring(0); 
     151                if (!XMLCharacterRecognizer.isWhiteSpace(fStringBuilder)) { 
     152                    vVal = fStringBuilder.substring(0); 
    153153                    if (pTrim) vVal = vVal.trim(); 
    154154                } 
    155             } else if (fStringBuffer.length() > 0) { 
    156                 vVal = fStringBuffer.substring(0); 
     155            } else if (fStringBuilder.length() > 0) { 
     156                vVal = fStringBuilder.substring(0); 
    157157                if (pTrim) vVal = vVal.trim(); 
    158158            } 
     
    162162            } 
    163163            //On reset le buffer 
    164             fStringBuffer.setLength(0); 
     164            fStringBuilder.setLength(0); 
    165165            fOffsetLastElementInDonnee = -1; 
    166166        } 
     
    189189            } 
    190190        } else { //Ce n'est pas un élément de l'espace composition, on le recopie à l'identique 
    191             if (fOffsetLastElementInDonnee == fStringBuffer.length()) { 
    192                 if (fStringBuffer.length() > 0) { //Pas de contenu au tag. 
    193                     fStringBuffer.setCharAt(fStringBuffer.length() - 1, '/'); 
    194                     fStringBuffer.append('>'); 
     191            if (fOffsetLastElementInDonnee == fStringBuilder.length()) { 
     192                if (fStringBuilder.length() > 0) { //Pas de contenu au tag. 
     193                    fStringBuilder.setCharAt(fStringBuilder.length() - 1, '/'); 
     194                    fStringBuilder.append('>'); 
    195195                } 
    196196            } else { //Il y a eu un contenu au tag. 
    197                 fStringBuffer.append("</"); 
    198                 fStringBuffer.append(pQName); 
    199                 fStringBuffer.append('>'); 
     197                fStringBuilder.append("</"); 
     198                fStringBuilder.append(pQName); 
     199                fStringBuilder.append('>'); 
    200200            } 
    201201        } 
     
    312312        } else { 
    313313            //Ce n'est pas un élément de l'espace composition, on le recopie à l'identique 
    314             fStringBuffer.append('<'); 
    315             fStringBuffer.append(pQName); 
     314            fStringBuilder.append('<'); 
     315            fStringBuilder.append(pQName); 
    316316            //Traitement de chaque attribut 
    317317            for (int i = 0; i < pAttributes.getLength(); i++) { 
    318                 fStringBuffer.append(' '); 
    319                 fStringBuffer.append(pAttributes.getQName(i)); 
    320                 fStringBuffer.append("=\""); 
     318                fStringBuilder.append(' '); 
     319                fStringBuilder.append(pAttributes.getQName(i)); 
     320                fStringBuilder.append("=\""); 
    321321 
    322322                //Traitement des éléments dynamiques dans l'attribut 
     
    351351                            if (vOffsLastAppend < vOffsBegin) { 
    352352                                //On écrit ce qui précède l'acolode ouvrante. 
    353                                 HEncodingXml.hWriteAttributHtmlValue(fStringBuffer, vValAtt.substring(vOffsLastAppend, vOffsBegin)); 
     353                                HEncodingXml.hWriteAttributHtmlValue(fStringBuilder, vValAtt.substring(vOffsLastAppend, vOffsBegin)); 
    354354                            } 
    355355                            vOffsLastAppend = vOffsLast + 1; 
     
    407407                            if (vOffsLastAppend < vOffsBegin) { 
    408408                                //On écrit ce qui précède l'acolode ouvrante.  
    409                                 HEncodingXml.hWriteAttributHtmlValue(fStringBuffer, vValAtt.substring(vOffsLastAppend, vOffsBegin)); 
     409                                HEncodingXml.hWriteAttributHtmlValue(fStringBuilder, vValAtt.substring(vOffsLastAppend, vOffsBegin)); 
    410410                            } 
    411411                            vOffsBegin++; 
     
    417417                //Ecriture du dernier morceau 'statique' 
    418418                if (vOffsLastAppend < vValAtt.length()) { 
    419                     HEncodingXml.hWriteAttributHtmlValue(fStringBuffer, vValAtt.substring(vOffsLastAppend)); 
     419                    HEncodingXml.hWriteAttributHtmlValue(fStringBuilder, vValAtt.substring(vOffsLastAppend)); 
    420420                    xAddStringFix(false, false); 
    421421                } 
    422422 
    423                 fStringBuffer.append('"'); 
     423                fStringBuilder.append('"'); 
    424424            } 
    425425            if(fNsDeclStack != null && fNsDeclStack.size() > 0) { 
     
    428428                    String vNs = (String) fNsDeclStack.get(i+1); 
    429429                    if(vPrefix.length() > 0) { 
    430                         fStringBuffer.append(" xmlns:"); 
    431                         fStringBuffer.append(vPrefix); 
    432                         fStringBuffer.append("=\""); 
     430                        fStringBuilder.append(" xmlns:"); 
     431                        fStringBuilder.append(vPrefix); 
     432                        fStringBuilder.append("=\""); 
    433433                    } else { 
    434                         fStringBuffer.append(" xmlns=\""); 
     434                        fStringBuilder.append(" xmlns=\""); 
    435435                    } 
    436                     fStringBuffer.append(vNs); 
    437                     fStringBuffer.append('"'); 
    438                 } 
    439             } 
    440             fStringBuffer.append('>'); 
    441             fOffsetLastElementInDonnee = fStringBuffer.length(); 
     436                    fStringBuilder.append(vNs); 
     437                    fStringBuilder.append('"'); 
     438                } 
     439            } 
     440            fStringBuilder.append('>'); 
     441            fOffsetLastElementInDonnee = fStringBuilder.length(); 
    442442        } 
    443443        if(fNsDeclStack != null && fNsDeclStack.size() > 0) fNsDeclStack.clear(); 
  • trunk/Jav_CO/com/scenari/m/co/donnee/externe/XSInitDonneeSaxHandler.java

    r7458 r10372  
    106106        if (fCurrentDonnee != null) { 
    107107                //On est revenu à la cloture de l'élément donnée. 
    108                 if (fSaxHandlerToText.hGetStringBuffer().length() > 0) { 
     108                if (fSaxHandlerToText.hGetStringBuilder().length() > 0) { 
    109109                        try { 
    110                                 fCurrentDonnee.wSetValue(fService, fSaxHandlerToText.hGetStringBuffer().substring(0), fCurrentDocSource); 
     110                                fCurrentDonnee.wSetValue(fService, fSaxHandlerToText.hGetStringBuilder().substring(0), fCurrentDocSource); 
    111111                        } catch (Exception e) { 
    112112                                HLogMgr.hPublishException(e, "Echec lors de l'affectation du contenu d'une donnée de type " + fCurrentDonnee.getClass().getName()); 
     
    122122        } else if(fCurrentTransform) { 
    123123                //On est revenu d'une lecture d'un template de transformation. 
    124                 if (fSaxHandlerToXml.hGetStringBuffer().length() > 0) { 
    125                         fDonnee.xAddTransformXsl(fSaxHandlerToXml.hGetStringBuffer().substring(0), false, fCurrentDocSource); 
     124                if (fSaxHandlerToXml.hGetStringBuilder().length() > 0) { 
     125                        fDonnee.xAddTransformXsl(fSaxHandlerToXml.hGetStringBuilder().substring(0), false, fCurrentDocSource); 
    126126                } 
    127127                fCurrentTransform = false; 
     
    161161                                if (fSaxHandlerToText == null) { 
    162162                                        fSaxHandlerToText = new HExtraitSaxHandlerToText(); 
    163                                         fSaxHandlerToText.hSetStringBuffer(new StringBuffer(256)); 
     163                                        fSaxHandlerToText.hSetStringBuilder(new StringBuilder(256)); 
    164164                                } 
    165                                 fSaxHandlerToText.hGetStringBuffer().setLength(0); 
     165                                fSaxHandlerToText.hGetStringBuilder().setLength(0); 
    166166                                fSaxHandlerToText.hSetXmlReader(fXMLReader); 
    167167                        } 
     
    201201                        if (fSaxHandlerToXml == null) { 
    202202                                fSaxHandlerToXml = new HExtraitSaxHandlerToXml(); 
    203                                 fSaxHandlerToXml.hSetStringBuffer(new StringBuffer(256)); 
    204                         } 
    205                         fSaxHandlerToXml.hGetStringBuffer().setLength(0); 
     203                                fSaxHandlerToXml.hSetStringBuilder(new StringBuilder(256)); 
     204                        } 
     205                        fSaxHandlerToXml.hGetStringBuilder().setLength(0); 
    206206                        fSaxHandlerToXml.hSetXmlReader(fXMLReader); 
    207207                        fCurrentTransform = true; 
  • trunk/Jav_CO/com/scenari/m/co/donnee/inclusion/WDonneeInclusionDynamique.java

    r7458 r10372  
    179179         */ 
    180180        public final String toString() { 
    181                 StringBuffer vBuf = com.scenari.s.fw.utils.HPoolBuffer.get().hGetStringBuffer(); 
     181                StringBuilder vBuf = com.scenari.s.fw.utils.HPoolBuffer.get().hGetStringBuilder(); 
    182182 
    183183                vBuf.append("<donnee type=\""); 
     
    195195 
    196196                String vRes = vBuf.substring(0); 
    197                 com.scenari.s.fw.utils.HPoolBuffer.get().hFreeStringBuffer(vBuf); 
     197                com.scenari.s.fw.utils.HPoolBuffer.get().hFreeStringBuilder(vBuf); 
    198198 
    199199                return vRes; 
  • trunk/Jav_CO/com/scenari/m/co/donnee/inclusion/XWriter.java

    r7466 r10372  
    113113 
    114114        /** Buffer de l'inclusion.*/ 
    115         protected StringBuffer fBuff = null; 
     115        protected StringBuilder fBuff = null; 
    116116 
    117117        /** Flag si le flux doit être envoyé dans la dest. */ 
     
    197197                                        //On a trouvé un tag d'ouverture 
    198198                                        if (fBuff == null) { 
    199                                                 fBuff = new StringBuffer(64); 
     199                                                fBuff = new StringBuilder(64); 
    200200                                        } 
    201201                                        fStatut = STATUT_TAGIN; 
     
    216216                                        //On a trouvé un tag d'ouverture 
    217217                                        if (fBuff == null) { 
    218                                                 fBuff = new StringBuffer(64); 
     218                                                fBuff = new StringBuilder(64); 
    219219                                        } 
    220220                                        fStatut = STATUT_TAGIN; 
     
    297297                if (fSrcIsXml) { 
    298298                        int vLen = fBuff.length(); 
    299                         StringBuffer vBuf = new StringBuffer(vLen); 
     299                        StringBuilder vBuf = new StringBuilder(vLen); 
    300300                        for (int i = 0; i < vLen; i++) { 
    301301                                char vCh = fBuff.charAt(i); 
  • trunk/Jav_CO/com/scenari/m/co/service/HServiceLoader.java

    r7458 r10372  
    190190                if (fCurrentDonnee != null) { 
    191191                        // On est revenu à la cloture de l'élément donnée. 
    192                         if (fSaxHandlerToText.hGetStringBuffer().length() > 0) { 
     192                        if (fSaxHandlerToText.hGetStringBuilder().length() > 0) { 
    193193                                try { 
    194                                         fCurrentDonnee.wSetValue(fCurrentService, fSaxHandlerToText.hGetStringBuffer().substring(0), fCurrentDocSource); 
     194                                        fCurrentDonnee.wSetValue(fCurrentService, fSaxHandlerToText.hGetStringBuilder().substring(0), fCurrentDocSource); 
    195195                                } catch (Exception e) { 
    196196                                        HLogMgr.hPublishException(e, "Echec lors de l'affectation du contenu d'une donnée de type " + fCurrentDonnee.getClass().getName()); 
     
    237237                                        if (fSaxHandlerToText == null) { 
    238238                                                fSaxHandlerToText = new HExtraitSaxHandlerToText(); 
    239                                                 fSaxHandlerToText.hSetStringBuffer(new StringBuffer(256)); 
     239                                                fSaxHandlerToText.hSetStringBuilder(new StringBuilder(256)); 
    240240                                        } 
    241                                         fSaxHandlerToText.hGetStringBuffer().setLength(0); 
     241                                        fSaxHandlerToText.hGetStringBuilder().setLength(0); 
    242242                                        fSaxHandlerToText.hSetXmlReader(fXMLReader); 
    243243                                } 
  • trunk/Jav_CO/com/scenari/m/co/service/WService.java

    r7458 r10372  
    168168        public final String hGetUrn() { 
    169169                if (fUrn == null) { 
    170                         StringBuffer vBuf = new StringBuffer(64); 
     170                        StringBuilder vBuf = new StringBuilder(64); 
    171171                        vBuf.append(hGetAncre()); 
    172172                        vBuf.append("/"); 
  • trunk/Jav_CO/com/scenari/m/co/univers/HContextExecHttpServlet.java

    r1710 r10372  
    9999    public final String hBuildUrlAbsAgent(IWAgent pAgent, IWADialog pDialog) throws Exception { 
    100100 
    101         StringBuffer vBuf = new StringBuffer(); 
     101        StringBuilder vBuf = new StringBuilder(); 
    102102 
    103103        List vHier = pDialog.hGetHier(); 
     
    125125    public final String hBuildUrlAbsRessource(String pUri, IWUnivers pUnivers) throws Exception { 
    126126 
    127         StringBuffer vBuf = new StringBuffer(pUri.length() + 64); 
     127        StringBuilder vBuf = new StringBuilder(pUri.length() + 64); 
    128128        vBuf.append(fUrlDomaine); 
    129129        vBuf.append(fUrlPublications); 
     
    138138    public final String hBuildUrlAbsService(com.scenari.m.co.service.IWService pService) throws Exception { 
    139139 
    140         StringBuffer vBuf = new StringBuffer(128); 
     140        StringBuilder vBuf = new StringBuilder(128); 
    141141        vBuf.append(fUrlDomaine); 
    142142        vBuf.append(fUrlWebApp); 
     
    154154    public final String hBuildUrlInDomainAgent(IWAgent pAgent, IWADialog pDialog) throws Exception { 
    155155 
    156         StringBuffer vBuf = new StringBuffer(); 
     156        StringBuilder vBuf = new StringBuilder(); 
    157157 
    158158        List vHier = pDialog.hGetHier(); 
     
    181181    public final String hBuildUrlInDomainRessource(String pUri, IWUnivers pUnivers) throws Exception { 
    182182 
    183         StringBuffer vBuf = new StringBuffer(pUri.length() + 64); 
     183        StringBuilder vBuf = new StringBuilder(pUri.length() + 64); 
    184184        //vBuf.append(fUrlDomaine); 
    185185        vBuf.append(fUrlPublications); 
     
    194194    public final String hBuildUrlInDomainService(com.scenari.m.co.service.IWService pService) throws Exception { 
    195195 
    196         StringBuffer vBuf = new StringBuffer(128); 
     196        StringBuilder vBuf = new StringBuilder(128); 
    197197        //vBuf.append(fUrlDomaine); 
    198198        vBuf.append(fUrlWebApp); 
     
    210210    public final String hBuildUrlInWebappAgent(IWAgent pAgent, IWADialog pDialog) throws Exception { 
    211211 
    212         StringBuffer vBuf = new StringBuffer(); 
     212        StringBuilder vBuf = new StringBuilder(); 
    213213 
    214214        List vHier = pDialog.hGetHier(); 
     
    236236    public final String hBuildUrlInWebappService(com.scenari.m.co.service.IWService pService) throws Exception { 
    237237 
    238         StringBuffer vBuf = new StringBuffer(128); 
     238        StringBuilder vBuf = new StringBuilder(128); 
    239239        //vBuf.append(fUrlDomaine); 
    240240        //vBuf.append(fUrlWebApp); 
  • trunk/Jav_CO/com/scenari/m/co/univers/HInstanceDef.java

    r7412 r10372  
    256256         */ 
    257257        public String toString() { 
    258                 StringBuffer vBuf = new StringBuffer(256); 
     258                StringBuilder vBuf = new StringBuilder(256); 
    259259                vBuf.append("<"); 
    260260                vBuf.append(hGetTagRoot()); 
  • trunk/Jav_CO/com/scenari/m/co/univers/XParamUniversSaxHandler.java

    r10155 r10372  
    140140 
    141141        /** Buffer pour les zones de texte. */ 
    142         protected StringBuffer fBuf = new StringBuffer(64); 
     142        protected StringBuilder fBuf = new StringBuilder(64); 
    143143 
    144144        /** 
  • trunk/Jav_CO/com/scenari/m/co/univers/wsp/WContenuMgrWsp.java

    r10268 r10372  
    366366        public final void hInitServicePrecsription(IWPrescription pPrecsription, IWService pService) throws Exception { 
    367367                //Les services de prescriptions ne sont pas utilisés dan sce ContenuMgr 
    368                 //pService.wSetUrlPublication(new StringBuffer(pService.hGetCode().length() + 
     368                //pService.wSetUrlPublication(new StringBuilder(pService.hGetCode().length() + 
    369369                // 5).append("/se/").append(pService.hGetCode()).append('/').toString()); 
    370370                throw HLogMgr.hNewException("Fonction non implémentée dans le ContenuMgr Dynamique."); 
     
    375375         */ 
    376376        public final void hInitServiceUnivers(IWService pService) throws Exception { 
    377                 pService.wSetUrlPublication(new StringBuffer(pService.hGetCode().length() + 5).append("/se/").append(pService.hGetCode()).append('/').toString()); 
     377                pService.wSetUrlPublication(new StringBuilder(pService.hGetCode().length() + 5).append("/se/").append(pService.hGetCode()).append('/').toString()); 
    378378        } 
    379379 
     
    527527 
    528528                        if (vLen > 0 && pUrl.length() > vLen) { 
    529                                 StringBuffer vBuf = new StringBuffer(vResult.length() - vLen + vBase.length() + 1); 
     529                                StringBuilder vBuf = new StringBuilder(vResult.length() - vLen + vBase.length() + 1); 
    530530                                vBuf.append(vBase); 
    531531                                if (vResult.charAt(vLen) != '/') { 
  • trunk/Jav_CO/com/scenari/m/co/univers/wsp/XFcSaxHandler.java

    r7366 r10372  
    133133                fCompType.wInit(vUnivers, vClasseComp, vCode); 
    134134 
    135                 StringBuffer vBuf = new StringBuffer(64); 
     135                StringBuilder vBuf = new StringBuilder(64); 
    136136 
    137137                // 
  • trunk/Jav_CO/com/scenari/m/co/user/fs/XUserSaxHandler.java

    r1710 r10372  
    8080    protected WUserFs fActeur = null; 
    8181 
    82     /** StringBuffer pour les caractères. */ 
    83     protected StringBuffer fBuf = new StringBuffer(128); 
     82    /** StringBuilder pour les caractères. */ 
     83    protected StringBuilder fBuf = new StringBuilder(128); 
    8484 
    8585    /** Liste des roles. */ 
  • trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPath.java

    r9752 r10372  
    127127                case Node.DOCUMENT_NODE: 
    128128                case Node.ELEMENT_NODE: { 
    129                         StringBuffer vBuf = com.scenari.s.fw.utils.HPoolBuffer.get().hGetStringBuffer(); 
     129                        StringBuilder vBuf = com.scenari.s.fw.utils.HPoolBuffer.get().hGetStringBuilder(); 
    130130                        for (Node vChild = pNode.getFirstChild(); vChild != null; vChild = vChild.getNextSibling()) { 
    131131                                xGetNodeToString(vChild, vBuf); 
    132132                        } 
    133133                        vResult = (vBuf.length() > 0) ? vBuf.substring(0) : ""; 
    134                         com.scenari.s.fw.utils.HPoolBuffer.get().hFreeStringBuffer(vBuf); 
     134                        com.scenari.s.fw.utils.HPoolBuffer.get().hFreeStringBuilder(vBuf); 
    135135                } 
    136136                        break; 
     
    449449         *  
    450450         */ 
    451         private static final String xGetNodeToString(Node pNode, StringBuffer pBuf) { 
     451        private static final String xGetNodeToString(Node pNode, StringBuilder pBuf) { 
    452452 
    453453                String vResult = null; 
  • trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPathChaineProtegeAttHtml.java

    r9559 r10372  
    8585        String vString = wGetAsString(pCtx, fArg.execute(pCtx)); 
    8686 
    87         StringBuffer vBuf = new StringBuffer((int) (vString.length() * 1.1 + 5)); 
     87        StringBuilder vBuf = new StringBuilder((int) (vString.length() * 1.1 + 5)); 
    8888        HEncodingXml.hWriteAttributHtmlValue(vBuf, vString); 
    8989 
  • trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPathChaineProtegeJs.java

    r9746 r10372  
    7979                String vString = wGetAsString(pCtx, fArg.execute(pCtx)); 
    8080 
    81                 StringBuffer vBuf = new StringBuffer((int) (vString.length() * 1.1 + 5)); 
     81                StringBuilder vBuf = new StringBuilder((int) (vString.length() * 1.1 + 5)); 
    8282                for (int i = 0; i < vString.length(); i++) { 
    8383                        char vCar = vString.charAt(i); 
  • trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPathConcatExpr.java

    r9559 r10372  
    9393 
    9494        XString vResult = null; 
    95         StringBuffer vBuf = new StringBuffer(); 
     95        StringBuilder vBuf = new StringBuilder(); 
    9696 
    9797        XObject vList = fArgList.execute(pXPathCtx); 
  • trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPathEscapeXslAtt.java

    r9583 r10372  
    8282                String vString = wGetAsString(pCtx, fArg.execute(pCtx)); 
    8383                if (vString.indexOf('{') >= 0 || vString.indexOf('}') >= 0) { 
    84                         StringBuffer vBuf = new StringBuffer(vString.length() + 24); 
     84                        StringBuilder vBuf = new StringBuilder(vString.length() + 24); 
    8585                        for (int i = 0; i < vString.length(); i++) { 
    8686                                char vChar = vString.charAt(i); 
  • trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPathIdNode.java

    r9589 r10372  
    129129                vId = ((Element)pNode).getAttribute("id"); 
    130130                if(vId != null) { 
    131                         StringBuffer vBuf = new StringBuffer(vResult.length() + vId.length() + 2); 
     131                        StringBuilder vBuf = new StringBuilder(vResult.length() + vId.length() + 2); 
    132132                        //On préfixe d'un 'N' l'id pour le différenier avec certitude des _meta, _A+axis, etc. 
    133133                    vBuf.append(vResult).append(IWContenuMgr.SEPARATOR_IDFROMURI).append('N').append(vId); 
     
    152152                } 
    153153                if (vCount != 0) { 
    154                     StringBuffer vBuf = new StringBuffer(vResult.length() + 10); 
     154                    StringBuilder vBuf = new StringBuilder(vResult.length() + 10); 
    155155                    vBuf.append(vResult).append(IWContenuMgr.SEPARATOR_IDFROMURI).append(HCharSeqUtil.hGetIntToString(vCount)); 
    156156                    vResult = vBuf.toString(); 
  • trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPathListXml.java

    r9559 r10372  
    122122        XString vResult = null; 
    123123        String vContentNode = null; 
    124         StringBuffer vBuf = com.scenari.s.fw.utils.HPoolBuffer.get().hGetStringBuffer(); 
     124        StringBuilder vBuf = com.scenari.s.fw.utils.HPoolBuffer.get().hGetStringBuilder(); 
    125125        vBuf.append("<liste>"); 
    126126 
     
    160160        } 
    161161 
    162         com.scenari.s.fw.utils.HPoolBuffer.get().hFreeStringBuffer(vBuf); 
     162        com.scenari.s.fw.utils.HPoolBuffer.get().hFreeStringBuilder(vBuf); 
    163163 
    164164        return vResult; 
  • trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPathListXmlExpr.java

    r9559 r10372  
    9797 
    9898        XString vResult = null; 
    99         StringBuffer vBuf = com.scenari.s.fw.utils.HPoolBuffer.get().hGetStringBuffer(); 
     99        StringBuilder vBuf = com.scenari.s.fw.utils.HPoolBuffer.get().hGetStringBuilder(); 
    100100        vBuf.append("<liste>"); 
    101101 
     
    122122        } 
    123123 
    124         com.scenari.s.fw.utils.HPoolBuffer.get().hFreeStringBuffer(vBuf); 
     124        com.scenari.s.fw.utils.HPoolBuffer.get().hFreeStringBuilder(vBuf); 
    125125 
    126126        return vResult; 
  • trunk/Jav_CO/com/scenari/m/co/xpath/dtm/ZXPathChaineProtegeAttHtml.java

    r10215 r10372  
    108108                String vString = wGetAsString(pCtx, fArg.execute(pCtx)); 
    109109 
    110                 StringBuffer vBuf = new StringBuffer((int) (vString.length() * 1.1 + 5)); 
     110                StringBuilder vBuf = new StringBuilder((int) (vString.length() * 1.1 + 5)); 
    111111                HEncodingXml.hWriteAttributHtmlValue(vBuf, vString); 
    112112 
  • trunk/Jav_CO/com/scenari/m/co/xpath/dtm/ZXPathChaineProtegeJs.java

    r10215 r10372  
    109109                String vString = wGetAsString(pCtx, fArg.execute(pCtx)); 
    110110 
    111                 StringBuffer vBuf = new StringBuffer((int) (vString.length() * 1.1 + 5)); 
     111                StringBuilder vBuf = new StringBuilder((int) (vString.length() * 1.1 + 5)); 
    112112                for (int i = 0; i < vString.length(); i++) { 
    113113                        char vCar = vString.charAt(i); 
  • trunk/Jav_CO/com/scenari/m/co/xpath/dtm/ZXPathConcatExpr.java

    r10215 r10372  
    107107                XObject vList = fArgList.execute(pCtx); 
    108108                if (vList.getType() == XObject.CLASS_NODESET) { 
    109                         StringBuffer vBuf = new StringBuffer(); 
     109                        StringBuilder vBuf = new StringBuilder(); 
    110110                        XNodeSet vNodeSet = (XNodeSet) vList; 
    111111                        boolean vIsFirst = true; 
  • trunk/Jav_CO/com/scenari/m/co/xpath/dtm/ZXPathListXml.java

    r10215 r10372  
    136136 
    137137                XString vResult = null; 
    138                 StringBuffer vBuf = HPoolBuffer.get().hGetStringBuffer(); 
     138                StringBuilder vBuf = HPoolBuffer.get().hGetStringBuilder(); 
    139139                vBuf.append("<liste>"); 
    140140 
     
    174174                } 
    175175 
    176                 HPoolBuffer.get().hFreeStringBuffer(vBuf); 
     176                HPoolBuffer.get().hFreeStringBuilder(vBuf); 
    177177 
    178178                return vResult; 
  • trunk/Jav_CO/com/scenari/m/co/xpath/dtm/ZXPathListXmlExpr.java

    r10215 r10372  
    119119 
    120120        XString vResult = null; 
    121         StringBuffer vBuf = HPoolBuffer.get().hGetStringBuffer(); 
     121        StringBuilder vBuf = HPoolBuffer.get().hGetStringBuilder(); 
    122122        vBuf.append("<liste>"); 
    123123 
     
    144144        } 
    145145 
    146         HPoolBuffer.get().hFreeStringBuffer(vBuf); 
     146        HPoolBuffer.get().hFreeStringBuilder(vBuf); 
    147147 
    148148        return vResult; 
  • trunk/Jav_CO/com/scenari/s/co/source/HRootSourceLoader.java

    r1710 r10372  
    5959 
    6060        /** Buffer de caractères. */ 
    61         protected StringBuffer fBuf = new StringBuffer(64); 
     61        protected StringBuilder fBuf = new StringBuilder(64); 
    6262 
    6363        /** 
  • trunk/Jav_CO/com/scenari/s/co/source/HSource.java

    r10196 r10372  
    117117                        while (!vOk) { 
    118118                                vID = Long.toString(Math.round(Math.random() * 100000)); 
    119                                 IHSource vChild = vParent.hFindSource(new StringBuffer(vPrefix.length() + vID.length() + pSuffix.length()).append(vPrefix).append(vID).append(pSuffix).toString()); 
     119                                IHSource vChild = vParent.hFindSource(new StringBuilder(vPrefix.length() + vID.length() + pSuffix.length()).append(vPrefix).append(vID).append(pSuffix).toString()); 
    120120                                if (vChild != null) { 
    121121                                        vOk = vChild.hNewFile(); 
  • trunk/Jav_CO/com/scenari/s/co/source/HZipper.java

    r3509 r10372  
    113113                                //On n'est pas le dossier racine 
    114114                                String vName = pSource.hGetName(); 
    115                                 vPath = new StringBuffer(pParentPath.length() + vName.length() + 1).append(pParentPath).append(vName).append('/').toString(); 
     115                                vPath = new StringBuilder(pParentPath.length() + vName.length() + 1).append(pParentPath).append(vName).append('/').toString(); 
    116116                                ZipEntry vEntry = new ZipEntry(vPath); 
    117117                                vEntry.setTime(pSource.hGetLastModif()); 
  • trunk/Jav_CO/com/scenari/s/co/source/fs/HSourceFs.java

    r4675 r10372  
    148148                        } 
    149149                } 
    150                 StringBuffer vBuf = null; 
     150                StringBuilder vBuf = null; 
    151151                int vOffset = 0; 
    152152                if(pPath.charAt(0) == '/') { 
    153153                        //Url absolue 
    154                         vBuf = new StringBuffer(pPath.length()); 
     154                        vBuf = new StringBuilder(pPath.length()); 
    155155                        vOffset = 1; 
    156156                } else { 
     
    160160                                int vLastSlash = fUri.lastIndexOf('/'); 
    161161                                if(vLastSlash>0) { 
    162                                         vBuf = new StringBuffer(vLastSlash + pPath.length()); 
     162                                        vBuf = new StringBuilder(vLastSlash + pPath.length()); 
    163163                                        vBuf.append(fUri.substring(0, vLastSlash)); 
    164164                                } else { 
    165                                         vBuf = new StringBuffer(pPath.length()); 
     165                                        vBuf = new StringBuilder(pPath.length()); 
    166166                                } 
    167167                        } else { 
    168168                                //Url relative par rapport à un dossier 
    169                                 vBuf = new StringBuffer(fUri.length() + pPath.length()); 
     169                                vBuf = new StringBuilder(fUri.length() + pPath.length()); 
    170170                                vBuf.append(fUri); 
    171171                        } 
     
    304304                                String vName = vChildsNames[i]; 
    305305                                WSourceElemFs vSrcChild = new WSourceElemFs(fElem, vName); 
    306                                 String vUri = new StringBuffer(vLenPrefix+vName.length()).append(fUri).append('/').append(vName).toString(); 
     306                                String vUri = new StringBuilder(vLenPrefix+vName.length()).append(fUri).append('/').append(vName).toString(); 
    307307                                pListToAppend.add(new HSourceFs(fStockSpace, fRoot, vSrcChild, vUri)); 
    308308                        } 
  • trunk/Jav_CO/com/scenari/s/co/sourcerel/WSourceRel.java

    r4675 r10372  
    190190                        String vParent = pParent.hGetUri(); 
    191191                        String vName = wGetName(); 
    192                         fUri = new StringBuffer(vParent.length() + 1 + vName.length()).append(vParent).append('/').append(vName).toString(); 
     192                        fUri = new StringBuilder(vParent.length() + 1 + vName.length()).append(vParent).append('/').append(vName).toString(); 
    193193                } else { 
    194194                        //On est sur un nouveau Root. 
  • trunk/Jav_CO/com/scenari/s/co/sourcerel/WSourceRelFrontEnd.java

    r4675 r10372  
    8787     */ 
    8888    protected IWSourceRel wGetChild(String pName) throws Exception { 
    89         return new WSourceRelFrontEnd(fBackEnd, new StringBuffer(fBackEndUri.length() + 1 + pName.length()).append(fBackEndUri).append('/').append(pName).toString()).wInit(fStockSpace, this); 
     89        return new WSourceRelFrontEnd(fBackEnd, new StringBuilder(fBackEndUri.length() + 1 + pName.length()).append(fBackEndUri).append('/').append(pName).toString()).wInit(fStockSpace, this); 
    9090    } 
    9191 
  • trunk/Jav_CO/com/scenari/s/co/sourcerel/WSourceRelFrontEndWithRights.java

    r4675 r10372  
    7070     */ 
    7171    protected IWSourceRel wGetChild(String pName) throws Exception { 
    72         return new WSourceRelFrontEndWithRights(fBackEnd, new StringBuffer(fBackEndUri.length() + 1 + pName.length()).append(fBackEndUri).append('/').append(pName).toString(), fRights).wInit(fStockSpace, this); 
     72        return new WSourceRelFrontEndWithRights(fBackEnd, new StringBuilder(fBackEndUri.length() + 1 + pName.length()).append(fBackEndUri).append('/').append(pName).toString(), fRights).wInit(fStockSpace, this); 
    7373    } 
    7474 
  • trunk/Jav_CO/com/scenari/s/co/transform/HTransformParams.java

    r10028 r10372  
    135135                                try { 
    136136                                        String vVal = URLEncoder.encode(fValue, "UTF-8"); 
    137                                         fQueryString = new StringBuffer(fKey.length() + 1 + vVal.length()).append(fKey).append('=').append(vVal).toString(); 
     137                                        fQueryString = new StringBuilder(fKey.length() + 1 + vVal.length()).append(fKey).append('=').append(vVal).toString(); 
    138138                                } catch (Exception e) { 
    139139                                        HLogMgr.hPublishException(e); 
     
    448448         */ 
    449449        public final String hGetQueryStringFromTop() { 
    450                 StringBuffer vBuf = new StringBuffer(256); 
    451                 hGetQueryStringBufferFromTop(vBuf); 
     450                StringBuilder vBuf = new StringBuilder(256); 
     451                hGetQueryStringBuilderFromTop(vBuf); 
    452452                return vBuf.toString(); 
    453453        } 
     
    465465         */ 
    466466        public final String hGetQueryStringFromThis() { 
    467                 StringBuffer vBuf = new StringBuffer(256); 
    468                 hGetQueryStringBufferFromThis(vBuf); 
     467                StringBuilder vBuf = new StringBuilder(256); 
     468                hGetQueryStringBuilderFromThis(vBuf); 
    469469                return vBuf.toString(); 
    470470        } 
     
    479479         * Les HTransformParams de la racine jusqu'a celui-ci sont retournés. 
    480480         */ 
    481         public final void hGetQueryStringBufferFromTop(StringBuffer pBuf) { 
     481        public final void hGetQueryStringBuilderFromTop(StringBuilder pBuf) { 
    482482                if (fPrevTransform != null) { 
    483                         fPrevTransform.hGetQueryStringBufferFromTop(pBuf); 
     483                        fPrevTransform.hGetQueryStringBuilderFromTop(pBuf); 
    484484                        pBuf.append('&'); 
    485485                } 
     
    505505         * Sont retournés ce HTransformParams et ses descendants. 
    506506         */ 
    507         public final void hGetQueryStringBufferFromThis(StringBuffer pBuf) { 
     507        public final void hGetQueryStringBuilderFromThis(StringBuilder pBuf) { 
    508508                pBuf.append(PARAM_TRANSFORM_EQ); 
    509509                pBuf.append(fTransformType); 
     
    517517                if (fNextTransform != null) { 
    518518                        pBuf.append('&'); 
    519                         fNextTransform.hGetQueryStringBufferFromThis(pBuf); 
     519                        fNextTransform.hGetQueryStringBuilderFromThis(pBuf); 
    520520                } 
    521521        } 
  • trunk/Jav_CO/com/scenari/s/co/transform/xml/HTransformerPonctuation.java

    r5250 r10372  
    8383            } 
    8484 
    85             StringBuffer vS = new StringBuffer((int) (vTexte.length() * 1.3)); 
     85            StringBuilder vS = new StringBuilder((int) (vTexte.length() * 1.3)); 
    8686            for (int i = 0; i < vTexte.length(); i++) { 
    8787                switch (vTexte.charAt(i)) { 
     
    179179    } 
    180180 
    181     //  static private void xRemoveSpaceBefore(StringBuffer pSB) { 
     181    //  static private void xRemoveSpaceBefore(StringBuilder pSB) { 
    182182    //          int i = pSB.length() - 1; 
    183183    //          if (i > 0) { 
  • trunk/Jav_FW/com/scenari/c/fw/main/EServletModelXml.java

    r6882 r10372  
    286286         */ 
    287287        protected String wLogRequeteClient(HttpServletRequest pRequest) { 
    288                 StringBuffer vBuf = new StringBuffer(256); 
     288                StringBuilder vBuf = new StringBuilder(256); 
    289289                vBuf.append("Encoding : "); 
    290290                vBuf.append(pRequest.getCharacterEncoding()); 
  • trunk/Jav_FW/com/scenari/s/fw/enumeration/WView.java

    r1702 r10372  
    7474public final String xSaveToBundle() { 
    7575 
    76         StringBuffer vResult = new StringBuffer(); 
     76        StringBuilder vResult = new StringBuilder(); 
    7777 
    7878        Enumeration vEnum = fViewValues.elements(); 
  • trunk/Jav_FW/com/scenari/s/fw/log/HLogMessage.java

    r2232 r10372  
    166166    public String hGetHtml() { 
    167167 
    168         StringBuffer vResult = new StringBuffer(256); 
     168        StringBuilder vResult = new StringBuilder(256); 
    169169 
    170170        IHLogMessage vLogMessage = this; 
     
    232232     */ 
    233233    public String hGetString() { 
    234         StringBuffer vResult = new StringBuffer(256); 
     234        StringBuilder vResult = new StringBuilder(256); 
    235235 
    236236        IHLogMessage vLogMessage = this; 
     
    296296 
    297297    /** 
    298      * Ajoute au StringBuffer passé en paramètre une forme HTML des attributs 
     298     * Ajoute au StringBuilder passé en paramètre une forme HTML des attributs 
    299299     * de ce message. Les messages parents ne sont pas décrits. 
    300300     * 
    301      * @param pBuf java.lang.StringBuffer : Buffer vers lequel envoyer la description Html du message. 
    302      */ 
    303     public void hWriteHtml(StringBuffer pBuf) { 
     301     * @param pBuf java.lang.StringBuilder : Buffer vers lequel envoyer la description Html du message. 
     302     */ 
     303    public void hWriteHtml(StringBuilder pBuf) { 
    304304 
    305305        pBuf.append("<div>"); 
     
    321321 
    322322    /** 
    323      * Ajoute au StringBuffer passé en paramètre une forme texte lisible des attributs 
     323     * Ajoute au StringBuilder passé en paramètre une forme texte lisible des attributs 
    324324     * de ce message. Les messages parents ne sont pas décrits. 
    325325     * 
    326      * @param pBuf java.lang.StringBuffer : Buffer vers lequel envoyer la description du message. 
    327      */ 
    328     public void hWriteString(StringBuffer pBuf) { 
     326     * @param pBuf java.lang.StringBuilder : Buffer vers lequel envoyer la description du message. 
     327     */ 
     328    public void hWriteString(StringBuilder pBuf) { 
    329329 
    330330        pBuf.append("--- "); 
     
    348348     * 
    349349     */ 
    350     private void xFormatHtml(String pValue, StringBuffer pBuf) { 
     350    private void xFormatHtml(String pValue, StringBuilder pBuf) { 
    351351        char vChar = 0; 
    352352        for (int i = 0; i < pValue.length(); i++) { 
  • trunk/Jav_FW/com/scenari/s/fw/log/IHLogMessage.java

    r2232 r10372  
    146146         
    147147        /** 
    148          * Ajoute au StringBuffer passé en paramètre une forme HTML des attributs 
     148         * Ajoute au StringBuilder passé en paramètre une forme HTML des attributs 
    149149         * de ce message. Les messages parents ne sont pas décrits. 
    150150         *  
    151151         * @param pBuf Buffer vers lequel envoyer la description Html du message. 
    152152         */ 
    153         public void hWriteHtml(StringBuffer pBuf); 
     153        public void hWriteHtml(StringBuilder pBuf); 
    154154     
    155155    /** 
     
    161161         
    162162        /** 
    163          * Ajoute au StringBuffer passé en paramètre une forme texte lisible des attributs 
     163         * Ajoute au StringBuilder passé en paramètre une forme texte lisible des attributs 
    164164         * de ce message. Les messages parents ne sont pas décrits. 
    165165         * 
    166166         * @param pBuf Buffer vers lequel envoyer la description du message. 
    167167         */ 
    168         public void hWriteString(StringBuffer pBuf); 
     168        public void hWriteString(StringBuilder pBuf); 
    169169} 
  • trunk/Jav_FW/com/scenari/s/fw/mem/HMemoryMgr.java

    r8755 r10372  
    138138                                                                if (vTs > 0) { 
    139139                                                                        vTs = System.currentTimeMillis() - vTs; 
    140                                                                         StringBuffer vBuf = new StringBuffer(255); 
     140                                                                        StringBuilder vBuf = new StringBuilder(255); 
    141141                                                                        vBuf.append("Purge mémoire"); 
    142142                                                                        vBuf.append("\nMémoire libre initiale : "); 
  • trunk/Jav_FW/com/scenari/s/fw/pooljdbc/HPoolMySql.java

    r1702 r10372  
    152152    public Connection hGetConnection() throws Exception { 
    153153        if (fUrl == null) { 
    154             StringBuffer vBuf = new StringBuffer(); 
     154            StringBuilder vBuf = new StringBuilder(); 
    155155            vBuf.append("jdbc:mysql://"); 
    156156            vBuf.append(fUrlServer); 
  • trunk/Jav_FW/com/scenari/s/fw/properties/HTextFileWriter.java

    r1862 r10372  
    9292 
    9393    /** 
    94      * @param pLine java.lang.StringBuffer 
     94     * @param pLine java.lang.StringBuilder 
    9595     */ 
    9696    public void hWrite(String pLine) throws Exception { 
     
    9999 
    100100    /** 
    101      * @param pLine java.lang.StringBuffer 
     101     * @param pLine java.lang.StringBuilder 
    102102     */ 
    103103    public void hWriteCommentLine(String pLine) throws Exception { 
    104104 
    105         StringBuffer vLine = new StringBuffer(); 
     105        StringBuilder vLine = new StringBuilder(); 
    106106        vLine.append('#').append(pLine).append('\n'); 
    107107        fBufferedWriter.write(vLine.toString()); 
     
    110110 
    111111    /** 
    112      * @param pLine java.lang.StringBuffer 
     112     * @param pLine java.lang.StringBuilder 
    113113     */ 
    114     public void hWriteCommentLine(StringBuffer pLine) throws Exception { 
     114    public void hWriteCommentLine(StringBuilder pLine) throws Exception { 
    115115        fBufferedWriter.write(pLine.insert(0, '#').append('\n').toString()); 
    116116    } 
    117117 
    118118    /** 
    119      * @param pLine java.lang.StringBuffer 
     119     * @param pLine java.lang.StringBuilder 
    120120     */ 
    121     public void hWriteLine(StringBuffer pLine) throws Exception { 
     121    public void hWriteLine(StringBuilder pLine) throws Exception { 
    122122        fBufferedWriter.write(pLine.append('\n').toString()); 
    123123    } 
  • trunk/Jav_FW/com/scenari/s/fw/properties/loaders/xml/XAloneSaxHandler.java

    r1702 r10372  
    7373                        fValue = new String(pChar, pStart, pLength); 
    7474                } else { 
    75                         fValue = new StringBuffer(fValue.length() + pLength).append(fValue).append(pChar, pStart, pLength).toString(); 
     75                        fValue = new StringBuilder(fValue.length() + pLength).append(fValue).append(pChar, pStart, pLength).toString(); 
    7676                } 
    7777        } 
  • trunk/Jav_FW/com/scenari/s/fw/properties/loaders/xml/XLogParamSaxHandler.java

    r1702 r10372  
    121121         
    122122        protected String xReplace(String pSrc){ 
    123            StringBuffer  vRes = null; 
     123           StringBuilder  vRes = null; 
    124124           if(pSrc != null) { 
    125125               int vIdx = pSrc.indexOf('{'); 
    126126               if(vIdx >= 0) { 
    127                    vRes = new StringBuffer(pSrc.length()+128); 
     127                   vRes = new StringBuilder(pSrc.length()+128); 
    128128                   if(vIdx>0) vRes.append(pSrc.substring(0, vIdx)); 
    129129                   int vIdxEnd = vIdx; 
  • trunk/Jav_FW/com/scenari/s/fw/properties/stringlist/HStringListLoaderFromTextFile.java

    r1702 r10372  
    7676        int vIndex = -1; 
    7777 
    78         StringBuffer vTrace = null; 
     78        StringBuilder vTrace = null; 
    7979        if (sTrace.hIsActive()) { 
    80                 vTrace = new StringBuffer(); 
     80                vTrace = new StringBuilder(); 
    8181                vTrace.append("Read proerties : "); 
    8282                vTrace.append(vProp.hGetCode()); 
     
    116116        HStringListProperties vProp = (HStringListProperties)pProperties; 
    117117 
    118         StringBuffer vStringBuffer = new StringBuffer(); 
     118        StringBuilder vStringBuilder = new StringBuilder(); 
    119119 
    120120        Enumeration vEnumKey = vProp.hScanPropertyList().keys(); 
     
    122122                         
    123123        while(vEnumKey.hasMoreElements()) { 
    124                 vStringBuffer.setLength(0); 
     124                vStringBuilder.setLength(0); 
    125125                try { 
    126                         vStringBuffer.append((String)vEnumKey.nextElement()); 
    127                         vStringBuffer.append('\t'); 
    128                         vStringBuffer.append(HStringProperty.hGetValue((HStringProperty)vEnumValue.nextElement(), pLevel)); 
    129                         vWriter.hWriteLine(vStringBuffer); 
     126                        vStringBuilder.append((String)vEnumKey.nextElement()); 
     127                        vStringBuilder.append('\t'); 
     128                        vStringBuilder.append(HStringProperty.hGetValue((HStringProperty)vEnumValue.nextElement(), pLevel)); 
     129                        vWriter.hWriteLine(vStringBuilder); 
    130130                } 
    131131                catch (XPropertyNotFoundException e){ 
  • trunk/Jav_FW/com/scenari/s/fw/properties/stringlist/HStringListProperties.java

    r1862 r10372  
    121121        String vParam[] = new String[pParam.length]; 
    122122        int vIndex[] = new int[pParam.length]; 
    123         StringBuffer vResult = null; 
     123        StringBuilder vResult = null; 
    124124        String vValue = null; 
    125125        int vLength = 0; 
     
    155155        } 
    156156 
    157         vResult = new StringBuffer(vLength); 
     157        vResult = new StringBuilder(vLength); 
    158158 
    159159        int vLastIndex = 0; 
  • trunk/Jav_FW/com/scenari/s/fw/util/xml/HEncodingXml.java

    r9001 r10372  
    4040 
    4141import java.io.IOException; 
    42 import java.io.Writer; 
    4342 
    4443/** 
     
    4645 */ 
    4746public class HEncodingXml { 
    48     /** 
    49      * HEncodingXml constructor comment. 
    50      */ 
    51     public HEncodingXml() { 
    52         super(); 
    53     } 
    54  
    55     /** 
    56      * Sérialize la valeur d'un attribut. Assume la transformation des caractères protégés (&, <, >, ") 
    57      * et des retours charriots. 
    58      * sans le ' : &apos non géré das IE. 
    59      */ 
    60     public final static void hWriteAttributHtmlValue(StringBuffer pBuf, String pValue) { 
    61  
    62         for (int i = 0; i < pValue.length(); i++) { 
    63             char vCar = pValue.charAt(i); 
    64             switch (vCar) { 
    65             case '\"': { 
    66                 pBuf.append("&quot;"); 
    67                 break; 
    68             } 
    69             case '<': { 
    70                 pBuf.append("&lt;"); 
    71                 break; 
    72             } 
    73             case '>': { 
    74                 pBuf.append("&gt;"); 
    75                 break; 
    76             } 
    77             case '&': { 
    78                 pBuf.append("&amp;"); 
    79                 break; 
    80             } 
    81             case '\'': { 
    82                 pBuf.append('\''); 
    83                 //pBuf.append("&apos;"); 
    84                 break; 
    85             } 
    86             case '\t': 
    87             case '\n': { 
    88                 pBuf.append(" "); 
    89                 break; 
    90             } 
    91             case '\b': 
    92             case '\r': { 
    93                 // 
    94                 break; 
    95             } 
    96             default: { 
    97                 pBuf.append(vCar); 
    98             } 
    99             } 
    100         } 
    101  
    102     } 
    103      
    104     /** 
    105      * Sérialize la valeur d'un attribut. Protège les caractères spéciaux (guillemet simple et double, retour à la ligne, etc.) pour que la chaine puisse être placée en guillemets dans du code javascript. 
    106      */ 
    107     public final static void hWriteJsValue(StringBuffer pBuf, String pValue) { 
    108  
    109         for (int i = 0; i < pValue.length(); i++) { 
    110             char vCar = pValue.charAt(i); 
    111             switch (vCar) { 
    112                     case '\'' : 
    113                                         { 
    114                                                 pBuf.append("\\\'"); 
    115                                                 break; 
    116                                         } 
    117                                 case '\"' : 
    118                                         { 
    119                                                 pBuf.append("\\\""); 
    120                                                 break; 
    121                                         } 
    122                                 case '\\' : 
    123                                         { 
    124                                                 pBuf.append("\\\\"); 
    125                                                 break; 
    126                                         } 
    127                                 case '\n' : 
    128                                         { 
    129                                                 pBuf.append("\\\n"); 
    130                                                 break; 
    131                                         } 
    132                                 case '\r' : 
    133                                         { 
    134                                                 // 
    135                                                 break; 
    136                                         } 
    137                                 case '\t' : 
    138                                         { 
    139                                                 pBuf.append("\\\t"); 
    140                                                 break; 
    141                                         } 
    142                                 default : 
    143                                         { 
    144                                                 pBuf.append(vCar); 
    145                                         } 
    146             } 
    147         } 
    148  
    149     } 
    150  
    151     /** 
    152      * Sérialize la valeur d'un attribut. Assume la transformation des caractères protégés (&, <, >, ", ') 
    153      * et des retours charriots. 
    154      */ 
    155     public final static void hWriteAttributValue(StringBuffer pBuf, String pValue) { 
    156  
    157         for (int i = 0; i < pValue.length(); i++) { 
    158             char vCar = pValue.charAt(i); 
    159             switch (vCar) { 
    160             case '\"': { 
    161                 pBuf.append("&quot;"); 
    162                 break; 
    163             } 
    164             case '<': { 
    165                 pBuf.append("&lt;"); 
    166                 break; 
    167             } 
    168             case '>': { 
    169                 pBuf.append("&gt;"); 
    170                 break; 
    171             } 
    172             case '&': { 
    173                 pBuf.append("&amp;"); 
    174                 break; 
    175             } 
    176             case '\'': { 
    177                 pBuf.append("&apos;"); 
    178                 break; 
    179             } 
    180             case '\t': 
    181             case '\n': { 
    182                 pBuf.append(" "); 
    183                 break; 
    184             } 
    185             case '\b': 
    186             case '\r': { 
    187                 // 
    188                 break; 
    189             } 
    190             default: { 
    191                 pBuf.append(vCar); 
    192             } 
    193             } 
    194         } 
    195  
    196     } 
    197  
    198     /** 
    199      * Sérialize la valeur d'un attribut. Assume la transformation des caractères protégés (&, <, >, ", ') 
    200      * et des retours charriots. 
    201      */ 
    202     public final static void hWriteAttributValue(Writer pBuf, String pValue) throws IOException { 
    203         if (pValue == null || pBuf == null) { 
    204             return; 
    205         } 
    206         for (int i = 0; i < pValue.length(); i++) { 
    207             char vCar = pValue.charAt(i); 
    208             switch (vCar) { 
    209             case '\"': { 
    210                 pBuf.write("&quot;"); 
    211                 break; 
    212             } 
    213             case '<': { 
    214                 pBuf.write("&lt;"); 
    215                 break; 
    216             } 
    217             case '>': { 
    218                 pBuf.write("&gt;"); 
    219                 break; 
    220             } 
    221             case '&': { 
    222                 pBuf.write("&amp;"); 
    223                 break; 
    224             } 
    225             case '\'': { 
    226                 pBuf.write("&apos;"); 
    227                 break; 
    228             } 
    229             case '\t': 
    230             case '\n': { 
    231                 pBuf.write(" "); 
    232                 break; 
    233             } 
    234             case '\b': 
    235             case '\r': { 
    236                 // 
    237                 break; 
    238             } 
    239             default: { 
    240                 pBuf.write(vCar); 
    241             } 
    242             } 
    243         } 
    244  
    245     } 
    246  
    247     /** 
    248      * Sérialize la valeur d'un Node de type Text. Assume la transformation des caractères protégés (&, <, >, ") 
    249      * sauf le ' non géré par IE. 
    250      */ 
    251     public final static void hWriteTextHtmlValue(StringBuffer pBuf, String pValue) { 
    252  
    253         for (int i = 0; i < pValue.length(); i++) { 
    254             char vCar = pValue.charAt(i); 
    255             switch (vCar) { 
    256             case '\"': { 
    257                 pBuf.append("&quot;"); 
    258                 break; 
    259             } 
    260             case '<': { 
    261                 pBuf.append("&lt;"); 
    262                 break; 
    263             } 
    264             case '>': { 
    265                 pBuf.append("&gt;"); 
    266                 break; 
    267             } 
    268             case '&': { 
    269                 pBuf.append("&amp;"); 
    270                 break; 
    271             } 
    272             case '\'': { 
    273                 //pBuf.append("&apos;"); 
    274                 pBuf.append('\''); 
    275                 break; 
    276             } 
    277             default: { 
    278                 pBuf.append(vCar); 
    279             } 
    280             } 
    281         } 
    282  
    283     } 
    284  
    285     /** 
    286      * Sérialize la valeur d'un Node de type Text. Assume la transformation des caractères protégés (&, <, >, ", '). 
    287      */ 
    288     public final static void hWriteTextValue(StringBuffer pBuf, char[] pChar, int pStart, int pLength) { 
    289  
    290         int vEnd = pStart + pLength; 
    291         for (int i = pStart; i < vEnd; i++) { 
    292             switch (pChar[i]) { 
    293             case '\"': { 
    294                 pBuf.append("&quot;"); 
    295                 break; 
    296             } 
    297             case '<': { 
    298                 pBuf.append("&lt;"); 
    299                 break; 
    300             } 
    301             case '>': { 
    302                 pBuf.append("&gt;"); 
    303                 break; 
    304             } 
    305             case '&': { 
    306                 pBuf.append("&amp;"); 
    307                 break; 
    308             } 
    309             case '\'': { 
    310                 pBuf.append("&apos;"); 
    311                 break; 
    312             } 
    313             default: { 
    314                 pBuf.append(pChar[i]); 
    315             } 
    316             } 
    317         } 
    318  
    319     } 
    320  
    321     /** 
    322      * Sérialize la valeur d'un attribut. 
    323      * Assume la transformation des caractères protégés (&, <, >, ", '). 
    324      *  
    325      */ 
    326     public final static void hWriteTextValue(StringBuffer pBuf, String pValue) { 
    327  
    328         for (int i = 0; i < pValue.length(); i++) { 
    329             char vCar = pValue.charAt(i); 
    330             switch (vCar) { 
    331             case '\"': { 
    332                 pBuf.append("&quot;"); 
    333                 break; 
    334             } 
    335             case '<': { 
    336                 pBuf.append("&lt;"); 
    337                 break; 
    338             } 
    339             case '>': { 
    340                 pBuf.append("&gt;"); 
    341                 break; 
    342             } 
    343             case '&': { 
    344                 pBuf.append("&amp;"); 
    345                 break; 
    346             } 
    347             case '\'': { 
    348                 pBuf.append("&apos;"); 
    349                 break; 
    350             } 
    351             default: { 
    352                 pBuf.append(vCar); 
    353             } 
    354             } 
    355         } 
    356  
    357     } 
    358  
    359     /** 
    360      * Sérialize la valeur d'un attribut. 
    361      * Assume la transformation des caractères protégés (&, <, >, ", '). 
    362      *  
    363      */ 
    364     public final static String getTextValue(String pValue) { 
    365         StringBuffer vBuf = new StringBuffer(pValue.length()+12); 
    366         hWriteTextValue(vBuf, pValue); 
    367         return vBuf.toString(); 
    368     } 
     47        /** 
     48         * HEncodingXml constructor comment. 
     49         */ 
     50        public HEncodingXml() { 
     51                super(); 
     52        } 
     53 
     54        /** 
     55         * Sérialize la valeur d'un attribut. Assume la transformation des caractères protégés (&, <, >, ") 
     56         * et des retours charriots. 
     57         * sans le ' : &apos non géré das IE. 
     58         */ 
     59        public final static void hWriteAttributHtmlValue(Appendable pBuf, CharSequence pValue) throws IOException { 
     60 
     61                for (int i = 0, l = pValue.length(); i < l; i++) { 
     62                        char vCar = pValue.charAt(i); 
     63                        switch (vCar) { 
     64                        case '\"': { 
     65                                pBuf.append("&quot;"); 
     66                                break; 
     67                        } 
     68                        case '<': { 
     69                                pBuf.append("&lt;"); 
     70                                break; 
     71                        } 
     72                        case '>': { 
     73                                pBuf.append("&gt;"); 
     74                                break; 
     75                        } 
     76                        case '&': { 
     77                                pBuf.append("&amp;"); 
     78                                break; 
     79                        } 
     80                        case '\'': { 
     81                                pBuf.append('\''); 
     82                                //pBuf.append("&apos;"); 
     83                                break; 
     84                        } 
     85                        case '\t': 
     86                        case '\n': { 
     87                                pBuf.append(" "); 
     88                                break; 
     89                        } 
     90                        case '\b': 
     91                        case '\r': { 
     92                                // 
     93                                break; 
     94                        } 
     95                        default: { 
     96                                pBuf.append(vCar); 
     97                        } 
     98                        } 
     99                } 
     100 
     101        } 
     102 
     103        /** 
     104         * Sérialize la valeur d'un attribut. Protège les caractères spéciaux (guillemet simple et double, retour à la ligne, etc.) pour que la chaine puisse être placée en guillemets dans du code javascript. 
     105         */ 
     106        public final static void hWriteJsValue(Appendable pBuf, CharSequence pValue) throws IOException { 
     107 
     108                for (int i = 0, l = pValue.length(); i < l; i++) { 
     109                        char vCar = pValue.charAt(i); 
     110                        switch (vCar) { 
     111                        case '\'': { 
     112                                pBuf.append("\\\'"); 
     113                                break; 
     114                        } 
     115                        case '\"': { 
     116                                pBuf.append("\\\""); 
     117                                break; 
     118                        } 
     119                        case '\\': { 
     120                                pBuf.append("\\\\"); 
     121                                break; 
     122                        } 
     123                        case '\n': { 
     124                                pBuf.append("\\\n"); 
     125                                break; 
     126                        } 
     127                        case '\r': { 
     128                                // 
     129                                break; 
     130                        } 
     131                        case '\t': { 
     132                                pBuf.append("\\\t"); 
     133                                break; 
     134                        } 
     135                        default: { 
     136                                pBuf.append(vCar); 
     137                        } 
     138                        } 
     139                } 
     140 
     141        } 
     142 
     143        /** 
     144         * Sérialize la valeur d'un attribut. Assume la transformation des caractères protégés (&, <, >, ", ') 
     145         * et des retours charriots. 
     146         */ 
     147        public final static void hWriteAttributValue(Appendable pBuf, CharSequence pValue) throws IOException { 
     148                if (pValue == null || pBuf == null) return; 
     149                for (int i = 0, l = pValue.length(); i < l; i++) { 
     150                        char vCar = pValue.charAt(i); 
     151                        switch (vCar) { 
     152                        case '\"': { 
     153                                pBuf.append("&quot;"); 
     154                                break; 
     155                        } 
     156                        case '<': { 
     157                                pBuf.append("&lt;"); 
     158                                break; 
     159                        } 
     160                        case '>': { 
     161                                pBuf.append("&gt;"); 
     162                                break; 
     163                        } 
     164                        case '&': { 
     165                                pBuf.append("&amp;"); 
     166                                break; 
     167                        } 
     168                        case '\'': { 
     169                                pBuf.append("&apos;"); 
     170                                break; 
     171                        } 
     172                        case '\t': 
     173                        case '\n': { 
     174                                pBuf.append(" "); 
     175                                break; 
     176                        } 
     177                        case '\b': 
     178                        case '\r': { 
     179                                // 
     180                                break; 
     181                        } 
     182                        default: { 
     183                                pBuf.append(vCar); 
     184                        } 
     185                        } 
     186                } 
     187 
     188        } 
     189 
     190        /** 
     191         * Sérialize la valeur d'un Node de type Text. Assume la transformation des caractères protégés (&, <, >, ") 
     192         * sauf le ' non géré par IE. 
     193         */ 
     194        public final static void hWriteTextHtmlValue(Appendable pBuf, CharSequence pValue) throws IOException { 
     195 
     196                for (int i = 0, l = pValue.length(); i < l; i++) { 
     197                        char vCar = pValue.charAt(i); 
     198                        switch (vCar) { 
     199                        case '\"': { 
     200                                pBuf.append("&quot;"); 
     201                                break; 
     202                        } 
     203                        case '<': { 
     204                                pBuf.append("&lt;"); 
     205                                break; 
     206                        } 
     207                        case '>': { 
     208                                pBuf.append("&gt;"); 
     209                                break; 
     210                        } 
     211                        case '&': { 
     212                                pBuf.append("&amp;"); 
     213                                break; 
     214                        } 
     215                        case '\'': { 
     216                                //pBuf.append("&apos;"); 
     217                                pBuf.append('\''); 
     218                                break; 
     219                        } 
     220                        default: { 
     221                                pBuf.append(vCar); 
     222                        } 
     223                        } 
     224                } 
     225 
     226        } 
     227 
     228        /** 
     229         * Sérialize la valeur d'un Node de type Text. Assume la transformation des caractères protégés (&, <, >, ", '). 
     230         */ 
     231        public final static void hWriteTextValue(Appendable pBuf, char[] pChar, int pStart, int pLength) throws IOException { 
     232 
     233                int vEnd = pStart + pLength; 
     234                for (int i = pStart; i < vEnd; i++) { 
     235                        switch (pChar[i]) { 
     236                        case '\"': { 
     237                                pBuf.append("&quot;"); 
     238                                break; 
     239                        } 
     240                        case '<': { 
     241                                pBuf.append("&lt;"); 
     242                                break; 
     243                        } 
     244                        case '>': { 
     245                                pBuf.append("&gt;"); 
     246                                break; 
     247                        } 
     248                        case '&': { 
     249                                pBuf.append("&amp;"); 
     250                                break; 
     251                        } 
     252                        case '\'': { 
     253                                pBuf.append("&apos;"); 
     254                                break; 
     255                        } 
     256                        default: { 
     257                                pBuf.append(pChar[i]); 
     258                        } 
     259                        } 
     260                } 
     261 
     262        } 
     263 
     264        /** 
     265         * Sérialize la valeur d'un attribut. 
     266         * Assume la transformation des caractères protégés (&, <, >, ", '). 
     267         *  
     268         */ 
     269        public final static void hWriteTextValue(Appendable pBuf, CharSequence pValue) throws IOException { 
     270 
     271                for (int i = 0, l = pValue.length(); i < l; i++) { 
     272                        char vCar = pValue.charAt(i); 
     273                        switch (vCar) { 
     274                        case '\"': { 
     275                                pBuf.append("&quot;"); 
     276                                break; 
     277                        } 
     278                        case '<': { 
     279                                pBuf.append("&lt;"); 
     280                                break; 
     281                        } 
     282                        case '>': { 
     283                                pBuf.append("&gt;"); 
     284                                break; 
     285                        } 
     286                        case '&': { 
     287                                pBuf.append("&amp;"); 
     288                                break; 
     289                        } 
     290                        case '\'': { 
     291                                pBuf.append("&apos;"); 
     292                                break; 
     293                        } 
     294                        default: { 
     295                                pBuf.append(vCar); 
     296                        } 
     297                        } 
     298                } 
     299 
     300        } 
     301 
     302        /** 
     303         * Sérialize la valeur d'un attribut. 
     304         * Assume la transformation des caractères protégés (&, <, >, ", '). 
     305         *  
     306         */ 
     307        public final static String getTextValue(String pValue) { 
     308                StringBuilder vBuf = new StringBuilder(pValue.length() + 12); 
     309                try { 
     310                        hWriteTextValue(vBuf, pValue); 
     311                } catch (IOException e) { 
     312                        // 
     313                } 
     314                return vBuf.toString(); 
     315        } 
    369316} 
  • trunk/Jav_FW/com/scenari/s/fw/util/xml/HExtraitSaxHandlerToText.java

    r1702 r10372  
    5252/** 
    5353 * Permet de construire une chaine texte à partir d'évenements Sax. 
    54  * Attention le reset du StringBuffer doit être assuré avant la transmission à ce SaxHandler. 
     54 * Attention le reset du StringBuilder doit être assuré avant la transmission à ce SaxHandler. 
    5555 * Les tag CDATA , les comments, les déclarations d'entités et de DTD ne sont pas recopiés. 
    5656 * Les caractères ", '<', '>'ne sont pas escapés. 
     
    6969        protected XMLReader fXMLReader = null; 
    7070         
    71         /** StringBuffer à remplir. */ 
    72         protected StringBuffer fStringBuffer = null;     
     71        /** StringBuilder à remplir. */ 
     72        protected StringBuilder fStringBuilder = null;   
    7373         
    7474        /** Compteur de la profondeur du tag en cours. */ 
     
    8787} 
    8888public final void characters(char[] pChar, int pStart, int pLength) throws SAXException { 
    89         fStringBuffer.append(pChar, pStart, pLength); 
     89        fStringBuilder.append(pChar, pStart, pLength); 
    9090} 
    9191 /** 
     
    111111 */ 
    112112public void endCDATA() throws org.xml.sax.SAXException { 
    113         //fStringBuffer.append("]]>"); 
     113        //fStringBuilder.append("]]>"); 
    114114} 
    115115/** 
     
    157157 
    158158                        //On ajoute ce fin de tag dans le buffer 
    159                         if (fOffsetLastElementInDonnee == fStringBuffer.length()) { 
    160                                 if (fStringBuffer.length() > 0) { 
     159                        if (fOffsetLastElementInDonnee == fStringBuilder.length()) { 
     160                                if (fStringBuilder.length() > 0) { 
    161161                                        //Pas de contenu au tag. 
    162                                         fStringBuffer.setCharAt(fStringBuffer.length() - 1, '/'); 
    163                                         fStringBuffer.append('>'); 
     162                                        fStringBuilder.setCharAt(fStringBuilder.length() - 1, '/'); 
     163                                        fStringBuilder.append('>'); 
    164164                                } 
    165165                        } else { 
    166166                                //Il y a eu un contenu au tag. 
    167                                 fStringBuffer.append("</"); 
    168                                 fStringBuffer.append(pQName); 
    169                                 fStringBuffer.append('>'); 
     167                                fStringBuilder.append("</"); 
     168                                fStringBuilder.append(pQName); 
     169                                fStringBuilder.append('>'); 
    170170                        } 
    171171 
     
    205205 *  
    206206 *  
    207  * @return java.lang.StringBuffer 
    208  */ 
    209 public final StringBuffer hGetStringBuffer() { 
    210         return fStringBuffer; 
     207 * @return java.lang.StringBuilder 
     208 */ 
     209public final StringBuilder hGetStringBuilder() { 
     210        return fStringBuilder; 
    211211} 
    212212/** 
     
    221221 *  
    222222 *  
    223  * @param pBuffer java.lang.StringBuffer 
    224  */ 
    225 public void hSetStringBuffer(StringBuffer pBuffer) { 
    226         fStringBuffer = pBuffer;         
     223 * @param pBuffer java.lang.StringBuilder 
     224 */ 
     225public void hSetStringBuilder(StringBuilder pBuffer) { 
     226        fStringBuilder = pBuffer;        
    227227} 
    228228/** 
     
    345345 */ 
    346346public void startCDATA() throws org.xml.sax.SAXException { 
    347         //fStringBuffer.append("<![CDATA["); 
     347        //fStringBuilder.append("<![CDATA["); 
    348348} 
    349349/** 
     
    397397 
    398398            //On ajoute ce tag dans le buffer 
    399         fStringBuffer.append('<'); 
    400         fStringBuffer.append(pQName); 
     399        fStringBuilder.append('<'); 
     400        fStringBuilder.append(pQName); 
    401401 
    402402        //Prefixes 
     
    405405                        for (int i = 0; i < fPrefixMappingList.size(); i++) { 
    406406                                vPrefix = (String[])fPrefixMappingList.get(i); 
    407                                 fStringBuffer.append(" xmlns:"); 
    408                                 fStringBuffer.append(vPrefix[0]); 
    409                                 fStringBuffer.append("=\""); 
    410                                 fStringBuffer.append(vPrefix[1]); 
    411                             fStringBuffer.append('\"'); 
     407                                fStringBuilder.append(" xmlns:"); 
     408                                fStringBuilder.append(vPrefix[0]); 
     409                                fStringBuilder.append("=\""); 
     410                                fStringBuilder.append(vPrefix[1]); 
     411                            fStringBuilder.append('\"'); 
    412412                        } 
    413413                        fPrefixMappingList.clear(); 
     
    416416        //Attributs 
    417417        for (int i = 0; i < pAttributes.getLength(); i++) { 
    418             fStringBuffer.append(' '); 
    419             fStringBuffer.append(pAttributes.getQName(i)); 
    420             fStringBuffer.append("=\""); 
    421             HEncodingXml.hWriteAttributValue(fStringBuffer, pAttributes.getValue(i)); 
    422             fStringBuffer.append('\"'); 
     418            fStringBuilder.append(' '); 
     419            fStringBuilder.append(pAttributes.getQName(i)); 
     420            fStringBuilder.append("=\""); 
     421            HEncodingXml.hWriteAttributValue(fStringBuilder, pAttributes.getValue(i)); 
     422            fStringBuilder.append('\"'); 
    423423        } 
    424         fStringBuffer.append('>'); 
    425  
    426         fOffsetLastElementInDonnee = fStringBuffer.length(); 
     424        fStringBuilder.append('>'); 
     425 
     426        fOffsetLastElementInDonnee = fStringBuilder.length(); 
    427427         
    428428        //On incrémente la pile. 
  • trunk/Jav_FW/com/scenari/s/fw/util/xml/HExtraitSaxHandlerToXml.java

    r1871 r10372  
    3939package com.scenari.s.fw.util.xml; 
    4040 
     41import java.io.IOException; 
    4142import java.util.ArrayList; 
    4243import java.util.List; 
     
    5253/** 
    5354 * Permet de reconstruire une chaine texte représentant le document XML en cours de parsing. 
    54  * Attention le reset du StringBuffer doit être assuré avant la transmission à ce SaxHandler. 
     55 * Attention le reset du StringBuilder doit être assuré avant la transmission à ce SaxHandler. 
    5556 * Cette implémentation nécessite une réfrence au XmlReader générant les évènements Sax pour réaffecter 
    5657 * le content handler père lorsque le parsing sort du noeud racine où ce content handler a comencé. 
     
    5859public class HExtraitSaxHandlerToXml implements ContentHandler, LexicalHandler { 
    5960 
    60  
    6161        /** Handler père. */ 
    6262        protected ContentHandler fParent = null; 
     
    6464        /** Lexical Handler père. */ 
    6565        protected LexicalHandler fLexParent = null; 
    66                  
     66 
    6767        /** Driver du parsing. */ 
    6868        protected XMLReader fXMLReader = null; 
    69          
    70         /** StringBuffer à remplir. */ 
    71         protected StringBuffer fStringBuffer = null;     
    72          
     69 
     70        /** StringBuilder à remplir. */ 
     71        protected StringBuilder fStringBuilder = null; 
     72 
    7373        /** Compteur de la profondeur du tag en cours. */ 
    7474        protected int fDepthTag = 0; 
    75          
     75 
    7676        /** CDATA en cours. */ 
    7777        protected boolean fInCdata = false; 
    78          
     78 
    7979        /** Offset du car '>' du dernier startElement lu. */ 
    8080        protected int fOffsetLastElementInDonnee = 0; 
     
    8282        /** Liste de prefixMapping. */ 
    8383        protected List fPrefixMappingList = null; 
    84 /** 
    85  * XSaxHandlerInDonnee constructor comment. 
    86  */ 
    87 public HExtraitSaxHandlerToXml() { 
    88         super(); 
    89 } 
    90 public final void characters(char[] pChar, int pStart, int pLength) throws SAXException { 
    91         if(fInCdata) { 
    92                 fStringBuffer.append(pChar, pStart, pLength); 
    93         } else { 
    94                 HEncodingXml.hWriteTextValue(fStringBuffer, pChar, pStart, pLength); 
    95         } 
    96 } 
    97  /** 
    98      * Report an XML comment anywhere in the document. 
    99      * 
    100      * <p>This callback will be used for comments inside or outside the 
    101      * document element, including comments in the external DTD 
    102      * subset (if read).  Comments in the DTD must be properly 
    103      * nested inside start/endDTD and start/endEntity events (if 
    104      * used).</p> 
    105      * 
    106      * @param ch An array holding the characters in the comment. 
    107      * @param start The starting position in the array. 
    108      * @param length The number of characters to use from the array. 
    109      * @exception SAXException The application may raise an exception. 
    110      */ 
    111 public void comment(char[] ch, int start, int length) throws org.xml.sax.SAXException {} 
    112 /** 
    113  * Report the end of a CDATA section. 
    114  * 
    115  * @exception SAXException The application may raise an exception. 
    116  * @see #startCDATA 
    117  */ 
    118 public void endCDATA() throws org.xml.sax.SAXException { 
    119         fStringBuffer.append("]]>"); 
    120         fInCdata = false; 
    121 } 
    122 /** 
    123  * Receive notification of the end of a document. 
    124  * 
    125  * <p>The SAX parser will invoke this method only once, and it will 
    126  * be the last method invoked during the parse.  The parser shall 
    127  * not invoke this method until it has either abandoned parsing 
    128  * (because of an unrecoverable error) or reached the end of 
    129  * input.</p> 
    130  * 
    131  * @exception org.xml.sax.SAXException Any SAX exception, possibly 
    132  *            wrapping another exception. 
    133  * @see #startDocument 
    134  */ 
    135 public void endDocument() throws org.xml.sax.SAXException {} 
    136  /** 
    137      * Report the end of DTD declarations. 
    138      * 
    139      * <p>This method is intended to report the end of the 
    140      * DOCTYPE declaration; if the document has no DOCTYPE declaration, 
    141      * this method will not be invoked.</p> 
    142      * 
    143      * @exception SAXException The application may raise an exception. 
    144      * @see #startDTD 
    145      */ 
    146 public void endDTD() throws org.xml.sax.SAXException {} 
    147 /** 
    148  *  
    149  */ 
    150 public void endElement(String pNamespaceURI, String pLocalName, String pQName) throws SAXException { 
    151         try { 
    152  
    153                 if (fDepthTag == 0) { 
    154                         //On doit reourner au Sax Handler père. 
    155                         if (fParent != null) { 
    156                                 //On redonne la main au père 
    157                                 fXMLReader.setContentHandler(fParent); 
    158                                 try { 
    159                                         fXMLReader.setProperty("http://xml.org/sax/properties/lexical-handler", fLexParent); 
    160                                 } catch (Exception e) {} 
    161                                 fParent.endElement(pNamespaceURI, pLocalName, pQName); 
     84 
     85        /** 
     86         * XSaxHandlerInDonnee constructor comment. 
     87         */ 
     88        public HExtraitSaxHandlerToXml() { 
     89                super(); 
     90        } 
     91 
     92        public final void characters(char[] pChar, int pStart, int pLength) throws SAXException { 
     93                if (fInCdata) { 
     94                        fStringBuilder.append(pChar, pStart, pLength); 
     95                } else { 
     96                        try { 
     97                                HEncodingXml.hWriteTextValue(fStringBuilder, pChar, pStart, pLength); 
     98                        } catch (IOException e) { 
     99                                // 
    162100                        } 
    163                 } else { 
    164  
    165                         //On ajoute ce fin de tag dans le buffer 
    166                         if (fOffsetLastElementInDonnee == fStringBuffer.length()) { 
    167                                 if (fStringBuffer.length() > 0) { 
    168                                         //Pas de contenu au tag. 
    169                                         fStringBuffer.setCharAt(fStringBuffer.length() - 1, '/'); 
    170                                         fStringBuffer.append('>'); 
     101                } 
     102        } 
     103 
     104        /** 
     105         * Report an XML comment anywhere in the document. 
     106         * 
     107         * <p>This callback will be used for comments inside or outside the 
     108         * document element, including comments in the external DTD 
     109         * subset (if read).  Comments in the DTD must be properly 
     110         * nested inside start/endDTD and start/endEntity events (if 
     111         * used).</p> 
     112         * 
     113         * @param ch An array holding the characters in the comment. 
     114         * @param start The starting position in the array. 
     115         * @param length The number of characters to use from the array. 
     116         * @exception SAXException The application may raise an exception. 
     117         */ 
     118        public void comment(char[] ch, int start, int length) throws org.xml.sax.SAXException { 
     119        } 
     120 
     121        /** 
     122         * Report the end of a CDATA section. 
     123         * 
     124         * @exception SAXException The application may raise an exception. 
     125         * @see #startCDATA 
     126         */ 
     127        public void endCDATA() throws org.xml.sax.SAXException { 
     128                fStringBuilder.append("]]>"); 
     129                fInCdata = false; 
     130        } 
     131 
     132        /** 
     133         * Receive notification of the end of a document. 
     134         * 
     135         * <p>The SAX parser will invoke this method only once, and it will 
     136         * be the last method invoked during the parse.  The parser shall 
     137         * not invoke this method until it has either abandoned parsing 
     138         * (because of an unrecoverable error) or reached the end of 
     139         * input.</p> 
     140         * 
     141         * @exception org.xml.sax.SAXException Any SAX exception, possibly 
     142         *            wrapping another exception. 
     143         * @see #startDocument 
     144         */ 
     145        public void endDocument() throws org.xml.sax.SAXException { 
     146        } 
     147 
     148        /** 
     149         * Report the end of DTD declarations. 
     150         * 
     151         * <p>This method is intended to report the end of the 
     152         * DOCTYPE declaration; if the document has no DOCTYPE declaration, 
     153         * this method will not be invoked.</p> 
     154         * 
     155         * @exception SAXException The application may raise an exception. 
     156         * @see #startDTD 
     157         */ 
     158        public void endDTD() throws org.xml.sax.SAXException { 
     159        } 
     160 
     161        /** 
     162         *  
     163         */ 
     164        public void endElement(String pNamespaceURI, String pLocalName, String pQName) throws SAXException { 
     165                try { 
     166 
     167                        if (fDepthTag == 0) { 
     168                                //On doit reourner au Sax Handler père. 
     169                                if (fParent != null) { 
     170                                        //On redonne la main au père 
     171                                        fXMLReader.setContentHandler(fParent); 
     172                                        try { 
     173                                                fXMLReader.setProperty("http://xml.org/sax/properties/lexical-handler", fLexParent); 
     174                                        } catch (Exception e) { 
     175                                        } 
     176                                        fParent.endElement(pNamespaceURI, pLocalName, pQName); 
    171177                                } 
    172178                        } else { 
    173                                 //Il y a eu un contenu au tag. 
    174                                 fStringBuffer.append("</"); 
    175                                 fStringBuffer.append(pQName); 
    176                                 fStringBuffer.append('>'); 
     179 
     180                                //On ajoute ce fin de tag dans le buffer 
     181                                if (fOffsetLastElementInDonnee == fStringBuilder.length()) { 
     182                                        if (fStringBuilder.length() > 0) { 
     183                                                //Pas de contenu au tag. 
     184                                                fStringBuilder.setCharAt(fStringBuilder.length() - 1, '/'); 
     185                                                fStringBuilder.append('>'); 
     186                                        } 
     187                                } else { 
     188                                        //Il y a eu un contenu au tag. 
     189                                        fStringBuilder.append("</"); 
     190                                        fStringBuilder.append(pQName); 
     191                                        fStringBuilder.append('>'); 
     192                                } 
     193 
     194                                //On décrémente la pile  
     195                                fDepthTag--; 
    177196                        } 
    178197 
    179                         //On décrémente la pile  
    180                         fDepthTag--; 
     198                } catch (Exception e) { 
     199                        throw (SAXException) HLogMgr.hAddMessage(new SAXException("Erreur au cours d'un parsing XML d'une fin d'élément " + pLocalName), HLogMgr.hGetMessage(e)); 
    181200                } 
    182  
    183         } catch (Exception e) { 
    184                 throw (SAXException) HLogMgr.hAddMessage(new SAXException("Erreur au cours d'un parsing XML d'une fin d'élément " + pLocalName), HLogMgr.hGetMessage(e)); 
    185         } 
    186 } 
    187  /** 
    188      * Report the end of an entity. 
    189      * 
    190      * @param name The name of the entity that is ending. 
    191      * @exception SAXException The application may raise an exception. 
    192      * @see #startEntity 
    193      */ 
    194 public void endEntity(java.lang.String name) throws org.xml.sax.SAXException {} 
     201        } 
     202 
     203        /** 
     204         * Report the end of an entity. 
     205         * 
     206         * @param name The name of the entity that is ending. 
     207         * @exception SAXException The application may raise an exception. 
     208         * @see #startEntity 
     209         */ 
     210        public void endEntity(java.lang.String name) throws org.xml.sax.SAXException { 
     211        } 
     212 
    195213        /** 
    196214         * End the scope of a prefix-URI mapping. 
     
    208226         * @see #endElement 
    209227         */ 
    210 public void endPrefixMapping(java.lang.String prefix) throws org.xml.sax.SAXException {} 
    211 /** 
    212  *  
    213  *  
    214  * @return java.lang.StringBuffer 
    215  */ 
    216 public final StringBuffer hGetStringBuffer() { 
    217         return fStringBuffer; 
    218 } 
    219 /** 
    220  *  
    221  */  
    222 public final XMLReader hGetXMLReader() { 
    223  
    224         return fXMLReader;       
    225          
    226 } 
    227 /** 
    228  *  
    229  *  
    230  * @param pBuffer java.lang.StringBuffer 
    231  */ 
    232 public void hSetStringBuffer(StringBuffer pBuffer) { 
    233         fStringBuffer = pBuffer;         
    234 } 
    235 /** 
    236  *  
    237  */   
    238 public final void hSetXmlReader(XMLReader pReader) {     
    239         fXMLReader = pReader; 
    240         fParent = pReader.getContentHandler(); 
    241         fXMLReader.setContentHandler(this); 
    242         try { 
    243                 fLexParent = (LexicalHandler)pReader.getProperty("http://xml.org/sax/properties/lexical-handler"); 
    244                 pReader.setProperty("http://xml.org/sax/properties/lexical-handler", this); 
    245         } catch(Exception e) { 
    246                 //HLogMgr.hPublishException(e); 
    247         } 
    248 } 
     228        public void endPrefixMapping(java.lang.String prefix) throws org.xml.sax.SAXException { 
     229        } 
     230 
     231        /** 
     232         *  
     233         *  
     234         * @return java.lang.StringBuilder 
     235         */ 
     236        public final StringBuilder hGetStringBuilder() { 
     237                return fStringBuilder; 
     238        } 
     239 
     240        /** 
     241         *  
     242         */ 
     243        public final XMLReader hGetXMLReader() { 
     244 
     245                return fXMLReader; 
     246 
     247        } 
     248 
     249        /** 
     250         *  
     251         *  
     252         * @param pBuffer java.lang.StringBuilder 
     253         */ 
     254        public void hSetStringBuilder(StringBuilder pBuffer) { 
     255                fStringBuilder = pBuffer; 
     256        } 
     257 
     258        /** 
     259         *  
     260         */ 
     261        public final void hSetXmlReader(XMLReader pReader) { 
     262                fXMLReader = pReader; 
     263                fParent = pReader.getContentHandler(); 
     264                fXMLReader.setContentHandler(this); 
     265                try { 
     266                        fLexParent = (LexicalHandler) pReader.getProperty("http://xml.org/sax/properties/lexical-handler"); 
     267                        pReader.setProperty("http://xml.org/sax/properties/lexical-handler", this); 
     268                } catch (Exception e) { 
     269                        //HLogMgr.hPublishException(e); 
     270                } 
     271        } 
     272 
    249273        /** 
    250274         * Receive notification of ignorable whitespace in element content. 
     
    271295         * @see #characters 
    272296         */ 
    273 public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXException { 
    274         HLogMgr.hPublishTrace("IgnoreWhiteSpace"+new String(ch, start, length));                 
    275 } 
     297        public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXException { 
     298                HLogMgr.hPublishTrace("IgnoreWhiteSpace" + new String(ch, start, length)); 
     299        } 
     300 
    276301        /** 
    277302         * Receive notification of a processing instruction. 
     
    292317         *            wrapping another exception. 
    293318         */ 
    294 public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXException {} 
     319        public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXException { 
     320        } 
     321 
    295322        /** 
    296323         * Receive an object for locating the origin of SAX document events. 
     
    318345         * @see org.xml.sax.Locator 
    319346         */ 
    320 public void setDocumentLocator(org.xml.sax.Locator locator) {} 
     347        public void setDocumentLocator(org.xml.sax.Locator locator) { 
     348        } 
     349 
    321350        /** 
    322351         * Receive notification of a skipped entity. 
     
    339368         *            wrapping another exception. 
    340369         */ 
    341 public void skippedEntity(java.lang.String name) throws org.xml.sax.SAXException {} 
    342 /** 
    343  * Report the start of a CDATA section. 
    344  * 
    345  * <p>The contents of the CDATA section will be reported through 
    346  * the regular {@link org.xml.sax.ContentHandler#characters 
    347  * characters} event; this event is intended only to report 
    348  * the boundary.</p> 
    349  * 
    350  * @exception SAXException The application may raise an exception. 
    351  * @see #endCDATA 
    352  */ 
    353 public void startCDATA() throws org.xml.sax.SAXException { 
    354         fStringBuffer.append("<![CDATA["); 
    355         fInCdata = true; 
    356 } 
    357 /** 
    358  *  
    359  */   
    360 public void startDocument() throws org.xml.sax.SAXException { 
    361 } 
    362  /** 
    363      * Report the start of DTD declarations, if any. 
    364      * 
    365      * <p>This method is intended to report the beginning of the 
    366      * DOCTYPE declaration; if the document has no DOCTYPE declaration, 
    367      * this method will not be invoked.</p> 
    368      * 
    369      * <p>All declarations reported through  
    370      * {@link org.xml.sax.DTDHandler DTDHandler} or 
    371      * {@link org.xml.sax.ext.DeclHandler DeclHandler} events must appear 
    372      * between the startDTD and {@link #endDTD endDTD} events. 
    373      * Declarations are assumed to belong to the internal DTD subset 
    374      * unless they appear between {@link #startEntity startEntity} 
    375      * and {@link #endEntity endEntity} events.  Comments and 
    376      * processing instructions from the DTD should also be reported 
    377      * between the startDTD and endDTD events, in their original  
    378      * order of (logical) occurrence; they are not required to 
    379      * appear in their correct locations relative to DTDHandler 
    380      * or DeclHandler events, however.</p> 
    381      * 
    382      * <p>Note that the start/endDTD events will appear within 
    383      * the start/endDocument events from ContentHandler and 
    384      * before the first  
    385      * {@link org.xml.sax.ContentHandler#startElement startElement} 
    386      * event.</p> 
    387      * 
    388      * @param name The document type name. 
    389      * @param publicId The declared public identifier for the 
    390      *        external DTD subset, or null if none was declared. 
    391      * @param systemId The declared system identifier for the 
    392      *        external DTD subset, or null if none was declared. 
    393      * @exception SAXException The application may raise an 
    394      *            exception. 
    395      * @see #endDTD 
    396      * @see #startEntity 
    397      */ 
    398 public void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException {} 
    399 /** 
    400  *  
    401  */ 
    402 public final void startElement(String pUri, String pLocalName, String pQName, Attributes pAttributes) throws SAXException { 
    403  
    404     try { 
    405  
    406             //On ajoute ce tag dans le buffer 
    407         fStringBuffer.append('<'); 
    408         fStringBuffer.append(pQName); 
    409  
    410         //Prefixes 
    411         if (fPrefixMappingList != null && fPrefixMappingList.size()>0) { 
    412                 String[] vPrefix = null; 
    413                         for (int i = 0; i < fPrefixMappingList.size(); i++) { 
    414                                 vPrefix = (String[])fPrefixMappingList.get(i); 
    415                 if(vPrefix[0].length()>0){ 
    416                     fStringBuffer.append(" xmlns:"); 
    417                     fStringBuffer.append(vPrefix[0]); 
    418                 } else { 
    419                     fStringBuffer.append(" xmlns"); 
    420                 } 
    421                                 fStringBuffer.append("=\""); 
    422                                 fStringBuffer.append(vPrefix[1]); 
    423                             fStringBuffer.append('\"'); 
     370        public void skippedEntity(java.lang.String name) throws org.xml.sax.SAXException { 
     371        } 
     372 
     373        /** 
     374         * Report the start of a CDATA section. 
     375         * 
     376         * <p>The contents of the CDATA section will be reported through 
     377         * the regular {@link org.xml.sax.ContentHandler#characters 
     378         * characters} event; this event is intended only to report 
     379         * the boundary.</p> 
     380         * 
     381         * @exception SAXException The application may raise an exception. 
     382         * @see #endCDATA 
     383         */ 
     384        public void startCDATA() throws org.xml.sax.SAXException { 
     385                fStringBuilder.append("<![CDATA["); 
     386                fInCdata = true; 
     387        } 
     388 
     389        /** 
     390         *  
     391         */ 
     392        public void startDocument() throws org.xml.sax.SAXException { 
     393        } 
     394 
     395        /** 
     396         * Report the start of DTD declarations, if any. 
     397         * 
     398         * <p>This method is intended to report the beginning of the 
     399         * DOCTYPE declaration; if the document has no DOCTYPE declaration, 
     400         * this method will not be invoked.</p> 
     401         * 
     402         * <p>All declarations reported through  
     403         * {@link org.xml.sax.DTDHandler DTDHandler} or 
     404         * {@link org.xml.sax.ext.DeclHandler DeclHandler} events must appear 
     405         * between the startDTD and {@link #endDTD endDTD} events. 
     406         * Declarations are assumed to belong to the internal DTD subset 
     407         * unless they appear between {@link #startEntity startEntity} 
     408         * and {@link #endEntity endEntity} events.  Comments and 
     409         * processing instructions from the DTD should also be reported 
     410         * between the startDTD and endDTD events, in their original  
     411         * order of (logical) occurrence; they are not required to 
     412         * appear in their correct locations relative to DTDHandler 
     413         * or DeclHandler events, however.</p> 
     414         * 
     415         * <p>Note that the start/endDTD events will appear within 
     416         * the start/endDocument events from ContentHandler and 
     417         * before the first  
     418         * {@link org.xml.sax.ContentHandler#startElement startElement} 
     419         * event.</p> 
     420         * 
     421         * @param name The document type name. 
     422         * @param publicId The declared public identifier for the 
     423         *        external DTD subset, or null if none was declared. 
     424         * @param systemId The declared system identifier for the 
     425         *        external DTD subset, or null if none was declared. 
     426         * @exception SAXException The application may raise an 
     427         *            exception. 
     428         * @see #endDTD 
     429         * @see #startEntity 
     430         */ 
     431        public void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException { 
     432        } 
     433 
     434        /** 
     435         *  
     436         */ 
     437        public final void startElement(String pUri, String pLocalName, String pQName, Attributes pAttributes) throws SAXException { 
     438 
     439                try { 
     440 
     441                        //On ajoute ce tag dans le buffer 
     442                        fStringBuilder.append('<'); 
     443                        fStringBuilder.append(pQName); 
     444 
     445                        //Prefixes 
     446                        if (fPrefixMappingList != null && fPrefixMappingList.size() > 0) { 
     447                                String[] vPrefix = null; 
     448                                for (int i = 0; i < fPrefixMappingList.size(); i++) { 
     449                                        vPrefix = (String[]) fPrefixMappingList.get(i); 
     450                                        if (vPrefix[0].length() > 0) { 
     451                                                fStringBuilder.append(" xmlns:"); 
     452                                                fStringBuilder.append(vPrefix[0]); 
     453                                        } else { 
     454                                                fStringBuilder.append(" xmlns"); 
     455                                        } 
     456                                        fStringBuilder.append("=\""); 
     457                                        fStringBuilder.append(vPrefix[1]); 
     458                                        fStringBuilder.append('\"'); 
     459                                } 
     460                                fPrefixMappingList.clear(); 
    424461                        } 
    425                         fPrefixMappingList.clear(); 
    426         } 
    427  
    428         //Attributs 
    429         for (int i = 0; i < pAttributes.getLength(); i++) { 
    430             fStringBuffer.append(' '); 
    431             fStringBuffer.append(pAttributes.getQName(i)); 
    432             fStringBuffer.append("=\""); 
    433             HEncodingXml.hWriteAttributValue(fStringBuffer, pAttributes.getValue(i)); 
    434             fStringBuffer.append('\"'); 
    435         } 
    436         fStringBuffer.append('>'); 
    437  
    438         fOffsetLastElementInDonnee = fStringBuffer.length(); 
    439          
    440         //On incrémente la pile. 
    441         fDepthTag++; 
    442  
    443     } catch (Exception e) { 
    444         throw (SAXException) HLogMgr.hAddMessage(new SAXException("Erreur au cours d'un parsing XML d'un élément " + pLocalName), HLogMgr.hGetMessage(e)); 
    445     } 
    446 } 
    447  /** 
    448      * Report the beginning of some internal and external XML entities. 
    449      * 
    450      * <p>The reporting of parameter entities (including 
    451      * the external DTD subset) is optional, and SAX2 drivers that 
    452      * support LexicalHandler may not support it; you can use the 
    453      * <code 
    454      * >http://xml.org/sax/features/lexical-handler/parameter-entities</code> 
    455      * feature to query or control the reporting of parameter entities.</p> 
    456      * 
    457      * <p>General entities are reported with their regular names, 
    458      * parameter entities have '%' prepended to their names, and  
    459      * the external DTD subset has the pseudo-entity name "[dtd]".</p> 
    460      * 
    461      * <p>When a SAX2 driver is providing these events, all other  
    462      * events must be properly nested within start/end entity  
    463      * events.  There is no additional requirement that events from  
    464      * {@link org.xml.sax.ext.DeclHandler DeclHandler} or 
    465      * {@link org.xml.sax.DTDHandler DTDHandler} be properly ordered.</p> 
    466      * 
    467      * <p>Note that skipped entities will be reported through the 
    468      * {@link org.xml.sax.ContentHandler#skippedEntity skippedEntity} 
    469      * event, which is part of the ContentHandler interface.</p> 
    470      * 
    471      * <p>Because of the streaming event model that SAX uses, some 
    472      * entity boundaries cannot be reported under any  
    473      * circumstances:</p> 
    474      * 
    475      * <ul> 
    476      * <li>general entities within attribute values</li> 
    477      * <li>parameter entities within declarations</li> 
    478      * </ul> 
    479      * 
    480      * <p>These will be silently expanded, with no indication of where 
    481      * the original entity boundaries were.</p> 
    482      * 
    483      * <p>Note also that the boundaries of character references (which 
    484      * are not really entities anyway) are not reported.</p> 
    485      * 
    486      * <p>All start/endEntity events must be properly nested. 
    487      * 
    488      * @param name The name of the entity.  If it is a parameter 
    489      *        entity, the name will begin with '%', and if it is the 
    490      *        external DTD subset, it will be "[dtd]". 
    491      * @exception SAXException The application may raise an exception. 
    492      * @see #endEntity 
    493      * @see org.xml.sax.ext.DeclHandler#internalEntityDecl 
    494      * @see org.xml.sax.ext.DeclHandler#externalEntityDecl  
    495      */ 
    496 public void startEntity(java.lang.String name) throws org.xml.sax.SAXException {} 
     462 
     463                        //Attributs 
     464                        for (int i = 0; i < pAttributes.getLength(); i++) { 
     465                                fStringBuilder.append(' '); 
     466                                fStringBuilder.append(pAttributes.getQName(i)); 
     467                                fStringBuilder.append("=\""); 
     468                                HEncodingXml.hWriteAttributValue(fStringBuilder, pAttributes.getValue(i)); 
     469                                fStringBuilder.append('\"'); 
     470                        } 
     471                        fStringBuilder.append('>'); 
     472 
     473                        fOffsetLastElementInDonnee = fStringBuilder.length(); 
     474 
     475                        //On incrémente la pile. 
     476                        fDepthTag++; 
     477 
     478                } catch (Exception e) { 
     479                        throw (SAXException) HLogMgr.hAddMessage(new SAXException("Erreur au cours d'un parsing XML d'un élément " + pLocalName), HLogMgr.hGetMessage(e)); 
     480                } 
     481        } 
     482 
     483        /** 
     484         * Report the beginning of some internal and external XML entities. 
     485         * 
     486         * <p>The reporting of parameter entities (including 
     487         * the external DTD subset) is optional, and SAX2 drivers that 
     488         * support LexicalHandler may not support it; you can use the 
     489         * <code 
     490         * >http://xml.org/sax/features/lexical-handler/parameter-entities</code> 
     491         * feature to query or control the reporting of parameter entities.</p> 
     492         * 
     493         * <p>General entities are reported with their regular names, 
     494         * parameter entities have '%' prepended to their names, and  
     495         * the external DTD subset has the pseudo-entity name "[dtd]".</p> 
     496         * 
     497         * <p>When a SAX2 driver is providing these events, all other  
     498         * events must be properly nested within start/end entity  
     499         * events.  There is no additional requirement that events from  
     500         * {@link org.xml.sax.ext.DeclHandler DeclHandler} or 
     501         * {@link org.xml.sax.DTDHandler DTDHandler} be properly ordered.</p> 
     502         * 
     503         * <p>Note that skipped entities will be reported through the 
     504         * {@link org.xml.sax.ContentHandler#skippedEntity skippedEntity} 
     505         * event, which is part of the ContentHandler interface.</p> 
     506         * 
     507         * <p>Because of the streaming event model that SAX uses, some 
     508         * entity boundaries cannot be reported under any  
     509         * circumstances:</p> 
     510         * 
     511         * <ul> 
     512         * <li>general entities within attribute values</li> 
     513         * <li>parameter entities within declarations</li> 
     514         * </ul> 
     515         * 
     516         * <p>These will be silently expanded, with no indication of where 
     517         * the original entity boundaries were.</p> 
     518         * 
     519         * <p>Note also that the boundaries of character references (which 
     520         * are not really entities anyway) are not reported.</p> 
     521         * 
     522         * <p>All start/endEntity events must be properly nested. 
     523         * 
     524         * @param name The name of the entity.  If it is a parameter 
     525         *        entity, the name will begin with '%', and if it is the 
     526         *        external DTD subset, it will be "[dtd]". 
     527         * @exception SAXException The application may raise an exception. 
     528         * @see #endEntity 
     529         * @see org.xml.sax.ext.DeclHandler#internalEntityDecl 
     530         * @see org.xml.sax.ext.DeclHandler#externalEntityDecl  
     531         */ 
     532        public void startEntity(java.lang.String name) throws org.xml.sax.SAXException { 
     533        } 
     534 
    497535        /** 
    498536         * Begin the scope of a prefix-URI Namespace mapping. 
     
    530568         * @see #startElement 
    531569         */ 
    532 public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXException { 
    533  
    534         if (fPrefixMappingList == null) { 
    535                 fPrefixMappingList = new ArrayList(); 
    536         } 
    537         fPrefixMappingList.add(new String[]{prefix,uri}); 
     570        public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXException { 
     571 
     572                if (fPrefixMappingList == null) { 
     573                        fPrefixMappingList = new ArrayList(); 
     574                } 
     575                fPrefixMappingList.add(new String[] { prefix, uri }); 
     576        } 
    538577} 
    539 } 
  • trunk/Jav_FW/com/scenari/s/fw/util/xml/HSaxHandlerToXml.java

    r1702 r10372  
    3939package com.scenari.s.fw.util.xml; 
    4040 
     41import java.io.IOException; 
    4142import java.util.ArrayList; 
    4243import java.util.List; 
     
    5152/** 
    5253 * Permet de reconstruire une chaine texte représentant le document XML en cours de parsing. 
    53  * Attention le reset du StringBuffer doit être assuré avant la transmission à ce SaxHandler. 
     54 * Attention le reset du StringBuilder doit être assuré avant la transmission à ce SaxHandler. 
    5455 * Cette implémentation ne nécessite pas de référence au XmlReader ni au contentHandler père mais 
    5556 * c'est à ce dernier de "reprendre la main". 
     
    5758public class HSaxHandlerToXml implements ContentHandler, LexicalHandler { 
    5859 
    59         /** StringBuffer à remplir. */ 
    60         protected StringBuffer fStringBuffer = null; 
     60        /** StringBuilder à remplir. */ 
     61        protected StringBuilder fStringBuilder = null; 
    6162 
    6263        /** CDATA en cours. */ 
     
    7980         *  
    8081         */ 
    81         public HSaxHandlerToXml(StringBuffer pBuffer) { 
    82                 fStringBuffer = pBuffer; 
     82        public HSaxHandlerToXml(StringBuilder pBuffer) { 
     83                fStringBuilder = pBuffer; 
    8384        } 
    8485         
     
    8889        public final void characters(char[] pChar, int pStart, int pLength) throws SAXException { 
    8990                if (fInCdata) { 
    90                         fStringBuffer.append(pChar, pStart, pLength); 
     91                        fStringBuilder.append(pChar, pStart, pLength); 
    9192                } else { 
    92                         HEncodingXml.hWriteTextValue(fStringBuffer, pChar, pStart, pLength); 
     93                        try { 
     94                                HEncodingXml.hWriteTextValue(fStringBuilder, pChar, pStart, pLength); 
     95                        }catch  (IOException e) { 
     96                                // 
     97                        } 
    9398                } 
    9499        } 
     
    104109         */ 
    105110        public void endCDATA() throws org.xml.sax.SAXException { 
    106                 fStringBuffer.append("]]>"); 
     111                fStringBuilder.append("]]>"); 
    107112                fInCdata = false; 
    108113        } 
     
    124129                try { 
    125130                        //On ajoute ce fin de tag dans le buffer 
    126                         if (fOffsetLastElementInDonnee == fStringBuffer.length()) { 
    127                                 if (fStringBuffer.length() > 0) { 
     131                        if (fOffsetLastElementInDonnee == fStringBuilder.length()) { 
     132                                if (fStringBuilder.length() > 0) { 
    128133                                        //Pas de contenu au tag. 
    129                                         fStringBuffer.setCharAt(fStringBuffer.length() - 1, '/'); 
    130                                         fStringBuffer.append('>'); 
     134                                        fStringBuilder.setCharAt(fStringBuilder.length() - 1, '/'); 
     135                                        fStringBuilder.append('>'); 
    131136                                } 
    132137                        } else { 
    133138                                //Il y a eu un contenu au tag. 
    134                                 fStringBuffer.append("</"); 
    135                                 fStringBuffer.append(pQName); 
    136                                 fStringBuffer.append('>'); 
     139                                fStringBuilder.append("</"); 
     140                                fStringBuilder.append(pQName); 
     141                                fStringBuilder.append('>'); 
    137142                        } 
    138143                } catch (Exception e) { 
     
    153158        /** 
    154159         *  
    155          * @return StringBuffer 
    156          */ 
    157         public final StringBuffer hGetStringBuffer() { 
    158                 return fStringBuffer; 
    159         } 
    160          
    161         /** 
    162          *  
    163          * @param pBuffer java.lang.StringBuffer 
    164          */ 
    165         public void hSetStringBuffer(StringBuffer pBuffer) { 
    166                 fStringBuffer = pBuffer; 
     160         * @return StringBuilder 
     161         */ 
     162        public final StringBuilder hGetStringBuilder() { 
     163                return fStringBuilder; 
     164        } 
     165         
     166        /** 
     167         *  
     168         * @param pBuffer java.lang.StringBuilder 
     169         */ 
     170        public void hSetStringBuilder(StringBuilder pBuffer) { 
     171                fStringBuilder = pBuffer; 
    167172        } 
    168173         
     
    193198         */ 
    194199        public void startCDATA() throws org.xml.sax.SAXException { 
    195                 fStringBuffer.append("<![CDATA["); 
     200                fStringBuilder.append("<![CDATA["); 
    196201                fInCdata = true; 
    197202        } 
     
    215220 
    216221                        //On ajoute ce tag dans le buffer 
    217                         fStringBuffer.append('<'); 
    218                         fStringBuffer.append(pQName); 
     222                        fStringBuilder.append('<'); 
     223                        fStringBuilder.append(pQName); 
    219224 
    220225                        //Prefixes 
     
    223228                                for (int i = 0; i < fPrefixMappingList.size(); i++) { 
    224229                                        vPrefix = (String[]) fPrefixMappingList.get(i); 
    225                                         fStringBuffer.append(" xmlns:"); 
    226                                         fStringBuffer.append(vPrefix[0]); 
    227                                         fStringBuffer.append("=\""); 
    228                                         fStringBuffer.append(vPrefix[1]); 
    229                                         fStringBuffer.append('\"'); 
     230                                        fStringBuilder.append(" xmlns:"); 
     231                                        fStringBuilder.append(vPrefix[0]); 
     232                                        fStringBuilder.append("=\""); 
     233                                        fStringBuilder.append(vPrefix[1]); 
     234                                        fStringBuilder.append('\"'); 
    230235                                } 
    231236                                fPrefixMappingList.clear(); 
     
    234239                        //Attributs 
    235240                        for (int i = 0; i < pAttributes.getLength(); i++) { 
    236                                 fStringBuffer.append(' '); 
    237                                 fStringBuffer.append(pAttributes.getQName(i)); 
    238                                 fStringBuffer.append("=\""); 
    239                                 HEncodingXml.hWriteAttributValue(fStringBuffer, pAttributes.getValue(i)); 
    240                                 fStringBuffer.append('\"'); 
    241                         } 
    242                         fStringBuffer.append('>'); 
    243  
    244                         fOffsetLastElementInDonnee = fStringBuffer.length(); 
     241                                fStringBuilder.append(' '); 
     242                                fStringBuilder.append(pAttributes.getQName(i)); 
     243                                fStringBuilder.append("=\""); 
     244                                HEncodingXml.hWriteAttributValue(fStringBuilder, pAttributes.getValue(i)); 
     245                                fStringBuilder.append('\"'); 
     246                        } 
     247                        fStringBuilder.append('>'); 
     248 
     249                        fOffsetLastElementInDonnee = fStringBuilder.length(); 
    245250 
    246251                } catch (Exception e) { 
  • trunk/Jav_FW/com/scenari/s/fw/util/xml/HXmlWriterSB.java

    r1702 r10372  
    4141 
    4242/** 
    43  * Sérialisation XML dans un StringBuffer. 
     43 * Sérialisation XML dans un StringBuilder. 
    4444 */ 
    4545public class HXmlWriterSB implements IHXmlWriter { 
    4646 
    47         StringBuffer fBuf = null; 
    48  
    49         /** 
    50          *  
    51          */ 
    52         public HXmlWriterSB(StringBuffer pBuf) { 
     47        Appendable fBuf = null; 
     48 
     49        /** 
     50         *  
     51         */ 
     52        public HXmlWriterSB(Appendable pBuf) { 
    5353                super(); 
    5454                fBuf = pBuf; 
  • trunk/Jav_FW/com/scenari/s/fw/utils/HCharSeqUtil.java

    r9796 r10372  
    8383                } 
    8484                if (i < vLen) { 
    85                         StringBuffer vBuf = new StringBuffer(pCharSeq.length()); 
     85                        StringBuilder vBuf = new StringBuilder(pCharSeq.length()); 
    8686                        for (int j = 0; j < i; j++) 
    8787                                vBuf.append(pCharSeq.charAt(j)); 
  • trunk/Jav_FW/com/scenari/s/fw/utils/HParamsQueryString.java

    r9772 r10372  
    6868            throw new IllegalArgumentException(); 
    6969        } 
    70         StringBuffer vBuf = new StringBuffer(); 
     70        StringBuilder vBuf = new StringBuilder(); 
    7171        String vKey; 
    7272        for (StringTokenizer vTok = new StringTokenizer(pParams, "&"); vTok.hasMoreTokens();) { 
     
    102102                Map vMap = new HashMap(); 
    103103                if (pParams == null) { throw new IllegalArgumentException(); } 
    104                 StringBuffer vBuf = new StringBuffer(); 
     104                StringBuilder vBuf = new StringBuilder(); 
    105105                String vKey; 
    106106                for (StringTokenizer vTok = new StringTokenizer(pParams, "&"); vTok.hasMoreTokens();) { 
     
    139139        public static final void hParseQueryStringAsList(String pParams, List pList) { 
    140140                if (pParams == null) throw new IllegalArgumentException(); 
    141                 StringBuffer vBuf = new StringBuffer(); 
     141                StringBuilder vBuf = new StringBuilder(); 
    142142                for (StringTokenizer vTok = new StringTokenizer(pParams, "&"); vTok.hasMoreTokens();) { 
    143143                        String vPair = vTok.nextToken(); 
     
    265265        public String toString() { 
    266266                if(fLastModCount != modCount) { 
    267                         StringBuffer vBuf = new StringBuffer(16*size()); 
     267                        StringBuilder vBuf = new StringBuilder(16*size()); 
    268268                        try { 
    269269                                for (int i = 0; i < this.size(); i=i+2) { 
     
    282282        } 
    283283         
    284         private static String parseName(String pName, StringBuffer pBuf) { 
     284        private static String parseName(String pName, StringBuilder pBuf) { 
    285285                pBuf.setLength(0); 
    286286                for (int i = 0; i < pName.length(); i++) { 
  • trunk/Jav_FW/com/scenari/s/fw/utils/HPoolBuffer.java

    r2873 r10372  
    6060    private ArrayList fBytes4096 = new ArrayList(); 
    6161 
    62     private ArrayList fStringBuffers = new ArrayList(); 
     62    private ArrayList fStringBuilders = new ArrayList(); 
    6363 
    6464    private ArrayList fStringWriters = new ArrayList(); 
     
    145145     *  
    146146     *  
    147      * @param pStringBuffer StringBuffer 
    148      */ 
    149     public final void hFreeStringBuffer(StringBuffer pStringBuffer) { 
    150         if (pStringBuffer == null) { 
     147     * @param pStringBuilder StringBuilder 
     148     */ 
     149    public final void hFreeStringBuilder(StringBuilder pStringBuilder) { 
     150        if (pStringBuilder == null) { 
    151151            return; 
    152152        } 
    153         pStringBuffer.setLength(0); 
    154         synchronized (fStringBuffers) { 
    155             fStringBuffers.add(pStringBuffer); 
     153        pStringBuilder.setLength(0); 
     154        synchronized (fStringBuilders) { 
     155            fStringBuilders.add(pStringBuilder); 
    156156        } 
    157157    } 
     
    276276 
    277277    /** 
    278      * Récupère un StringBuffer avec une capacité initiale de 4096 caracteres. 
    279      * ATTENTION : ne pas utiliser la méthode <code>vMonStringBuffer.toString()</code> sur le 
    280      * StringBuffer récupéré car le buffer de caracteres est alors perdu car utilisé par l'objet String  
    281      * résultant. Utiliser à la place la méthode <code>vMonStringBuffer.substring(0);</code>. 
    282      *  
    283      *  
    284      * @return StringBuffer 
    285      */ 
    286     public final StringBuffer hGetStringBuffer() { 
    287         StringBuffer vResult; 
    288         synchronized (fStringBuffers) { 
    289             if (fStringBuffers.size() > 0) { 
    290                 vResult = (StringBuffer) fStringBuffers.remove(fStringBuffers.size() - 1); 
     278     * Récupère un StringBuilder avec une capacité initiale de 4096 caracteres. 
     279     * ATTENTION : ne pas utiliser la méthode <code>vMonStringBuilder.toString()</code> sur le 
     280     * StringBuilder récupéré car le buffer de caracteres est alors perdu car utilisé par l'objet String  
     281     * résultant. Utiliser à la place la méthode <code>vMonStringBuilder.substring(0);</code>. 
     282     *  
     283     *  
     284     * @return StringBuilder 
     285     */ 
     286    public final StringBuilder hGetStringBuilder() { 
     287        StringBuilder vResult; 
     288        synchronized (fStringBuilders) { 
     289            if (fStringBuilders.size() > 0) { 
     290                vResult = (StringBuilder) fStringBuilders.remove(fStringBuilders.size() - 1); 
    291291                vResult.setLength(0); 
    292292            } else { 
    293                 vResult = new StringBuffer(4096); 
     293                vResult = new StringBuilder(4096); 
    294294            } 
    295295        } 
     
    304304     *  
    305305     *  
    306      * @return StringBuffer 
     306     * @return StringBuilder 
    307307     */ 
    308308    public final java.io.StringWriter hGetStringWriter() { 
  • trunk/Jav_FW/com/scenari/s/fw/utils/HUrl.java

    r9772 r10372  
    363363                boolean wroteUnencodedChar = false; 
    364364                int maxBytesPerChar = 10; // rather arbitrary limit, but safe for now 
    365                 StringBuffer out = new StringBuffer(s.length()); 
     365                StringBuilder out = new StringBuilder(s.length()); 
    366366                ByteArrayOutputStream buf = new ByteArrayOutputStream(maxBytesPerChar); 
    367367 
     
    502502                        } 
    503503                } 
    504                 StringBuffer vBuf = new StringBuffer(pOffsetEnd - pOffset); 
     504                StringBuilder vBuf = new StringBuilder(pOffsetEnd - pOffset); 
    505505                for (int i = pOffset; i < pOffsetEnd;) { 
    506506                        char vChar = pUri.charAt(i); 
  • trunk/Jav_FW/com/scenari/s/fw/utils/stream/HBufferStreamChar.java

    r9541 r10372  
    321321         */ 
    322322        public String toString() { 
    323                 StringBuffer vBuf = new StringBuffer(hGetLenght()); 
     323                StringBuilder vBuf = new StringBuilder(hGetLenght()); 
    324324                for (int i = 0; i < fCountBuf; i++) { 
    325325                        vBuf.append(fBuf[i], 0, sLengthBuf); 
  • trunk/Jav_FW/com/scenari/s/fw/utils/stream/HStream.java

    r1839 r10372  
    6868                String vResult; 
    6969 
    70                 StringBuffer vBuf = HPoolBuffer.get().hGetStringBuffer(); 
     70                StringBuilder vBuf = HPoolBuffer.get().hGetStringBuilder(); 
    7171                char[] vChars = HPoolBuffer.get().hGetChars4096(); 
    7272 
     
    8383                        pReader.close(); 
    8484                        HPoolBuffer.get().hFreeChars(vChars); 
    85                         HPoolBuffer.get().hFreeStringBuffer(vBuf); 
     85                        HPoolBuffer.get().hFreeStringBuilder(vBuf); 
    8686 
    8787                } 
     
    101101                String vResult; 
    102102 
    103                 StringBuffer vBuf = new StringBuffer(pNbChars); 
     103                StringBuilder vBuf = new StringBuilder(pNbChars); 
    104104                char[] vChars = HPoolBuffer.get().hGetChars4096(); 
    105105 
  • trunk/Jav_GE/com/scenari/m/ge/agent/HADialogExport.java

    r8541 r10372  
    198198     * Ecrit le script correspondant à l'entrée dans ce dialogue. 
    199199     */ 
    200     public final void hWriteScriptEntree(StringBuffer pBuf) throws Exception { 
     200    public final void hWriteScriptEntree(StringBuilder pBuf) throws Exception { 
    201201        wWriteScriptEntree(pBuf); 
    202202    } 
     
    205205     * Ecrit le script correspondant à la sortie de ce dialogue. 
    206206     */ 
    207     public final void hWriteScriptSortie(StringBuffer pBuf, IHDialog pDialogSuivant) throws Exception { 
     207    public final void hWriteScriptSortie(StringBuilder pBuf, IHDialog pDialogSuivant) throws Exception { 
    208208        wWriteScriptSortie(pBuf, pDialogSuivant); 
    209209    } 
     
    299299     * Ecrit le script correspondant à l'entrée dans ce dialogue avec le code action 'GetNext'. 
    300300     */ 
    301     protected void wScriptGetNext(StringBuffer pBuf) throws Exception { 
     301    protected void wScriptGetNext(StringBuilder pBuf) throws Exception { 
    302302 
    303303        IComputedData vActif = fAgent.hGetComposant().hGetActif().compute(this, fAgent, null, false); 
     
    315315            //Attribut Actif de niveau interactif. 
    316316            //Cas de l'agent actif 
    317             StringBuffer vBufTrue = new StringBuffer(64); 
     317            StringBuilder vBufTrue = new StringBuilder(64); 
    318318            IWADialogExport vNewDialog = (IWADialogExport) fAgent.hNewDialog(this); 
    319319            vNewDialog.hWriteScriptEntree(vBufTrue); 
    320             StringBuffer vBufFalse = new StringBuffer(64); 
     320            StringBuilder vBufFalse = new StringBuilder(64); 
    321321            //Cas de l'agent inactif 
    322322            wScriptGoToNext(vBufFalse); 
     
    330330     * Ecrit le script correspondant à l'entrée dans ce dialogue avec le code action 'GetPrec'. 
    331331     */ 
    332     protected void wScriptGetPrec(StringBuffer pBuf) throws Exception { 
     332    protected void wScriptGetPrec(StringBuilder pBuf) throws Exception { 
    333333 
    334334        IComputedData vActif = fAgent.hGetComposant().hGetActif().compute(this, fAgent, null, false); 
     
    346346            //Attribut Actif de niveau interactif. 
    347347            //Cas de l'agent actif 
    348             StringBuffer vBufTrue = new StringBuffer(64); 
     348            StringBuilder vBufTrue = new StringBuilder(64); 
    349349            IWADialogExport vNewDialog = (IWADialogExport) fAgent.hNewDialog(this); 
    350350            vNewDialog.hWriteScriptEntree(vBufTrue); 
    351             StringBuffer vBufFalse = new StringBuffer(64); 
     351            StringBuilder vBufFalse = new StringBuilder(64); 
    352352            //Cas de l'agent inactif 
    353353            wScriptGoToPrec(vBufFalse); 
     
    360360     * Ecrit le script correspondant à l'entrée dans ce dialogue avec le code action 'GoTo'. 
    361361     */ 
    362     protected void wScriptGoTo(StringBuffer pBuf) throws Exception { 
     362    protected void wScriptGoTo(StringBuilder pBuf) throws Exception { 
    363363 
    364364        IHDialog vDialog = hGoTo(fParam1); 
     
    377377     * Ecrit le script correspondant à l'entrée dans ce dialogue avec le code action 'GoToNext'. 
    378378     */ 
    379     protected void wScriptGoToNext(StringBuffer pBuf) throws Exception { 
     379    protected void wScriptGoToNext(StringBuilder pBuf) throws Exception { 
    380380 
    381381        //if (fAgent.hIsAgentPrinc()) { 
     
    404404     * Ecrit le script correspondant à l'entrée dans ce dialogue avec le code action 'GoToPrec'. 
    405405     */ 
    406     protected void wScriptGoToPrec(StringBuffer pBuf) throws Exception { 
     406    protected void wScriptGoToPrec(StringBuilder pBuf) throws Exception { 
    407407 
    408408        //if (fAgent.hIsAgentPrinc()) { 
     
    432432     * Ecrit le script correspondant à l'entrée dans ce dialogue avec le code action 'Quit'. 
    433433     */ 
    434     protected void wScriptQuit(StringBuffer pBuf) throws Exception { 
     434    protected void wScriptQuit(StringBuilder pBuf) throws Exception { 
    435435        if (SCRIPT_MODE_EXE.equals(fScriptMode)) { 
    436436            hGetGenerateur().wGetScripter().quit(pBuf); 
     
    446446     *  
    447447     */ 
    448     protected void wScriptRetourAccueil(StringBuffer pBuf) throws Exception { 
     448    protected void wScriptRetourAccueil(StringBuilder pBuf) throws Exception { 
    449449        if (SCRIPT_MODE_EXE.equals(fScriptMode)) { 
    450450            hGetGenerateur().wGetScripter().goHome(pBuf); 
     
    483483     *  
    484484     */ 
    485     protected void wWriteScriptEntree(StringBuffer pBuf) throws Exception { 
     485    protected void wWriteScriptEntree(StringBuilder pBuf) throws Exception { 
    486486 
    487487        String vCdAction = hGetCdAction(); 
     
    509509     *  
    510510     */ 
    511     protected void wWriteScriptSortie(StringBuffer pBuf, IHDialog pDialogSuivant) throws Exception { 
     511    protected void wWriteScriptSortie(StringBuilder pBuf, IHDialog pDialogSuivant) throws Exception { 
    512512    } 
    513513 
  • trunk/Jav_GE/com/scenari/m/ge/agent/HAgentExport.java

    r9965 r10372  
    280280 
    281281                        // Ecriture du script 
    282                         StringBuffer vBuf = HPoolBuffer.get().hGetStringBuffer(); 
     282                        StringBuilder vBuf = HPoolBuffer.get().hGetStringBuilder(); 
    283283                        // Calcul du script de sortie sur le dialogue précédent 
    284284                        if (pDialog instanceof IWADialogExport) { 
     
    288288                        vNewDialog.hWriteScriptEntree(vBuf); 
    289289                        String vResult = vBuf.substring(0); 
    290                         HPoolBuffer.get().hFreeStringBuffer(vBuf); 
     290                        HPoolBuffer.get().hFreeStringBuilder(vBuf); 
    291291 
    292292                        return new DataVolatileString(vResult); 
     
    387387                        IWADialog vCurrentDialog = pDialog; 
    388388                        if (vFrom != null && vFrom.length() > 0) vCurrentDialog = (IWADialog) vCurrentDialog.hGoTo(vFrom); 
    389                         StringBuffer vDialogPath = new StringBuffer(); 
     389                        StringBuilder vDialogPath = new StringBuilder(); 
    390390                        for (int i = 0; i < vDirs.length; i++) { 
    391391                                vDialogPath.setLength(0); 
     
    446446         *  
    447447         */ 
    448         protected String xLookForChildren(IWAgent pAgent, IWADialog pDialog, StringBuffer pDialogPath, HParamsQueryString pParams, boolean pBackward) throws Exception { 
     448        protected String xLookForChildren(IWAgent pAgent, IWADialog pDialog, StringBuilder pDialogPath, HParamsQueryString pParams, boolean pBackward) throws Exception { 
    449449                if (pAgent != null && (pAgent instanceof IWAgentLinker)) { 
    450450                        IWAgent[] vChildren = ((IWAgentLinker) pAgent).hGetAgentsLies(pDialog, null); 
     
    533533 
    534534                // Serializer 
    535                 StringBuffer vBuf = HPoolBuffer.get().hGetStringBuffer(); 
     535                StringBuilder vBuf = HPoolBuffer.get().hGetStringBuilder(); 
    536536                IHXmlWriter vWriter = new HXmlWriterSB(vBuf); 
    537537                vWriter.hWriteOpenTag("outline"); 
     
    547547                vWriter.hWriteCloseTag("outline"); 
    548548                String vResult = vBuf.substring(0); 
    549                 HPoolBuffer.get().hFreeStringBuffer(vBuf); 
     549                HPoolBuffer.get().hFreeStringBuilder(vBuf); 
    550550                return new DataVolatileString(vResult); 
    551551        } 
  • trunk/Jav_GE/com/scenari/m/ge/agent/IWADialogExport.java

    r8541 r10372  
    105105         *  
    106106         */ 
    107         public void hWriteScriptEntree(StringBuffer pBuf) throws Exception; 
     107        public void hWriteScriptEntree(StringBuilder pBuf) throws Exception; 
    108108 
    109109        /** 
     
    111111         *  
    112112         */ 
    113         public void hWriteScriptSortie(StringBuffer pBuf, IHDialog pDialogSuivant) throws Exception; 
     113        public void hWriteScriptSortie(StringBuilder pBuf, IHDialog pDialogSuivant) throws Exception; 
    114114         
    115115 
  • trunk/Jav_GE/com/scenari/m/ge/agent/OutlineWalker.java

    r9420 r10372  
    150150 
    151151        /** Cursor : noeud de l'outline pointé par le walker */ 
    152         protected StringBuffer fXCursorUrl = new StringBuffer(128); 
     152        protected StringBuilder fXCursorUrl = new StringBuilder(128); 
    153153 
    154154        protected int fXCursorIdx = -1; 
  • trunk/Jav_GE/com/scenari/m/ge/agent/callgen/HDialogCallGen.java

    r10138 r10372  
    102102                                        fCurrentValue = new String(pChars, pStart, pLen); 
    103103                                } else { 
    104                                         fCurrentValue = new StringBuffer(fCurrentValue.length() + pLen).append(fCurrentValue).append(pChars, pStart, pLen).toString(); 
     104                                        fCurrentValue = new StringBuilder(fCurrentValue.length() + pLen).append(fCurrentValue).append(pChars, pStart, pLen).toString(); 
    105105                                } 
    106106                        } 
     
    159159         * Ecrit le script correspondant à l'entrée dans ce dialogue. 
    160160         */ 
    161         protected void wWriteScriptEntree(StringBuffer pBuf) throws Exception { 
     161        protected void wWriteScriptEntree(StringBuilder pBuf) throws Exception { 
    162162                if (CDACTION_GENERATE.equals(hGetCdAction())) { 
    163163                        ((HAgentCallGen) fAgent).setPageResOnDialog(this); 
     
    209209                if (hGetCdAction().equals(CDACTION_GENERATE)) { 
    210210                        // Cette page est directement appelée 
    211                         this.hWriteScriptEntree(new StringBuffer()); 
     211                        this.hWriteScriptEntree(new StringBuilder()); 
    212212                } else { 
    213213                        return super.xExecute(); 
  • trunk/Jav_GE/com/scenari/m/ge/agent/grouppages/HDialogGroupPages.java

    r7460 r10372  
    9595     * Ecrit le script correspondant à l'entrée dans ce dialogue. 
    9696     */ 
    97     protected void wWriteScriptEntree(StringBuffer pBuf) throws Exception { 
     97    protected void wWriteScriptEntree(StringBuilder pBuf) throws Exception { 
    9898        //On parcours tous les agents affichages fils 
    9999        Element vParent = hGetAgent().hGetElementRoot(); 
     
    146146        if (hGetCdAction().equals(CDACTION_AFFICHER)) { 
    147147            //Cette page est directement appelée 
    148             this.hWriteScriptEntree(new StringBuffer()); 
     148            this.hWriteScriptEntree(new StringBuilder()); 
    149149        } else { 
    150150            return super.xExecute(); 
  • trunk/Jav_GE/com/scenari/m/ge/agent/pages/HDialogPages.java

    r10215 r10372  
    259259         * Ecrit le script correspondant à l'entrée dans ce dialogue. 
    260260         */ 
    261         protected void wWriteScriptEntree(StringBuffer pBuf) throws Exception { 
     261        protected void wWriteScriptEntree(StringBuilder pBuf) throws Exception { 
    262262 
    263263                WComposantPages vComp = (WComposantPages) fAgent.hGetComposant(); 
     
    326326         * Ecrit le script correspondant à la sortie de ce dialogue. 
    327327         */ 
    328         protected void wWriteScriptSortie(StringBuffer pBuf, IHDialog pDialogSuivant) throws Exception { 
     328        protected void wWriteScriptSortie(StringBuilder pBuf, IHDialog pDialogSuivant) throws Exception { 
    329329                if (fPageCourante != null) { 
    330330                        pBuf.append(fPageCourante.hGetScriptAvantSortie().getString(this, fAgent, fParam1)); 
     
    335335         *  
    336336         */ 
    337         public void xScriptGoToFirstActivePage(StringBuffer pBuf, int pOffset) throws java.lang.Exception { 
     337        public void xScriptGoToFirstActivePage(StringBuilder pBuf, int pOffset) throws java.lang.Exception { 
    338338                XPage[] vPages = ((WComposantPages) fAgent.hGetComposant()).hGetPages(); 
    339339                if (vPages.length == 0) { 
     
    376376                } else if (hGetCdAction().equals(CDACTION_AFFICHER)) { 
    377377                        // Cette page est directement appelée 
    378                         this.hWriteScriptEntree(new StringBuffer()); 
     378                        this.hWriteScriptEntree(new StringBuilder()); 
    379379                } else { 
    380380                        return super.xExecute(); 
  • trunk/Jav_GE/com/scenari/m/ge/agent/scenario/HDialogScenario.java

    r3325 r10372  
    104104         *  
    105105         */ 
    106         protected void wScriptGetNext(StringBuffer pBuf) throws Exception { 
     106        protected void wScriptGetNext(StringBuilder pBuf) throws Exception { 
    107107 
    108108                wScriptGoToNext(pBuf); 
     
    114114         *  
    115115         */ 
    116         protected void wScriptGetPrec(StringBuffer pBuf) throws Exception { 
     116        protected void wScriptGetPrec(StringBuilder pBuf) throws Exception { 
    117117 
    118118                wScriptGoToPrec(pBuf); 
     
    126126         *  
    127127         */ 
    128         public void wScriptGoToFin(StringBuffer pBuf, boolean pForward) throws Exception { 
     128        public void wScriptGoToFin(StringBuilder pBuf, boolean pForward) throws Exception { 
    129129 
    130130                if (pForward) { 
     
    140140         *  
    141141         */ 
    142         protected void wScriptGoToNext(StringBuffer pBuf) throws Exception { 
     142        protected void wScriptGoToNext(StringBuilder pBuf) throws Exception { 
    143143 
    144144                WComposantScenario vComp = (WComposantScenario) hGetAgent().hGetComposant(); 
     
    181181         *  
    182182         */ 
    183         protected void wScriptGoToPrec(StringBuffer pBuf) throws Exception { 
     183        protected void wScriptGoToPrec(StringBuilder pBuf) throws Exception { 
    184184 
    185185                WComposantScenario vComp = (WComposantScenario) hGetAgent().hGetComposant(); 
     
    222222         *  
    223223         */ 
    224         protected void wWriteScriptEntree(StringBuffer pBuf) throws Exception { 
     224        protected void wWriteScriptEntree(StringBuilder pBuf) throws Exception { 
    225225 
    226226                String vCdAction = hGetCdAction(); 
  • trunk/Jav_GE/com/scenari/m/ge/composant/scenario/WComposantScenario.java

    r7364 r10372  
    8989 
    9090                if (sTrace.hIsActive()) { 
    91                         StringBuffer vBuf = new StringBuffer(); 
     91                        StringBuilder vBuf = new StringBuilder(); 
    9292                        vBuf.append("Agents liés de " + pDialog.hGetAgent() + " :\n"); 
    9393                        for (int i = 0; i < vArray.length; i++) { 
  • trunk/Jav_GE/com/scenari/m/ge/composant/scenario/XNoeud.java

    r7460 r10372  
    208208         *  
    209209         */ 
    210         public void wScriptGetNext(StringBuffer pBuf, HDialogScenario pDialog) throws java.lang.Exception { 
     210        public void wScriptGetNext(StringBuilder pBuf, HDialogScenario pDialog) throws java.lang.Exception { 
    211211 
    212212                WComposantScenario vComp = (WComposantScenario) pDialog.hGetAgent().hGetComposant(); 
     
    240240         *  
    241241         */ 
    242         public void wScriptGetPrec(StringBuffer pBuf, HDialogScenario pDialog) throws java.lang.Exception { 
     242        public void wScriptGetPrec(StringBuilder pBuf, HDialogScenario pDialog) throws java.lang.Exception { 
    243243 
    244244                WComposantScenario vComp = (WComposantScenario) pDialog.hGetAgent().hGetComposant(); 
     
    274274         *  
    275275         */ 
    276         public abstract boolean wScriptGoToNext(StringBuffer pBuf, HDialogScenario pDialog) throws Exception; 
     276        public abstract boolean wScriptGoToNext(StringBuilder pBuf, HDialogScenario pDialog) throws Exception; 
    277277 
    278278        /** 
     
    284284         *  
    285285         */ 
    286         public abstract boolean wScriptGoToNoeud(StringBuffer pBuf, HDialogScenario pDialog, boolean pForward) throws Exception; 
     286        public abstract boolean wScriptGoToNoeud(StringBuilder pBuf, HDialogScenario pDialog, boolean pForward) throws Exception; 
    287287 
    288288        /** 
     
    293293         *  
    294294         */ 
    295         public abstract boolean wScriptGoToPrec(StringBuffer pBuf, HDialogScenario pDialog) throws Exception; 
     295        public abstract boolean wScriptGoToPrec(StringBuilder pBuf, HDialogScenario pDialog) throws Exception; 
    296296 
    297297        /** 
  • trunk/Jav_GE/com/scenari/m/ge/composant/scenario/XNoeudFinal.java

    r7460 r10372  
    8080         * constituer un noeud de départ. 
    8181         */ 
    82         public boolean wScriptGoToNext(StringBuffer pBuf, HDialogScenario pDialog) throws Exception { 
     82        public boolean wScriptGoToNext(StringBuilder pBuf, HDialogScenario pDialog) throws Exception { 
    8383                return false; 
    8484        } 
     
    9292         *  
    9393         */ 
    94         public boolean wScriptGoToNoeud(StringBuffer pBuf, HDialogScenario pDialog, boolean pForward) throws java.lang.Exception { 
     94        public boolean wScriptGoToNoeud(StringBuilder pBuf, HDialogScenario pDialog, boolean pForward) throws java.lang.Exception { 
    9595 
    9696                boolean vResult = true; 
     
    139139         * constituer un noeud de départ. 
    140140         */ 
    141         public boolean wScriptGoToPrec(StringBuffer pBuf, HDialogScenario pDialog) throws Exception { 
     141        public boolean wScriptGoToPrec(StringBuilder pBuf, HDialogScenario pDialog) throws Exception { 
    142142                return false; 
    143143        } 
  • trunk/Jav_GE/com/scenari/m/ge/composant/scenario/XNoeudInit.java

    r7460 r10372  
    7878         * contrainte n'est définie sur les noeuds initiaux. 
    7979         */ 
    80         public boolean wScriptGoToNext(StringBuffer pBuf, HDialogScenario pDialog) throws Exception { 
     80        public boolean wScriptGoToNext(StringBuilder pBuf, HDialogScenario pDialog) throws Exception { 
    8181 
    8282                // On sort de ce noeud, on écrit le script de sortie. 
     
    9999         *  
    100100         */ 
    101         public boolean wScriptGoToNoeud(StringBuffer pBuf, HDialogScenario pDialog, boolean pForward) throws java.lang.Exception { 
     101        public boolean wScriptGoToNoeud(StringBuilder pBuf, HDialogScenario pDialog, boolean pForward) throws java.lang.Exception { 
    102102                return false; 
    103103        } 
     
    113113         * contrainte n'est définie sur les noeuds initiaux. 
    114114         */ 
    115         public boolean wScriptGoToPrec(StringBuffer pBuf, HDialogScenario pDialog) throws Exception { 
     115        public boolean wScriptGoToPrec(StringBuilder pBuf, HDialogScenario pDialog) throws Exception { 
    116116 
    117117                // On sort de ce noeud, on écrit le script de sortie. 
  • trunk/Jav_GE/com/scenari/m/ge/composant/scenario/XNoeudInteractif.java

    r7460 r10372  
    145145         * 
    146146         */ 
    147         public boolean wScriptGoToNext(StringBuffer pBuf, HDialogScenario pDialog) throws java.lang.Exception { 
     147        public boolean wScriptGoToNext(StringBuilder pBuf, HDialogScenario pDialog) throws java.lang.Exception { 
    148148 
    149149                boolean vResult = false; 
     
    202202         * 
    203203         */ 
    204         public boolean wScriptGoToNoeud(StringBuffer pBuf, HDialogScenario pDialog, boolean pForward) throws Exception { 
     204        public boolean wScriptGoToNoeud(StringBuilder pBuf, HDialogScenario pDialog, boolean pForward) throws Exception { 
    205205 
    206206                //On cherche ce noeud 
     
    320320         * 
    321321         */ 
    322         public boolean wScriptGoToPrec(StringBuffer pBuf, HDialogScenario pDialog) throws java.lang.Exception { 
     322        public boolean wScriptGoToPrec(StringBuilder pBuf, HDialogScenario pDialog) throws java.lang.Exception { 
    323323 
    324324                boolean vResult = false; 
  • trunk/Jav_GE/com/scenari/m/ge/composant/scenario/XNoeudListe.java

    r7460 r10372  
    8888     * 
    8989     */ 
    90     public boolean wScriptGoToNext(StringBuffer pBuf, HDialogScenario pDialog) throws java.lang.Exception { 
     90    public boolean wScriptGoToNext(StringBuilder pBuf, HDialogScenario pDialog) throws java.lang.Exception { 
    9191 
    9292        boolean vResult = false; 
     
    158158     * 
    159159     */ 
    160     public boolean wScriptGoToNoeud(StringBuffer pBuf, HDialogScenario pDialog, boolean pForward) throws Exception { 
     160    public boolean wScriptGoToNoeud(StringBuilder pBuf, HDialogScenario pDialog, boolean pForward) throws Exception { 
    161161 
    162162        //On cherche ce noeud 
     
    212212     * 
    213213     */ 
    214     public boolean wScriptGoToPrec(StringBuffer pBuf, HDialogScenario pDialog) throws java.lang.Exception { 
     214    public boolean wScriptGoToPrec(StringBuilder pBuf, HDialogScenario pDialog) throws java.lang.Exception { 
    215215 
    216216        boolean vResult = false; 
  • trunk/Jav_GE/com/scenari/m/ge/composant/scenario/XNoeudSingleton.java

    r7460 r10372  
    8888         *  
    8989         */ 
    90         public boolean wScriptGoToNext(StringBuffer pBuf, HDialogScenario pDialog) throws java.lang.Exception { 
     90        public boolean wScriptGoToNext(StringBuilder pBuf, HDialogScenario pDialog) throws java.lang.Exception { 
    9191 
    9292                boolean vResult = false; 
     
    128128         *  
    129129         */ 
    130         public boolean wScriptGoToNoeud(StringBuffer pBuf, HDialogScenario pDialog, boolean pForward) throws Exception { 
     130        public boolean wScriptGoToNoeud(StringBuilder pBuf, HDialogScenario pDialog, boolean pForward) throws Exception { 
    131131 
    132132                // On chercher ce noeud 
     
    164164         *  
    165165         */ 
    166         public boolean wScriptGoToPrec(StringBuffer pBuf, HDialogScenario pDialog) throws java.lang.Exception { 
     166        public boolean wScriptGoToPrec(StringBuilder pBuf, HDialogScenario pDialog) throws java.lang.Exception { 
    167167 
    168168                boolean vResult = false; 
  • trunk/Jav_GE/com/scenari/m/ge/composant/scenario/XTransition.java

    r7460 r10372  
    119119         *  
    120120         */ 
    121         public boolean wScript(StringBuffer pBuf, XNoeud pNoeudFrom, HDialogScenario pDialog, boolean pForward) throws Exception { 
     121        public boolean wScript(StringBuilder pBuf, XNoeud pNoeudFrom, HDialogScenario pDialog, boolean pForward) throws Exception { 
    122122 
    123123                boolean vResult = false; 
     
    137137                        if (HDonneeUtils.hIsLevelInteractif(vCondition.getMime())) { // Niveau 
    138138                                                                                                                                                        // interactif 
    139                                 StringBuffer vBufTrue = new StringBuffer(); 
     139                                StringBuilder vBufTrue = new StringBuilder(); 
    140140                                // On écrit le script de passage dans cette condition 
    141141                                vBufTrue.append(fScriptPassage.getString(pDialog, pDialog.hGetAgent(), null)); 
  • trunk/Jav_GE/com/scenari/m/ge/context/HContextGenerator.java

    r4832 r10372  
    201201        } else if (pBuffer instanceof Map) { 
    202202            ((Map) pBuffer).clear(); 
    203         } else if (pBuffer instanceof StringBuffer) { 
    204             ((StringBuffer) pBuffer).setLength(0); 
     203        } else if (pBuffer instanceof StringBuilder) { 
     204            ((StringBuilder) pBuffer).setLength(0); 
    205205        } 
    206206    } 
  • trunk/Jav_GE/com/scenari/m/ge/generateur/GeneratorBase.java

    r10215 r10372  
    265265 
    266266        /** Buffer temporaire des traces avant l'init de la destination. */ 
    267         protected StringBuffer fTraceTemp = null; 
     267        protected StringBuilder fTraceTemp = null; 
    268268 
    269269        /** Writer xml pour les traces. */ 
     
    677677                 */ 
    678678                public String getIdAgentHier() throws Exception { 
    679                         StringBuffer vBuf = new StringBuffer(); 
     679                        StringBuilder vBuf = new StringBuilder(); 
    680680                        IWAgent vAgent = null; 
    681681                        Iterator vHierIt = ((IWADialog) fCurrentDialog).hGetHier().iterator(); 
     
    758758                        int vEnd = pCdAgent.indexOf(ZXPathSwitchAxis.PREFIX); 
    759759                        if (pAxis != null && pAxis.length() > 0) { 
    760                                 StringBuffer vBuf = new StringBuffer(pCdAgent.length() + pAxis.length() + ZXPathSwitchAxis.PREFIX.length()); 
     760                                StringBuilder vBuf = new StringBuilder(pCdAgent.length() + pAxis.length() + ZXPathSwitchAxis.PREFIX.length()); 
    761761                                vBuf.append((vEnd < 0) ? pCdAgent : pCdAgent.substring(0, vEnd)); 
    762762                                vBuf.append(ZXPathSwitchAxis.PREFIX); 
     
    969969                                } 
    970970                        } else { 
    971                                 fTraceWriter = new HXmlWriterSB(new StringBuffer()); 
     971                                fTraceWriter = new HXmlWriterSB(new StringBuilder()); 
    972972                        } 
    973973 
     
    13361336                fDialogStack.addLast(pDialog); 
    13371337                if (sTraceLink.hIsActive()) { 
    1338                         StringBuffer vBuf = new StringBuffer(500); 
     1338                        StringBuilder vBuf = new StringBuilder(500); 
    13391339                        vBuf.append("<lienpage>"); 
    13401340                        vBuf.append("<dest>"); 
     
    14591459                        } 
    14601460                        if (fTraceWriter == null) { 
    1461                                 fTraceTemp = new StringBuffer(256); 
     1461                                fTraceTemp = new StringBuilder(256); 
    14621462                                fTraceWriter = new HXmlWriterSB(fTraceTemp); 
    14631463                                fTraceWriter.hWriteHeaderXml("UTF-8"); 
     
    14891489                        } 
    14901490                        if (fTraceWriter == null) { 
    1491                                 fTraceTemp = new StringBuffer(256); 
     1491                                fTraceTemp = new StringBuilder(256); 
    14921492                                fTraceWriter = new HXmlWriterSB(fTraceTemp); 
    14931493                                fTraceWriter.hWriteHeaderXml("UTF-8"); 
     
    15181518                        } 
    15191519                        if (fTraceWriter == null) { 
    1520                                 fTraceTemp = new StringBuffer(256); 
     1520                                fTraceTemp = new StringBuilder(256); 
    15211521                                fTraceWriter = new HXmlWriterSB(fTraceTemp); 
    15221522                                fTraceWriter.hWriteHeaderXml("UTF-8"); 
     
    17101710                int vVal = pId; 
    17111711 
    1712                 StringBuffer vBuf = new StringBuffer(5); 
     1712                StringBuilder vBuf = new StringBuilder(5); 
    17131713                do { 
    17141714                        vBuf.append(ID_ENCODER[vVal % 26]); 
     
    20512051                } 
    20522052 
    2053                 StringBuffer vBuf = new StringBuffer(vUrlDst.length()); 
     2053                StringBuilder vBuf = new StringBuilder(vUrlDst.length()); 
    20542054                int vIdx = vSlashSrc; 
    20552055                while (vIdx > 0) { 
     
    20792079                int vLastPt = pString.lastIndexOf('.'); 
    20802080                if(vFirstPt != vLastPt) { 
    2081                         StringBuffer vBuf = new StringBuffer(pString.length()); 
     2081                        StringBuilder vBuf = new StringBuilder(pString.length()); 
    20822082                        for (int i = 0; i < vFirstPt; i++) { 
    20832083                                vBuf.append(pString.charAt(i)); 
  • trunk/Jav_GE/com/scenari/m/ge/generateur/IScripter.java

    r5442 r10372  
    5050     * de publication : ordre javascript, spécification d'une url relative ou absolue, etc. 
    5151     */ 
    52     public void loadPage(StringBuffer pBuf, IDynamicFile pPage) throws Exception; 
     52    public void loadPage(StringBuilder pBuf, IDynamicFile pPage) throws Exception; 
    5353 
    5454    /** 
     
    5757     * de publication : ordre javascript, spécification d'une url relative ou absolue, etc. 
    5858     */ 
    59     public void loadUrl(StringBuffer pBuf, String pUrl) throws Exception; 
     59    public void loadUrl(StringBuilder pBuf, String pUrl) throws Exception; 
    6060     
    6161    /** 
    6262     * Quitte le système. 
    6363     *  
    64      * @param pBuf java.lang.StringBuffer 
     64     * @param pBuf java.lang.StringBuilder 
    6565     * @exception java.lang.Exception The exception description. 
    6666     */ 
    67     public void quit(StringBuffer pBuf) throws Exception; 
     67    public void quit(StringBuilder pBuf) throws Exception; 
    6868 
    6969    /** 
    7070     * Retourne à l'accueil du système : home page LMS, etc. 
    7171     *  
    72      * @param pBuf java.lang.StringBuffer 
     72     * @param pBuf java.lang.StringBuilder 
    7373     * @exception java.lang.Exception The exception description. 
    7474     */ 
    75     public void goHome(StringBuffer pBuf) throws Exception; 
     75    public void goHome(StringBuilder pBuf) throws Exception; 
    7676     
    7777    /** 
  • trunk/Jav_GE/com/scenari/m/ge/generateur/ScripterDefault.java

    r5442 r10372  
    5252     *  
    5353     */ 
    54     public void loadPage(StringBuffer pBuf, IDynamicFile pPage) throws Exception { 
     54    public void loadPage(StringBuilder pBuf, IDynamicFile pPage) throws Exception { 
    5555        pBuf.append(pPage.getDestUrl()); 
    5656    } 
     
    5959     *  
    6060     */ 
    61     public void loadUrl(StringBuffer pBuf, String pUrl) throws Exception { 
     61    public void loadUrl(StringBuilder pBuf, String pUrl) throws Exception { 
    6262        pBuf.append(pUrl); 
    6363    } 
     
    6767     * Non géré par ce scripter. 
    6868     *  
    69      * @param pBuf java.lang.StringBuffer 
     69     * @param pBuf java.lang.StringBuilder 
    7070     * @exception java.lang.Exception The exception description. 
    7171     */ 
    72     public void quit(StringBuffer pBuf) throws Exception { 
     72    public void quit(StringBuilder pBuf) throws Exception { 
    7373    } 
    7474 
     
    7676     * Non géré par ce scripter. 
    7777     */ 
    78     public void goHome(StringBuffer pBuf) throws Exception { 
     78    public void goHome(StringBuilder pBuf) throws Exception { 
    7979    } 
    8080 
  • trunk/Jav_GE/com/scenari/m/ge/generateur/ScripterJs.java

    r5442 r10372  
    5353     *  
    5454     */ 
    55     public void loadPage(StringBuffer pBuf, IDynamicFile pPage) throws Exception { 
     55    public void loadPage(StringBuilder pBuf, IDynamicFile pPage) throws Exception { 
    5656 
    5757        String vUrl = pPage.getDestUrl(); 
     
    7070     *  
    7171     */ 
    72     public void loadUrl(StringBuffer pBuf, String pUrl) throws Exception { 
     72    public void loadUrl(StringBuilder pBuf, String pUrl) throws Exception { 
    7373        pBuf.append("ih.load('"); 
    7474        pBuf.append(pUrl); 
     
    7979     *  
    8080     */ 
    81     public void quit(StringBuffer pBuf) throws Exception { 
     81    public void quit(StringBuilder pBuf) throws Exception { 
    8282        pBuf.append("ih.quit();"); 
    8383    } 
     
    8686     *  
    8787     */ 
    88     public void goHome(StringBuffer pBuf) throws Exception { 
     88    public void goHome(StringBuilder pBuf) throws Exception { 
    8989        pBuf.append("ih.retouraccueil();"); 
    9090    } 
  • trunk/Jav_GE/com/scenari/m/ge/generator/web/ScripterUrl.java

    r5442 r10372  
    1818     *  
    1919     */ 
    20     public void loadPage(StringBuffer pBuf, IDynamicFile pPage) throws Exception { 
     20    public void loadPage(StringBuilder pBuf, IDynamicFile pPage) throws Exception { 
    2121        pBuf.append(fGenerator.resolveDestUri2DestUrl(pPage.getDestUri())); 
    2222    } 
     
    2525     *  
    2626     */ 
    27     public void loadUrl(StringBuffer pBuf, String pUrl) throws Exception { 
     27    public void loadUrl(StringBuilder pBuf, String pUrl) throws Exception { 
    2828        pBuf.append(pUrl); 
    2929    } 
     
    3232     *  
    3333     */ 
    34     public void quit(StringBuffer pBuf) throws Exception { 
     34    public void quit(StringBuilder pBuf) throws Exception { 
    3535       // 
    3636    } 
     
    3939     *  
    4040     */ 
    41     public void goHome(StringBuffer pBuf) throws Exception { 
     41    public void goHome(StringBuilder pBuf) throws Exception { 
    4242        // 
    4343    } 
  • trunk/Jav_GE/com/scenari/m/ge/generator/web/WebGenerator.java

    r10257 r10372  
    22 
    33import java.io.File; 
     4import java.io.IOException; 
    45import java.io.OutputStream; 
    56import java.io.Reader; 
     
    2223import com.scenari.m.co.agent.IWAgent; 
    2324import com.scenari.m.co.dialog.IHDialog; 
     25import com.scenari.m.co.donnee.IAgentData; 
    2426import com.scenari.m.co.donnee.IData; 
    25 import com.scenari.m.co.donnee.IAgentData; 
    2627import com.scenari.m.co.instance.IWInstFormation; 
    2728import com.scenari.m.co.user.IWUser; 
     
    5455public class WebGenerator extends GeneratorBase { 
    5556 
    56     /** 
    57      * Nom de la propriété correspondant au dossier des pages dynamiques . 
    58      */ 
    59     public static final String KEYPROPERTY_DYNAMICPAGES_FOLDERPATH = "destination.dynamicPages.folderPath"; 
    60  
    61     /** 
    62      * Nom de la propriété correspondant au dossier susceptibles d'accueillir des ressources 
    63      * avec nom modifiables pour éviter les conflits ou avec un nom calculé automatiquement. 
    64      */ 
    65     public static final String KEYPROPERTY_MUTABLEDST_FOLDERPATH = "destination.mutabledst.folderPath"; 
    66  
    67     public static final String KEYPROPERTY_SOURCE_SITE_FOLDERPATH = "source.site.folderPath"; 
    68  
    69     /** Encoding des sources WebMacro. */ 
    70     public static final String KEYPROPERTY_SOURCE_WM_ENCODING = "source.wmEncoding"; 
    71  
    72     /** Encoding des fichiers WebMacro générés. */ 
    73     public static final String KEYPROPERTY_DEST_WM_ENCODING = "destination.wmEncoding"; 
    74  
    75     /**  
    76      * Règle de construction des uri des pages dynamiques en fonction d'une URI source. 
    77      * Spécifie le nombre de dossiers racines de l'URI source à exclure pour construire l'uri dest. 
    78      * Valeur par défaut : 1 (correspondant au dossier de l'atelier dans SCENARIchain). 
    79      */ 
    80     public static final String KEYPROPERTY_BUILDURIFROMSOURCE_EXCLUDE = "destination.buildUriFromSource.rootFoldersToExclude"; 
    81  
    82     /** 
    83      * Extension Webmacro. 
    84      */ 
    85     public static final String EXT_WM = ".wm"; 
    86  
    87     public class ScriptableFunctionsWm extends GeneratorBase.XScriptableFunctions implements IScriptableFunctionsWeb { 
    88  
    89         public String escapeXml(String pText) { 
    90             if (pText == null || pText.length() == 0) return ""; 
    91             StringBuffer vBuf = new StringBuffer(pText.length() + 12); 
    92             HEncodingXml.hWriteTextValue(vBuf, pText); 
    93             return vBuf.toString(); 
    94         } 
    95  
    96         public String escapeHtml(String pText) { 
    97             if (pText == null || pText.length() == 0) return ""; 
    98             StringBuffer vBuf = new StringBuffer(pText.length() + 12); 
    99             HEncodingXml.hWriteTextHtmlValue(vBuf, pText); 
    100             return vBuf.toString(); 
    101         } 
    102          
    103         public String escapeJs(String pText) { 
    104             if (pText == null || pText.length() == 0) return ""; 
    105             StringBuffer vBuf = new StringBuffer(pText.length() + 12); 
    106             HEncodingXml.hWriteJsValue(vBuf, pText); 
    107             return vBuf.toString(); 
    108         } 
    109          
    110          
    111     } 
    112  
    113     /** 
    114      * Clé d'une ressource copiée dans les mutablest (dossier "res"). 
    115      * 
    116      */ 
    117     protected static class KeyRes { 
    118  
    119         protected IXxxUri fXxxUri = null; 
    120  
    121         protected String fTransform = null; 
    122  
    123         public KeyRes(IXxxUri pXxxUri, String pTransform) { 
    124             fTransform = pTransform; 
    125             fXxxUri = pXxxUri; 
    126         } 
    127  
    128         /* (non-Javadoc) 
    129          * @see java.lang.Object#equals(java.lang.Object) 
    130          */ 
    131         public boolean equals(Object pObj) { 
    132             KeyRes vKey = (KeyRes) pObj; 
    133             if (fTransform == null) { 
    134                 if (vKey.fTransform == null) return vKey.fXxxUri.equals(fXxxUri); 
    135                 return false; 
    136             } 
    137             if (vKey.fTransform == null) return false; 
    138             return vKey.fXxxUri.equals(fXxxUri) && vKey.fTransform.equals(fTransform); 
    139         } 
    140  
    141         /* (non-Javadoc) 
    142          * @see java.lang.Object#hashCode() 
    143          */ 
    144         public int hashCode() { 
    145             return fXxxUri.hashCode(); 
    146         } 
    147     } 
    148  
    149     /** 
    150      * Dossier de destination des Contenus issues des pages dynamiques. 
    151      */ 
    152     protected IHSource fDestFolderCo = null; 
    153  
    154     /** 
    155      * Dossier de destination susceptible d'accueillir des 
    156      * resources avec des noms modifiables pour éviter les conflits. 
    157      */ 
    158     protected IHSource fDestFolderMutableDst = null; 
    159  
    160     /** 
    161      * Resources déjà exportées dont la dst est fxée par les BS (donc exportées dans le Folder "co") : key = destUri copiée. 
    162      *  
    163      * @see #translateSrcUri2DestUri(String) 
    164      */ 
    165     protected Set fDestUriTreatedInCo = new HashSet(); 
    166  
    167     /** 
    168      * Resources déjà exportées dont la dst n'est fxée pas par les BS (donc exportées dans le Folder "res") :  
    169      * <ul> 
    170      * <li>key = srcUri+transform. 
    171      * <li>value = DestUri de la ressource copiée. 
    172      * </ul>  
    173      */ 
    174     protected Map fSrcFilesCopiedInRes = new HashMap(); 
    175  
    176     /** 
    177      * Resources déjà exportées :  
    178      * <ul> 
    179      * <li>key = PubUri : uri source  
    180      * <li>value = DestUri de la ressource copiée. 
    181      * </ul> 
    182      */ 
    183     protected Map fPubFilesCopied = new HashMap(); 
    184  
    185     /** WebMacro. */ 
    186     protected Broker fBroker = null; 
    187  
    188     /** Encoding des pages WebMacro (Output). */ 
    189     protected String fEncoding = "ISO-8859-1"; 
    190  
    191     /** Redondance : paramètre de profondeur de dossiers à exclure pour créer la règle de mapping entre SrcUri et DestUri. */ 
    192     protected int fSrcUri2DestUriExcludeFolders = 1; 
    193  
    194     /** Redondance : Uri root du site dans l'espace de pub. */ 
    195     protected String fPubUriRootSite = null; 
    196  
    197     public WebGenerator() { 
    198         super(); 
    199     } 
    200  
    201     /** 
    202      * Init du dossier de destination général et du dossier de publication des pages dynamiques. 
    203      *  
    204      * @see com.scenari.m.ge.generateur.IGenerator#setDestRoot(IHSource) 
    205      */ 
    206     public void setDestRoot(IHSource pDocServeur) throws Exception { 
    207         super.setDestRoot(pDocServeur); 
    208         fDestFolderCo = fDestRoot.hFindSource(xGetPathCo()); 
    209         fDestFolderMutableDst = fDestRoot.hFindSource(xGetPathMutableDst()); 
    210     } 
    211  
    212     protected String xGetPathCo() { 
    213         String vPathDynamicPagesFolder = (String) getProperty(KEYPROPERTY_DYNAMICPAGES_FOLDERPATH); 
    214         if (vPathDynamicPagesFolder == null) vPathDynamicPagesFolder = "co"; 
    215         return vPathDynamicPagesFolder; 
    216     } 
    217  
    218     protected String xGetPathMutableDst() { 
    219         String vPathReFolder = (String) getProperty(KEYPROPERTY_MUTABLEDST_FOLDERPATH); 
    220         if (vPathReFolder == null) vPathReFolder = "res"; 
    221         return vPathReFolder; 
    222     } 
    223  
    224     /* (non-Javadoc) 
    225      * @see com.scenari.m.ge.generateur.HGenerateur#wPurgePages(com.scenari.m.co.instance.IWInstFormation, com.scenari.m.co.user.IWUser, java.lang.String, java.lang.String, java.lang.String) 
    226      */ 
    227     public void wPurgePages(IWInstFormation pInstance, IWUser pActeur, String pMode, String pSupport, String pLangue) throws Exception { 
    228         fDestFolderCo.hRemove(); 
    229         //Controle que tous les fichiers ont été supprimés. 
    230         List vList = fDestFolderCo.hGetNameChilds(IHSource.ALL_STATUS, null); 
    231         if (vList != null && vList.size() > 0) { 
    232             throw HLogMgr.hNewException("Tous les fichiers n'ont pu être supprimés avant la génération dans le dossier de destination (dossier '" + fDestFolderCo.hGetUri() + "') : " + fDestFolderCo); 
    233         } 
    234         fDestFolderMutableDst.hRemove(); 
    235         //Controle que tous les fichiers ont été supprimés. 
    236         vList = fDestFolderMutableDst.hGetNameChilds(IHSource.ALL_STATUS, null); 
    237         if (vList != null && vList.size() > 0) { 
    238             throw HLogMgr.hNewException("Tous les fichiers n'ont pu être supprimés avant la génération dans le dossier de destination (dossier '" + fDestFolderMutableDst.hGetUri() + "') : " + fDestFolderMutableDst); 
    239         } 
    240     } 
    241  
    242     /* (non-Javadoc) 
    243      * @see com.scenari.m.ge.generateur.HGenerateur#xGenerer(com.scenari.m.co.instance.IWInstFormation, com.scenari.m.co.user.IWUser, java.lang.String, java.lang.String, java.lang.String) 
    244      */ 
    245     protected void xGenerate(IWInstFormation pInstance, IWUser pActeur, String pMode, String pSupport, String pLangue) throws Exception { 
    246  
    247         //Init divers... 
    248         fDestUriTreatedInCo.clear(); 
    249         fSrcFilesCopiedInRes.clear(); 
    250         fPubFilesCopied.clear(); 
    251  
    252         try { 
    253             ///Force le recalcul de la property. 
    254             fSrcUri2DestUriExcludeFolders = -1; 
    255  
    256             //Création du dialogue de départ avec son contexte 
    257             HContextGenerator vContext = new HContextGenerator(); 
    258             vContext.wSetUser(pActeur); 
    259             vContext.wSetSupport(pSupport); 
    260             vContext.wSetGenerator(this); 
    261  
    262             IWAgent vAgent = pInstance.hGetAgentRoot(); 
    263             if (vAgent == null) { 
    264                 throw HLogMgr.hNewException("Le composant racine de la prescription '" + pInstance.hGetPrescription().hGetIdNoeudDepart() + "' est introuvable."); 
    265             } 
    266  
    267             fCurrentDialog = pInstance.hGetAgentRoot().hNewDialog(); 
    268             ((IWADialogExport) fCurrentDialog).hSetHier(new ArrayList()); 
    269             fCurrentDialog.hSetContext(vContext); 
    270  
    271             //Génération des pages de l'IHM 
    272             fPubUriRootSite = (String) getProperty(KEYPROPERTY_SOURCE_SITE_FOLDERPATH); 
    273             if (fPubUriRootSite == null) { 
    274                 fPubUriRootSite = "/site/"; 
    275             } else { 
    276                 //On s'assure qu'il y a "/" de fin : voir translatePubUri2DestUri() 
    277                 if (!fPubUriRootSite.endsWith("/")) fPubUriRootSite.concat("/"); 
    278                 //On vérifie le slash de début pour que ce soit une URI (pas un path) 
    279                 if (!fPubUriRootSite.startsWith("/")) "/".concat(fPubUriRootSite); 
    280             } 
    281             xCopyPubFolder2Dest(fPubRoot.hFindSource(fPubUriRootSite), ""); 
    282  
    283             wTreatStackPages(); 
    284         } finally { 
    285             //Resets divers 
    286             fDestUriTreatedInCo.clear(); 
    287             fSrcFilesCopiedInRes.clear(); 
    288             fPubFilesCopied.clear(); 
    289         } 
    290     } 
    291  
    292     /** 
    293      * Format de pUrlLogique :  
    294      * <ul> 
    295      * <li><b>src=XXXXX;dst=YYYYYY;transform=ZZZZZ </b>. Le paramètre 'transform' doit toujours être 
    296      * le dernier. La dst doit être un path qui sera évaluée relativement à <code>fDestFolderCo</code>. 
    297      * Elle ne doit donc pas commencer par un "/". 
    298      * <li><b>src=XXXXX;transform=ZZZZZ</b>. Si aucune dst n'est spécifiée, une destUrl est calculée automatiquement. 
    299      * </ul> 
    300      *  
    301      * @see com.scenari.m.ge.generateur.IGenerator#copyXxxPath2DestUri(java.lang.String, 
    302      *      com.scenari.m.co.dialog.IHDialog, Object) 
    303      */ 
    304     public String copyXxxPath2DestUri(String pUrlLogique, IHDialog pDialog, Object pOwner) throws Exception { 
    305         if (pUrlLogique == null) return ""; 
    306         try { 
    307  
    308             String vUrlSrc = null; 
    309             IHSource vSrc = null; 
    310             String vDestUri = null; 
    311             IHSource vDst = null; 
    312  
    313             int vIdx = pUrlLogique.indexOf("dst="); 
    314             if (vIdx < 0) { 
    315                 vDestUri = xCopySrcPath2DestUriNoDst(pUrlLogique, pDialog, pOwner); 
    316             } else { 
    317                 int vIdx2 = pUrlLogique.indexOf(';', vIdx); 
    318                 vDestUri = transformNameWithOneExt(HCharSeqUtil.stringWithoutAccent( (vIdx2 > 0) ? pUrlLogique.substring(vIdx + 4, vIdx2) : pUrlLogique.substring(vIdx + 4) ).toString()); 
    319  
    320                 //Calcul de la destination 
    321                 vDst = fDestFolderCo.hFindSource(vDestUri); 
    322                 vDestUri = vDst.hGetUri(); 
    323  
    324                 //URL Déjà exporté ? 
    325                 if (fDestUriTreatedInCo.contains(vDestUri)) { 
    326                     //Cette ressource a déjà été exportée au cours de cette génération 
    327                     return vDestUri; 
    328                 } else { 
    329                     //Recherche de la source 
    330                     vIdx = pUrlLogique.indexOf("src="); 
    331                     if (vIdx < 0) { 
    332                         throw new Exception("Les paramètres pour l'export d'une ressource ne spécifie pas de 'src' : " + pUrlLogique); 
    333                     } 
    334                     vIdx2 = pUrlLogique.indexOf(';', vIdx); 
    335                     vUrlSrc = (vIdx2 > 0) ? pUrlLogique.substring(vIdx + 4, vIdx2) : pUrlLogique.substring(vIdx + 4); 
    336  
    337                     //Résolution de l'URL SRC 
    338                     IXxxUri pXxxUri = resolveXxxPath(vUrlSrc, pDialog, pOwner); 
    339                     vSrc = getSourceFromXxxUri(pXxxUri, pDialog); 
    340  
    341                     if (vSrc.hGetStatus() == IHSourceElem.STATUS_NONE) { 
    342                         //Src nulle, on sort 
    343                         return ""; 
    344                     } 
    345  
    346                     //Ajout à liste des ressources traitées 
    347                     fDestUriTreatedInCo.add(vDestUri); 
    348  
    349                     //Eval d'une transformation 
    350                     vIdx = pUrlLogique.indexOf("transform="); 
    351                     if (vIdx < 0) { 
    352                         //Pas de transformation, on copie simplement la ressource. 
    353                         try { 
    354                             vDst.hCopyFrom(vSrc); 
    355                         } catch (Exception e) { 
    356                             HLogMgr.hAddMessage(e, "Echec à la copie de la ressource '" + pUrlLogique + "' d'Url '" + vUrlSrc + "' dans " + pDialog); 
    357                             wAddTraceLogMessage(IHLogMessage.TYPE_WARNING, HLogMgr.hGetMessage(e)); 
    358                             try { 
    359                                 vDst.hRemove(); 
    360                             } catch (Exception ee) {} 
    361                         } 
    362                     } else { 
    363                         //On a une transformation 
    364                         HTransformParams vTransform = HTransformParams.hNewParamsTransformByQueryString(pUrlLogique.substring(vIdx), null); 
    365                         IHStream vStream = vSrc.hTransform(vTransform); 
    366                         if (vStream == null) throw HLogMgr.hNewException("La transformation '" + vTransform.toString() + "' est impossible ou n'existe pas."); 
    367                         try { 
    368                             OutputStream vOutputStream = vDst.hGetOutputStream(); 
    369                             try { 
    370                                 vStream.hWriteIn(vOutputStream); 
    371                             } finally { 
    372                                 if (vOutputStream != null) { 
    373                                     vOutputStream.close(); 
    374                                 } 
    375                             } 
    376                         } finally { 
    377                             if (vStream != null) { 
    378                                 vStream.hClose(); 
    379                             } 
    380                         } 
    381                     } 
    382                 } 
    383             } 
    384             return vDestUri; 
    385         } catch (Exception e) { 
    386             HLogMgr.hAddMessage(e, "Echec à la transformation de la ressource '" + pUrlLogique + "' dans " + pDialog + "."); 
    387             wAddTraceLogMessage(IHLogMessage.TYPE_WARNING, HLogMgr.hGetMessage(e)); 
    388         } 
    389         return ""; 
    390     } 
    391  
    392     /** 
    393      * Copie une ressource avec aucune dst de spécifiée qui doit donc être calculée automatiquemet. 
    394      * Ces ressources sont copiées dans le dossier des mutableDst. 
    395      */ 
    396     protected String xCopySrcPath2DestUriNoDst(String pUrlLogique, IHDialog pDialog, Object pOwner) throws Exception { 
    397         //Recherche de la source 
    398         int vIdx = pUrlLogique.indexOf("src="); 
    399         if (vIdx < 0) { 
    400             throw new Exception("Les paramètres pour l'export d'une ressource ne spécifie pas de 'src' : " + pUrlLogique); 
    401         } 
    402         int vIdx2 = pUrlLogique.indexOf(';', vIdx); 
    403         String vUrlSrc = (vIdx2 > 0) ? pUrlLogique.substring(vIdx + 4, vIdx2) : pUrlLogique.substring(vIdx + 4); 
    404  
    405         //Résolution de l'URL SRC 
    406         IXxxUri pXxxUri = resolveXxxPath(vUrlSrc, pDialog, pOwner); 
    407  
    408         //Eval d'une transformation 
    409         HTransformParams vTransform = null; 
    410         vIdx = pUrlLogique.indexOf("transform="); 
    411         if (vIdx >= 0) { 
    412             //On a une transformation 
    413             vTransform = HTransformParams.hNewParamsTransformByQueryString(pUrlLogique.substring(vIdx), null); 
    414         } 
    415  
    416         KeyRes vKeyRes = new KeyRes(pXxxUri, vTransform != null ? vTransform.hGetQueryStringFromThis() : null); 
    417  
    418         //Si la key existe déjà, on retourne le destUri déjà créé 
    419         String vDestUri = (String) fSrcFilesCopiedInRes.get(vKeyRes); 
    420         if (vDestUri != null) return vDestUri; 
    421  
    422         IHSource vSrc = getSourceFromXxxUri(pXxxUri, pDialog); 
    423         if (vSrc.hGetStatus() == IHSourceElem.STATUS_NONE) { 
    424             //Src nulle, on sort 
    425             return ""; 
    426         } 
    427  
    428         IHSource vDst = null; 
    429  
    430         //On construit une 1ere destination. 
    431         if (vTransform == null) { 
    432             vDst = fDestFolderMutableDst.hFindSource(transformNameWithOneExt(HCharSeqUtil.stringWithoutAccent(vSrc.hGetName()).toString())); 
    433         } else { 
    434             IHTransformer vTr = HTransformerMgr.hGetTransformerMgr(null).hGetTransformer(vTransform); 
    435             String vExt = null; 
    436             if (vTr != null) { 
    437                 vExt = vTr.hGetFileExtension(vTransform); 
    438             } else { 
    439                 vExt = vTransform.hGetValueParam("fileExt"); 
    440             } 
    441             if (vExt != null && vExt.length() == 0) vExt = null; 
    442             String vFileName = vSrc.hGetName(); 
    443             if (vExt != null) { 
    444                 //On construit l'URL de destination. 
    445                 if (vExt != null && !vFileName.endsWith(vExt)) { 
    446                     //Une extension différente est prévue par une transformation. 
    447                     int vOffsExt = vFileName.lastIndexOf('.'); 
    448                     if (vOffsExt > 0) { 
    449                         vFileName = vFileName.substring(0, vOffsExt).concat(vExt); 
    450                     } else { 
    451                         vFileName = vFileName.concat(vExt); 
    452                     } 
    453                 } 
    454             } 
    455             vDst = fDestFolderMutableDst.hFindSource(transformNameWithOneExt(HCharSeqUtil.stringWithoutAccent(vFileName).toString())); 
    456         } 
    457  
    458         //On s'assure de l'unicité de la dest 
    459         vDst = xLookForFreeDst(vDst); 
    460  
    461         fSrcFilesCopiedInRes.put(vKeyRes, vDst.hGetUri()); 
    462         if (vTransform == null) { 
    463             //Pas de transformation, on copie simplement la ressource. 
    464             try { 
    465                 vDst.hCopyFrom(vSrc); 
    466             } catch (Exception e) { 
    467                 HLogMgr.hAddMessage(e, "Echec à la copie de la ressource '" + pUrlLogique + "' d'Url '" + vUrlSrc + "' dans " + pDialog); 
    468                 wAddTraceLogMessage(IHLogMessage.TYPE_WARNING, HLogMgr.hGetMessage(e)); 
    469                 try { 
    470                     vDst.hRemove(); 
    471                 } catch (Exception ee) {} 
    472             } 
    473         } else { 
    474             //On a une transformation 
    475             IHStream vStream = vSrc.hTransform(vTransform); 
    476             if (vStream == null) throw HLogMgr.hNewException("La transformation '" + vTransform.toString() + "' est impossible ou n'existe pas."); 
    477             try { 
    478                 OutputStream vOutputStream = vDst.hGetOutputStream(); 
    479                 try { 
    480                     vStream.hWriteIn(vOutputStream); 
    481                 } finally { 
    482                     if (vOutputStream != null) vOutputStream.close(); 
    483                 } 
    484             } finally { 
    485                 if (vStream != null) vStream.hClose(); 
    486             } 
    487         } 
    488  
    489         return vDst.hGetUri(); 
    490     } 
     57        /** 
     58         * Nom de la propriété correspondant au dossier des pages dynamiques . 
     59         */ 
     60        public static final String KEYPROPERTY_DYNAMICPAGES_FOLDERPATH = "destination.dynamicPages.folderPath"; 
     61 
     62        /** 
     63         * Nom de la propriété correspondant au dossier susceptibles d'accueillir des ressources 
     64         * avec nom modifiables pour éviter les conflits ou avec un nom calculé automatiquement. 
     65         */ 
     66        public static final String KEYPROPERTY_MUTABLEDST_FOLDERPATH = "destination.mutabledst.folderPath"; 
     67 
     68        public static final String KEYPROPERTY_SOURCE_SITE_FOLDERPATH = "source.site.folderPath"; 
     69 
     70        /** Encoding des sources WebMacro. */ 
     71        public static final String KEYPROPERTY_SOURCE_WM_ENCODING = "source.wmEncoding"; 
     72 
     73        /** Encoding des fichiers WebMacro générés. */ 
     74        public static final String KEYPROPERTY_DEST_WM_ENCODING = "destination.wmEncoding"; 
     75 
     76        /**  
     77         * Règle de construction des uri des pages dynamiques en fonction d'une URI source. 
     78         * Spécifie le nombre de dossiers racines de l'URI source à exclure pour construire l'uri dest. 
     79         * Valeur par défaut : 1 (correspondant au dossier de l'atelier dans SCENARIchain). 
     80         */ 
     81        public static final String KEYPROPERTY_BUILDURIFROMSOURCE_EXCLUDE = "destination.buildUriFromSource.rootFoldersToExclude"; 
     82 
     83        /** 
     84         * Extension Webmacro. 
     85         */ 
     86        public static final String EXT_WM = ".wm"; 
     87 
     88        public class ScriptableFunctionsWm extends GeneratorBase.XScriptableFunctions implements IScriptableFunctionsWeb { 
     89 
     90                public String escapeXml(String pText) { 
     91                        if (pText == null || pText.length() == 0) return ""; 
     92                        StringBuilder vBuf = new StringBuilder(pText.length() + 12); 
     93                        try { 
     94                                HEncodingXml.hWriteTextValue(vBuf, pText); 
     95                        } catch (IOException e) { 
     96                                // 
     97                        } 
     98                        return vBuf.toString(); 
     99                } 
     100 
     101                public String escapeHtml(String pText) { 
     102                        if (pText == null || pText.length() == 0) return ""; 
     103                        StringBuilder vBuf = new StringBuilder(pText.length() + 12); 
     104                        try { 
     105                                HEncodingXml.hWriteTextHtmlValue(vBuf, pText); 
     106                        } catch (IOException e) { 
     107                                // 
     108                        } 
     109                        return vBuf.toString(); 
     110                } 
     111 
     112                public String escapeJs(String pText) { 
     113                        if (pText == null || pText.length() == 0) return ""; 
     114                        StringBuilder vBuf = new StringBuilder(pText.length() + 12); 
     115                        try { 
     116                                HEncodingXml.hWriteJsValue(vBuf, pText); 
     117                        } catch (IOException e) { 
     118                                // 
     119                        } 
     120                        return vBuf.toString(); 
     121                } 
     122 
     123        } 
     124 
     125        /** 
     126         * Clé d'une ressource copiée dans les mutablest (dossier "res"). 
     127         * 
     128         */ 
     129        protected static class KeyRes { 
     130 
     131                protected IXxxUri fXxxUri = null; 
     132 
     133                protected String fTransform = null; 
     134 
     135                public KeyRes(IXxxUri pXxxUri, String pTransform) { 
     136                        fTransform = pTransform; 
     137                        fXxxUri = pXxxUri; 
     138                } 
     139 
     140                /* (non-Javadoc) 
     141                 * @see java.lang.Object#equals(java.lang.Object) 
     142                 */ 
     143                public boolean equals(Object pObj) { 
     144                        KeyRes vKey = (KeyRes) pObj; 
     145                        if (fTransform == null) { 
     146                                if (vKey.fTransform == null) return vKey.fXxxUri.equals(fXxxUri); 
     147                                return false; 
     148                        } 
     149                        if (vKey.fTransform == null) return false; 
     150                        return vKey.fXxxUri.equals(fXxxUri) && vKey.fTransform.equals(fTransform); 
     151                } 
     152 
     153                /* (non-Javadoc) 
     154                 * @see java.lang.Object#hashCode() 
     155                 */ 
     156                public int hashCode() { 
     157                        return fXxxUri.hashCode(); 
     158                } 
     159        } 
     160 
     161        /** 
     162         * Dossier de destination des Contenus issues des pages dynamiques. 
     163         */ 
     164        protected IHSource fDestFolderCo = null; 
     165 
     166        /** 
     167         * Dossier de destination susceptible d'accueillir des 
     168         * resources avec des noms modifiables pour éviter les conflits. 
     169         */ 
     170        protected IHSource fDestFolderMutableDst = null; 
     171 
     172        /** 
     173         * Resources déjà exportées dont la dst est fxée par les BS (donc exportées dans le Folder "co") : key = destUri copiée. 
     174         *  
     175         * @see #translateSrcUri2DestUri(String) 
     176         */ 
     177        protected Set fDestUriTreatedInCo = new HashSet(); 
     178 
     179        /** 
     180         * Resources déjà exportées dont la dst n'est fxée pas par les BS (donc exportées dans le Folder "res") :  
     181         * <ul> 
     182         * <li>key = srcUri+transform. 
     183         * <li>value = DestUri de la ressource copiée. 
     184         * </ul>  
     185         */ 
     186        protected Map fSrcFilesCopiedInRes = new HashMap(); 
     187 
     188        /** 
     189         * Resources déjà exportées :  
     190         * <ul> 
     191         * <li>key = PubUri : uri source  
     192         * <li>value = DestUri de la ressource copiée. 
     193         * </ul> 
     194         */ 
     195        protected Map fPubFilesCopied = new HashMap(); 
     196 
     197        /** WebMacro. */ 
     198        protected Broker fBroker = null; 
     199 
     200        /** Encoding des pages WebMacro (Output). */ 
     201        protected String fEncoding = "ISO-8859-1"; 
     202 
     203        /** Redondance : paramètre de profondeur de dossiers à exclure pour créer la règle de mapping entre SrcUri et DestUri. */ 
     204        protected int fSrcUri2DestUriExcludeFolders = 1; 
     205 
     206        /** Redondance : Uri root du site dans l'espace de pub. */ 
     207        protected String fPubUriRootSite = null; 
     208 
     209        public WebGenerator() { 
     210                super(); 
     211        } 
     212 
     213        /** 
     214         * Init du dossier de destination général et du dossier de publication des pages dynamiques. 
     215         *  
     216         * @see com.scenari.m.ge.generateur.IGenerator#setDestRoot(IHSource) 
     217         */ 
     218        public void setDestRoot(IHSource pDocServeur) throws Exception { 
     219                super.setDestRoot(pDocServeur); 
     220                fDestFolderCo = fDestRoot.hFindSource(xGetPathCo()); 
     221                fDestFolderMutableDst = fDestRoot.hFindSource(xGetPathMutableDst()); 
     222        } 
     223 
     224        protected String xGetPathCo() { 
     225                String vPathDynamicPagesFolder = (String) getProperty(KEYPROPERTY_DYNAMICPAGES_FOLDERPATH); 
     226                if (vPathDynamicPagesFolder == null) vPathDynamicPagesFolder = "co"; 
     227                return vPathDynamicPagesFolder; 
     228        } 
     229 
     230        protected String xGetPathMutableDst() { 
     231                String vPathReFolder = (String) getProperty(KEYPROPERTY_MUTABLEDST_FOLDERPATH); 
     232                if (vPathReFolder == null) vPathReFolder = "res"; 
     233                return vPathReFolder; 
     234        } 
     235 
     236        /* (non-Javadoc) 
     237         * @see com.scenari.m.ge.generateur.HGenerateur#wPurgePages(com.scenari.m.co.instance.IWInstFormation, com.scenari.m.co.user.IWUser, java.lang.String, java.lang.String, java.lang.String) 
     238         */ 
     239        public void wPurgePages(IWInstFormation pInstance, IWUser pActeur, String pMode, String pSupport, String pLangue) throws Exception { 
     240                fDestFolderCo.hRemove(); 
     241                //Controle que tous les fichiers ont été supprimés. 
     242                List vList = fDestFolderCo.hGetNameChilds(IHSource.ALL_STATUS, null); 
     243                if (vList != null && vList.size() > 0) { throw HLogMgr.hNewException("Tous les fichiers n'ont pu être supprimés avant la génération dans le dossier de destination (dossier '" + fDestFolderCo.hGetUri() + "') : " + fDestFolderCo); } 
     244                fDestFolderMutableDst.hRemove(); 
     245                //Controle que tous les fichiers ont été supprimés. 
     246                vList = fDestFolderMutableDst.hGetNameChilds(IHSource.ALL_STATUS, null); 
     247                if (vList != null && vList.size() > 0) { throw HLogMgr.hNewException("Tous les fichiers n'ont pu être supprimés avant la génération dans le dossier de destination (dossier '" + fDestFolderMutableDst.hGetUri() + "') : " + fDestFolderMutableDst); } 
     248        } 
     249 
     250        /* (non-Javadoc) 
     251         * @see com.scenari.m.ge.generateur.HGenerateur#xGenerer(com.scenari.m.co.instance.IWInstFormation, com.scenari.m.co.user.IWUser, java.lang.String, java.lang.String, java.lang.String) 
     252         */ 
     253        protected void xGenerate(IWInstFormation pInstance, IWUser pActeur, String pMode, String pSupport, String pLangue) throws Exception { 
     254 
     255                //Init divers... 
     256                fDestUriTreatedInCo.clear(); 
     257                fSrcFilesCopiedInRes.clear(); 
     258                fPubFilesCopied.clear(); 
     259 
     260                try { 
     261                        ///Force le recalcul de la property. 
     262                        fSrcUri2DestUriExcludeFolders = -1; 
     263 
     264                        //Création du dialogue de départ avec son contexte 
     265                        HContextGenerator vContext = new HContextGenerator(); 
     266                        vContext.wSetUser(pActeur); 
     267                        vContext.wSetSupport(pSupport); 
     268                        vContext.wSetGenerator(this); 
     269 
     270                        IWAgent vAgent = pInstance.hGetAgentRoot(); 
     271                        if (vAgent == null) { throw HLogMgr.hNewException("Le composant racine de la prescription '" + pInstance.hGetPrescription().hGetIdNoeudDepart() + "' est introuvable."); } 
     272 
     273                        fCurrentDialog = pInstance.hGetAgentRoot().hNewDialog(); 
     274                        ((IWADialogExport) fCurrentDialog).hSetHier(new ArrayList()); 
     275                        fCurrentDialog.hSetContext(vContext); 
     276 
     277                        //Génération des pages de l'IHM 
     278                        fPubUriRootSite = (String) getProperty(KEYPROPERTY_SOURCE_SITE_FOLDERPATH); 
     279                        if (fPubUriRootSite == null) { 
     280                                fPubUriRootSite = "/site/"; 
     281                        } else { 
     282                                //On s'assure qu'il y a "/" de fin : voir translatePubUri2DestUri() 
     283                                if (!fPubUriRootSite.endsWith("/")) fPubUriRootSite.concat("/"); 
     284                                //On vérifie le slash de début pour que ce soit une URI (pas un path) 
     285                                if (!fPubUriRootSite.startsWith("/")) "/".concat(fPubUriRootSite); 
     286                        } 
     287                        xCopyPubFolder2Dest(fPubRoot.hFindSource(fPubUriRootSite), ""); 
     288 
     289                        wTreatStackPages(); 
     290                } finally { 
     291                        //Resets divers 
     292                        fDestUriTreatedInCo.clear(); 
     293                        fSrcFilesCopiedInRes.clear(); 
     294                        fPubFilesCopied.clear(); 
     295                } 
     296        } 
     297 
     298        /** 
     299         * Format de pUrlLogique :  
     300         * <ul> 
     301         * <li><b>src=XXXXX;dst=YYYYYY;transform=ZZZZZ </b>. Le paramètre 'transform' doit toujours être 
     302         * le dernier. La dst doit être un path qui sera évaluée relativement à <code>fDestFolderCo</code>. 
     303         * Elle ne doit donc pas commencer par un "/". 
     304         * <li><b>src=XXXXX;transform=ZZZZZ</b>. Si aucune dst n'est spécifiée, une destUrl est calculée automatiquement. 
     305         * </ul> 
     306         *  
     307         * @see com.scenari.m.ge.generateur.IGenerator#copyXxxPath2DestUri(java.lang.String, 
     308         *      com.scenari.m.co.dialog.IHDialog, Object) 
     309         */ 
     310        public String copyXxxPath2DestUri(String pUrlLogique, IHDialog pDialog, Object pOwner) throws Exception { 
     311                if (pUrlLogique == null) return ""; 
     312                try { 
     313 
     314                        String vUrlSrc = null; 
     315                        IHSource vSrc = null; 
     316                        String vDestUri = null; 
     317                        IHSource vDst = null; 
     318 
     319                        int vIdx = pUrlLogique.indexOf("dst="); 
     320                        if (vIdx < 0) { 
     321                                vDestUri = xCopySrcPath2DestUriNoDst(pUrlLogique, pDialog, pOwner); 
     322                        } else { 
     323                                int vIdx2 = pUrlLogique.indexOf(';', vIdx); 
     324                                vDestUri = transformNameWithOneExt(HCharSeqUtil.stringWithoutAccent((vIdx2 > 0) ? pUrlLogique.substring(vIdx + 4, vIdx2) : pUrlLogique.substring(vIdx + 4)).toString()); 
     325 
     326                                //Calcul de la destination 
     327                                vDst = fDestFolderCo.hFindSource(vDestUri); 
     328                                vDestUri = vDst.hGetUri(); 
     329 
     330                                //URL Déjà exporté ? 
     331                                if (fDestUriTreatedInCo.contains(vDestUri)) { 
     332                                        //Cette ressource a déjà été exportée au cours de cette génération 
     333                                        return vDestUri; 
     334                                } else { 
     335                                        //Recherche de la source 
     336                                        vIdx = pUrlLogique.indexOf("src="); 
     337                                        if (vIdx < 0) { throw new Exception("Les paramètres pour l'export d'une ressource ne spécifie pas de 'src' : " + pUrlLogique); } 
     338                                        vIdx2 = pUrlLogique.indexOf(';', vIdx); 
     339                                        vUrlSrc = (vIdx2 > 0) ? pUrlLogique.substring(vIdx + 4, vIdx2) : pUrlLogique.substring(vIdx + 4); 
     340 
     341                                        //Résolution de l'URL SRC 
     342                                        IXxxUri pXxxUri = resolveXxxPath(vUrlSrc, pDialog, pOwner); 
     343                                        vSrc = getSourceFromXxxUri(pXxxUri, pDialog); 
     344 
     345                                        if (vSrc.hGetStatus() == IHSourceElem.STATUS_NONE) { 
     346                                                //Src nulle, on sort 
     347                                                return ""; 
     348                                        } 
     349 
     350                                        //Ajout à liste des ressources traitées 
     351                                        fDestUriTreatedInCo.add(vDestUri); 
     352 
     353                                        //Eval d'une transformation 
     354                                        vIdx = pUrlLogique.indexOf("transform="); 
     355                                        if (vIdx < 0) { 
     356                                                //Pas de transformation, on copie simplement la ressource. 
     357                                                try { 
     358                                                        vDst.hCopyFrom(vSrc); 
     359                                                } catch (Exception e) { 
     360                                                        HLogMgr.hAddMessage(e, "Echec à la copie de la ressource '" + pUrlLogique + "' d'Url '" + vUrlSrc + "' dans " + pDialog); 
     361                                                        wAddTraceLogMessage(IHLogMessage.TYPE_WARNING, HLogMgr.hGetMessage(e)); 
     362                                                        try { 
     363                                                                vDst.hRemove(); 
     364                                                        } catch (Exception ee) { 
     365                                                        } 
     366                                                } 
     367                                        } else { 
     368                                                //On a une transformation 
     369                                                HTransformParams vTransform = HTransformParams.hNewParamsTransformByQueryString(pUrlLogique.substring(vIdx), null); 
     370                                                IHStream vStream = vSrc.hTransform(vTransform); 
     371                                                if (vStream == null) throw HLogMgr.hNewException("La transformation '" + vTransform.toString() + "' est impossible ou n'existe pas."); 
     372                                                try { 
     373                                                        OutputStream vOutputStream = vDst.hGetOutputStream(); 
     374                                                        try { 
     375                                                                vStream.hWriteIn(vOutputStream); 
     376                                                        } finally { 
     377                                                                if (vOutputStream != null) { 
     378                                                                        vOutputStream.close(); 
     379                                                                } 
     380                                                        } 
     381                                                } finally { 
     382                                                        if (vStream != null) { 
     383                                                                vStream.hClose(); 
     384                                                        } 
     385                                                } 
     386                                        } 
     387                                } 
     388                        } 
     389                        return vDestUri; 
     390                } catch (Exception e) { 
     391                        HLogMgr.hAddMessage(e, "Echec à la transformation de la ressource '" + pUrlLogique + "' dans " + pDialog + "."); 
     392                        wAddTraceLogMessage(IHLogMessage.TYPE_WARNING, HLogMgr.hGetMessage(e)); 
     393                } 
     394                return ""; 
     395        } 
     396 
     397        /** 
     398         * Copie une ressource avec aucune dst de spécifiée qui doit donc être calculée automatiquemet. 
     399         * Ces ressources sont copiées dans le dossier des mutableDst. 
     400         */ 
     401        protected String xCopySrcPath2DestUriNoDst(String pUrlLogique, IHDialog pDialog, Object pOwner) throws Exception { 
     402                //Recherche de la source 
     403                int vIdx = pUrlLogique.indexOf("src="); 
     404                if (vIdx < 0) { throw new Exception("Les paramètres pour l'export d'une ressource ne spécifie pas de 'src' : " + pUrlLogique); } 
     405                int vIdx2 = pUrlLogique.indexOf(';', vIdx); 
     406                String vUrlSrc = (vIdx2 > 0) ? pUrlLogique.substring(vIdx + 4, vIdx2) : pUrlLogique.substring(vIdx + 4); 
     407 
     408                //Résolution de l'URL SRC 
     409                IXxxUri pXxxUri = resolveXxxPath(vUrlSrc, pDialog, pOwner); 
     410 
     411                //Eval d'une transformation 
     412                HTransformParams vTransform = null; 
     413                vIdx = pUrlLogique.indexOf("transform="); 
     414                if (vIdx >= 0) { 
     415                        //On a une transformation 
     416                        vTransform = HTransformParams.hNewParamsTransformByQueryString(pUrlLogique.substring(vIdx), null); 
     417                } 
     418 
     419                KeyRes vKeyRes = new KeyRes(pXxxUri, vTransform != null ? vTransform.hGetQueryStringFromThis() : null); 
     420 
     421                //Si la key existe déjà, on retourne le destUri déjà créé 
     422                String vDestUri = (String) fSrcFilesCopiedInRes.get(vKeyRes); 
     423                if (vDestUri != null) return vDestUri; 
     424 
     425                IHSource vSrc = getSourceFromXxxUri(pXxxUri, pDialog); 
     426                if (vSrc.hGetStatus() == IHSourceElem.STATUS_NONE) { 
     427                        //Src nulle, on sort 
     428                        return ""; 
     429                } 
     430 
     431                IHSource vDst = null; 
     432 
     433                //On construit une 1ere destination. 
     434                if (vTransform == null) { 
     435                        vDst = fDestFolderMutableDst.hFindSource(transformNameWithOneExt(HCharSeqUtil.stringWithoutAccent(vSrc.hGetName()).toString())); 
     436                } else { 
     437                        IHTransformer vTr = HTransformerMgr.hGetTransformerMgr(null).hGetTransformer(vTransform); 
     438                        String vExt = null; 
     439                        if (vTr != null) { 
     440                                vExt = vTr.hGetFileExtension(vTransform); 
     441                        } else { 
     442                                vExt = vTransform.hGetValueParam("fileExt"); 
     443                        } 
     444                        if (vExt != null && vExt.length() == 0) vExt = null; 
     445                        String vFileName = vSrc.hGetName(); 
     446                        if (vExt != null) { 
     447                                //On construit l'URL de destination. 
     448                                if (vExt != null && !vFileName.endsWith(vExt)) { 
     449                                        //Une extension différente est prévue par une transformation. 
     450                                        int vOffsExt = vFileName.lastIndexOf('.'); 
     451                                        if (vOffsExt > 0) { 
     452                                                vFileName = vFileName.substring(0, vOffsExt).concat(vExt); 
     453                                        } else { 
     454                                                vFileName = vFileName.concat(vExt); 
     455                                        } 
     456                                } 
     457                        } 
     458                        vDst = fDestFolderMutableDst.hFindSource(transformNameWithOneExt(HCharSeqUtil.stringWithoutAccent(vFileName).toString())); 
     459                } 
     460 
     461                //On s'assure de l'unicité de la dest 
     462                vDst = xLookForFreeDst(vDst); 
     463 
     464                fSrcFilesCopiedInRes.put(vKeyRes, vDst.hGetUri()); 
     465                if (vTransform == null) { 
     466                        //Pas de transformation, on copie simplement la ressource. 
     467                        try { 
     468                                vDst.hCopyFrom(vSrc); 
     469                        } catch (Exception e) { 
     470                                HLogMgr.hAddMessage(e, "Echec à la copie de la ressource '" + pUrlLogique + "' d'Url '" + vUrlSrc + "' dans " + pDialog); 
     471                                wAddTraceLogMessage(IHLogMessage.TYPE_WARNING, HLogMgr.hGetMessage(e)); 
     472                                try { 
     473                                        vDst.hRemove(); 
     474                                } catch (Exception ee) { 
     475                                } 
     476                        } 
     477                } else { 
     478                        //On a une transformation 
     479                        IHStream vStream = vSrc.hTransform(vTransform); 
     480                        if (vStream == null) throw HLogMgr.hNewException("La transformation '" + vTransform.toString() + "' est impossible ou n'existe pas."); 
     481                        try { 
     482                                OutputStream vOutputStream = vDst.hGetOutputStream(); 
     483                                try { 
     484                                        vStream.hWriteIn(vOutputStream); 
     485                                } finally { 
     486                                        if (vOutputStream != null) vOutputStream.close(); 
     487                                } 
     488                        } finally { 
     489                                if (vStream != null) vStream.hClose(); 
     490                        } 
     491                } 
     492 
     493                return vDst.hGetUri(); 
     494        } 
    491495 
    492496        protected IHSource xLookForFreeDst(IHSource pDst) throws Exception { 
    493497                if (pDst.hGetStatus() != IHSource.STATUS_NONE) { 
    494             //Source existe déjà; on cherche une déclinaison. 
    495             String vPrefix = pDst.hGetName(); 
    496             String vSuffix = ""; 
    497             int vPoint = vPrefix.lastIndexOf('.'); 
    498             if (vPoint > 0) { 
    499                 vSuffix = vPrefix.substring(vPoint); 
    500                 vPrefix = vPrefix.substring(0, vPoint); 
    501             } 
    502             int vCount = 1; 
    503             do { 
    504                 //pDst = fDestFolderMutableDst.hFindSource(vPrefix + '_' + vCount + vSuffix); 
    505                 pDst = pDst.hFindSource("../" + vPrefix + '_' + vCount + vSuffix); 
    506                 vCount++; 
    507             } while (pDst.hGetStatus() != IHSource.STATUS_NONE); 
    508         } 
     498                        //Source existe déjà; on cherche une déclinaison. 
     499                        String vPrefix = pDst.hGetName(); 
     500                        String vSuffix = ""; 
     501                        int vPoint = vPrefix.lastIndexOf('.'); 
     502                        if (vPoint > 0) { 
     503                                vSuffix = vPrefix.substring(vPoint); 
     504                                vPrefix = vPrefix.substring(0, vPoint); 
     505                        } 
     506                        int vCount = 1; 
     507                        do { 
     508                                //pDst = fDestFolderMutableDst.hFindSource(vPrefix + '_' + vCount + vSuffix); 
     509                                pDst = pDst.hFindSource("../" + vPrefix + '_' + vCount + vSuffix); 
     510                                vCount++; 
     511                        } while (pDst.hGetStatus() != IHSource.STATUS_NONE); 
     512                } 
    509513                return pDst; 
    510514        } 
    511515 
    512     /** 
    513     * Dans un webGenerator, l'extension est donnée par le modèle de page. 
    514     * L'URL de la page fournie par l'agent ne doit pas contenir d'extension. 
    515     * L'agent peut ne pas fournir d'URL, une URL aléatoire est alors générée. 
    516     *  
    517     * @see com.scenari.m.ge.generateur.IGenerator#wNewDynamicFile(com.scenari.m.ge.agent.IWADialogExport, com.scenari.m.ge.generateur.IFileModel) 
    518     */ 
    519     public IDynamicFile wNewDynamicFile(IWADialogExport pDialog, IFileModel pFileModel) throws Exception { 
    520         DynamicFile vResult = new DynamicFile(); 
    521         vResult.fFileModel = pFileModel; 
    522  
    523         //Path prédéfini par l'agent (sans l'extension) 
    524         String vPathFile = pDialog.hGetUrlPageRes(); 
    525          
    526         //Calcul de l'extension et si folder ou fichier.  
    527         String vExt = pFileModel.hGetExtension(pDialog); 
    528         boolean vIsFolder = false; 
    529         if (vExt == null) { 
    530             vExt = ""; 
    531         } else { 
    532             vIsFolder = vExt.startsWith("/"); 
    533         } 
    534         if (vPathFile == null) { 
    535                 //Calcul auto d'un path 
    536             String vNameFile = pDialog.hGetAgent().hGetComposant().hGetDocSource().hGetName(); 
    537             int vLastPoint = vNameFile.lastIndexOf('.'); 
    538             if (vLastPoint > 0) vNameFile = vNameFile.substring(0, vLastPoint); 
    539             if (!vIsFolder) { 
    540                 vNameFile = vNameFile.concat(vExt); 
    541                 IHSource vFile = fDestFolderCo.hFindSource(transformNameWithOneExt(HCharSeqUtil.stringWithoutAccent(vNameFile).toString())); 
    542                 vFile = xLookForFreeDst(vFile); 
    543                 vFile.hNewFile(); 
    544                 vResult.fDocument = vFile; 
    545             } else { 
    546                 //L'extension spécifie qu'il faut créer un dossier. 
    547                 IHSource vFile = fDestFolderCo.hFindSource(HCharSeqUtil.stringWithoutAccent(vNameFile).toString()); 
    548                 vFile = xLookForFreeDst(vFile); 
    549                 vFile.hNewFolder(); 
    550                 vResult.fDocument = vFile.hFindSource(vExt.substring(1)); 
    551             } 
    552         } else { 
    553             int vLastPoint = vPathFile.lastIndexOf('.'); 
    554             if (vLastPoint > 0 && vLastPoint > vPathFile.lastIndexOf('/')) { 
    555                 //Le path spécifié possède une extension 
    556                 if(vIsFolder) { 
    557                         //La cible est un dossier, on vire l'extension 
    558                         vPathFile = vPathFile.substring(0, vLastPoint); 
    559                 } else { 
    560                         if(vExt != null && vExt.length()>0) { 
    561                                 //On l'élimine si le modèle spéciie une extension 
    562                                 vPathFile = vPathFile.substring(0, vLastPoint) + vExt; 
    563                         } 
    564                 } 
    565             } 
    566             vResult.fDocument = xLookForFreeDst(fDestFolderCo.hFindSource(transformNameWithOneExt(HCharSeqUtil.stringWithoutAccent(vPathFile).toString()))); 
    567             if(vIsFolder) { 
    568                 vResult.fDocument.hNewFolder(); 
    569                 vResult.fDocument = vResult.fDocument.hFindSource(vExt.substring(1)); 
    570             } else { 
    571                 vResult.fDocument.hNewFile(); 
    572             } 
    573         } 
    574  
    575         return vResult; 
    576     } 
    577  
    578     /** 
    579     * Traitement de tous les fichiers d'un dossier en tant que fichiers WebMacro. Utiliser pour traiter les fichiers de 
    580     * l'IHM (non multisupports). 
    581     */ 
    582     protected void xCopyPubFolder2Dest(IHSource pPubFolder, String pFolderDest) throws java.lang.Exception { 
    583         List vChilds = new ArrayList(); 
    584         pPubFolder.hListSourceChilds(vChilds); 
    585         for (int i = 0; i < vChilds.size(); i++) { 
    586             fCurrentPubFile = (IHSource) vChilds.get(i); 
    587             String vUri = fCurrentPubFile.hGetUri(); 
    588             String vName = vUri.substring(vUri.lastIndexOf('/') + 1); 
    589             fCurrentDestUri = new StringBuffer(pFolderDest.length() + 1 + vName.length()).append(pFolderDest).append('/').append(vName).toString(); 
    590             if (vName.charAt(0) != '_') { 
    591                 //On exclut tous les fichiers ou dossiers commencant par "_". 
    592                 if (fCurrentPubFile.hGetStatus() == IHSource.STATUS_FOLDER) { 
    593                     //On traite le dossier récursivement 
    594                     xCopyPubFolder2Dest(fCurrentPubFile, fCurrentDestUri); 
    595                 } else { 
    596                     //On traite le fichier. 
    597                     xCopyPubFile2Dest(); 
    598                 } 
    599             } 
    600         } 
    601     } 
    602  
    603     /* (non-Javadoc) 
    604     * @see com.scenari.m.ge.generateur.GeneratorBase#wGetScriptableFunctions() 
    605     */ 
    606     public IScriptableFunctions wGetScriptableFunctions() { 
    607         if (fScriptableFunctions == null) fScriptableFunctions = new ScriptableFunctionsWm(); 
    608         return fScriptableFunctions; 
    609     } 
    610  
    611     /** 
    612     * Traitement du fichier d'IHM en cours. les champs fUrlExportEncours et fUrlInSourceEncours définissent le fichier 
    613     * à traiter. Méthode utilisée par wExportFolderIhm(). 
    614     */ 
    615     protected void xCopyPubFile2Dest() throws java.lang.Exception { 
    616  
    617         //        long vLastModifSrc = fCurrentPubFile.hGetLastModif(); 
    618         //        if (vLastModifSrc == IHSourceElem.LAST_MODIF_UNKNOWN && fCurrentPubFile.hGetStatus() != IHSourceElem.STATUS_FILE) { 
    619         //            //On exclu si le fichier n'existe pas (peut arriver en multi-support) 
    620         //            return; 
    621         //        } 
    622  
    623         //On traite le fichier. 
    624         if (fCurrentDestUri.endsWith(EXT_WM)) { 
    625  
    626             //Url d destination 
    627             fCurrentDestUri = fCurrentDestUri.substring(0, fCurrentDestUri.length() - EXT_WM.length()); 
    628  
    629             //Controle si l'export a déjà été réalisé et Suppression de l'extension WebMacro du fichier d'export 
    630             WFileIhmExported vFile = wIsFileAlreadyExported(fCurrentPubFile.hGetUri(), fCurrentDestUri); 
    631             if (vFile != null) { 
    632                 vFile.fReexported = true; 
    633             } 
    634  
    635             //Fichier WebMacro, on execute. 
    636             //wAddTrace("<exportwebmacro url=\"" + fUrlExportEncours + "\"/>"); 
    637  
    638             //Préparation du context, du template et de l'output 
    639             if (fBroker == null) { 
    640                 fBroker = Broker.getBroker(); 
    641             } 
    642             Context vContext = new Context(fBroker); 
    643             vContext.put(IData.NAMEVARINSCRIPT_DIALOG, fCurrentDialog); 
    644             vContext.put(IAgentData.NAMEVARINSCRIPT_AGENT, ((IWADialog) fCurrentDialog).hGetAgent()); 
    645             vContext.put(IScriptableFunctions.NAMEVARINSCRIPT_GENERATOR_UTILS, wGetScriptableFunctions()); 
    646  
    647             Template vTemplate = (Template) fTemplates.get(fCurrentPubFile.hGetUri()); 
    648             if (vTemplate == null) { 
    649                 String vUrlFile = fCurrentPubFile.hGetUrlFileFormat(); 
    650                 if (vUrlFile == null) { 
    651                     //Impossible d'accéder au fichier wm par l'API File avec ce docserveur : on accède par stream. 
    652                     Reader vReader = fCurrentPubFile.hGetReader(); 
    653                     if (vReader != null) { 
    654                         vTemplate = new StreamTemplate(fBroker, vReader); 
    655                         vTemplate.setName(fCurrentPubFile.hGetUri()); 
    656                         fTemplates.put(fCurrentPubFile.hGetUri(), vTemplate); 
    657                     } 
    658                 } else { 
    659                     vTemplate = new FileTemplate(fBroker, new File(vUrlFile), xGetWmSourceEncoding()); 
    660                     vTemplate.setName(fCurrentPubFile.hGetUri()); 
    661                     fTemplates.put(fCurrentPubFile.hGetUri(), vTemplate); 
    662                 } 
    663             } 
    664             if (vTemplate != null) { 
    665                 //On crée la sortie 
    666                 FastWriter vWriterEncours = fBroker.getFastWriter(fDestRoot.hFindElemByPath(fCurrentDestUri).hGetOutputStream(), xGetWmDstEncoding()); 
    667                 //Exécution du template 
    668                 try { 
    669                     vTemplate.write(vWriterEncours, vContext); 
    670                 } catch (PropertyException e) { 
    671                     if (e.getCause() != null && (e.getCause() instanceof Exception)) { 
    672                         HLogMgr.hAddMessage(e.getCause(), e.getMessage()); 
    673                         throw (Exception) e.getCause(); 
    674                     } else { 
    675                         throw e; 
    676                     } 
    677                 } finally { 
    678                     vWriterEncours.close(); 
    679                 } 
    680             } 
    681         } 
    682  
    683         // 
    684         else { 
    685             //Fichier avec extension inconnue, on recopie. 
    686             //wAddTrace("<copiefichier url=\"" + fUrlExportEncours + "\"/>"); 
    687             long vLastModifSrc = fCurrentPubFile.hGetLastModif(); 
    688             WFileIhmExported vFile = wIsFileAlreadyExported(fCurrentPubFile.hGetUri(), fCurrentDestUri); 
    689             if (vFile == null) { 
    690                 fDestRoot.hFindSource(fCurrentDestUri).hCopyFrom(fCurrentPubFile); 
    691             } else { 
    692                 if (vLastModifSrc == IHSourceElem.LAST_MODIF_UNKNOWN || vLastModifSrc != vFile.fLastModifSrc) { 
    693                     fDestRoot.hFindSource(fCurrentDestUri).hCopyFrom(fCurrentPubFile); 
    694                 } 
    695                 vFile.fReexported = true; 
    696             } 
    697             //On ajoute ce fichier dans la liste des fichiers traités 
    698             wAddFileExported(fCurrentPubFile.hGetUri(), vLastModifSrc, fCurrentDestUri); 
    699         } 
    700     } 
    701  
    702     /** 
    703     * En cas de translate du dossier site, l'url est transformée ; en cas  
    704     * de translate en dehors, le fichier est recopié dans le dossier des  
    705     * mutableDst du site. 
    706     *  
    707     * TODO Pour les fichiers copiés, intégrer un filtre à la copie pour résoudre les url intégrées dans le fichier. 
    708     *  
    709     * @see com.scenari.m.ge.generateur.IGenerator#translatePubUri2DestUri(String) 
    710     *  
    711     */ 
    712     public String translatePubUri2DestUri(String pPubUri) throws Exception { 
    713         // ATTENTION : fPubUriRootSite doit se terminer par "/" pour que le test soit fiable. 
    714         //voir l'initialisation dans xGenerate() 
    715         if (pPubUri.startsWith(fPubUriRootSite)) { 
    716             //Ressource du site déjà copiée. 
    717             return pPubUri.substring(fPubUriRootSite.length() - 1); 
    718         } else { 
    719             //On demande une PubUri en dehors du site pour obtenir une DestUri  
    720             //-> on le veut dans le site généré, donc on recopie cette ressource dans  
    721             //le site de destination. 
    722                  
    723                 //Erreur, on ne va recopier tout le ui.doss dans les res. 
    724                 if(pPubUri.length()==0 || pPubUri.equals("/")) return ""; 
    725                  
    726             String vDestUri = (String) fPubFilesCopied.get(pPubUri); 
    727             if (vDestUri != null) return vDestUri; 
    728             vDestUri = ""; 
    729  
    730             //On check la source 
    731             IHSource vPubFile = fPubRoot.hFindSource(pPubUri); 
    732             if (vPubFile.hGetStatus() != IHSource.STATUS_NONE) { 
    733                 //On cherche un nom de destniation 
    734                 String vName = vPubFile.hGetName(); 
    735                 IHSource vDestFile = fDestFolderMutableDst.hFindSource(vName); 
    736                 if (vDestFile.hGetStatus() != IHSource.STATUS_NONE) { 
    737                     String vExt = ""; 
    738                     int vLastPoint = vName.indexOf('.', 1); 
    739                     if (vLastPoint > 0) { 
    740                         vExt = vName.substring(vLastPoint); 
    741                         vName = vName.substring(0, vLastPoint); 
    742                     } 
    743                     do { 
    744                         vDestFile = fDestFolderMutableDst.hFindSource(vName + '_' + xEncodeId((int) (Math.random() * 456975)) + vExt); //4 caractères a-z aléatoires 
    745                     } while (vDestFile.hGetStatus() != IHSourceElem.STATUS_NONE); 
    746                 } 
    747                 vDestFile.hCopyFrom(vPubFile); 
    748                 vDestUri = vDestFile.hGetUri(); 
    749             } 
    750             fPubFilesCopied.put(pPubUri, vDestUri); 
    751             return vDestUri; 
    752         } 
    753     } 
    754  
    755     /** 
    756     * Dans cet implémentation on élimine par défaut le 1er dossier correpondant 
    757     * au code de l'atelier qui est inutile pour créer une DestUri unique. 
    758     */ 
    759     public String translateSrcUri2DestUri(String pUriSource) throws Exception { 
    760         String vResult = pUriSource; 
    761  
    762         //Exclusion des 1ers dossiers 
    763         if (fSrcUri2DestUriExcludeFolders < 0) { 
    764             //Valeur par défaut. 
    765             fSrcUri2DestUriExcludeFolders = 1; 
    766             String vProp = (String) getProperty(KEYPROPERTY_BUILDURIFROMSOURCE_EXCLUDE); 
    767             if (vProp != null) { 
    768                 try { 
    769                     fSrcUri2DestUriExcludeFolders = Integer.parseInt(vProp); 
    770                 } catch (Exception e) { 
    771                     // 
    772                 } 
    773             } 
    774         } 
    775  
    776         int vIdx = (vResult.startsWith("/")) ? 1 : 0; 
    777         for (int i = 0; i < fSrcUri2DestUriExcludeFolders; i++) { 
    778             vIdx = vResult.indexOf('/', vIdx) + 1; 
    779         } 
    780         if (vIdx > 0) vResult = vResult.substring(vIdx); 
    781  
    782         //Elimination des extensions du nom du fichier en supprimant les ".". 
    783         /*        vIdx = vResult.lastIndexOf('/'); 
    784         int vPointIdx = vResult.indexOf('.', vIdx); 
    785         if (vPointIdx > 0) { 
    786          StringBuffer vBuf = new StringBuffer(vResult.length() - 1); 
    787         for (int i = 0; i < vPointIdx; i++) { 
    788         vBuf.append(vResult.charAt(i)); 
    789         } 
    790         for (int i = vPointIdx + 1; i < vResult.length(); i++) { 
    791         char vChar = vResult.charAt(i); 
    792         if (vChar != '.') vBuf.append(vChar); 
    793         } 
    794         vResult = vBuf.toString(); 
    795         } 
    796         */ 
    797         return vResult; 
    798     } 
    799  
    800     /** 
    801     * On pose qu'un DestPath est en relatif à DestFolderCo. 
    802     * Peut-etre envisager un principe de prefix comme pour l'espace source. 
    803     */ 
    804     public String resolveDestPath2DestUri(String pDestPath) throws Exception { 
    805         if(pDestPath == null || pDestPath.length()==0) return ""; 
    806         return fDestFolderCo.hFindSource(pDestPath).hGetUri(); 
    807     } 
    808  
    809     /* (non-Javadoc) 
    810     * @see com.scenari.m.ge.generateur.HGenerateur#wCreeScripter() 
    811     */ 
    812     public IScripter wNewScripter() throws Exception { 
    813         IScripter vResult = new ScripterUrl(); 
    814         vResult.init(this); 
    815         return vResult; 
    816  
    817     } 
    818  
    819     protected String xGetWmSourceEncoding() { 
    820         String vProp = (String) getProperty(KEYPROPERTY_SOURCE_WM_ENCODING); 
    821         return (vProp != null) ? vProp : "ISO-8859-1"; 
    822     } 
    823  
    824     protected String xGetWmDstEncoding() { 
    825         String vProp = (String) getProperty(KEYPROPERTY_DEST_WM_ENCODING); 
    826         return (vProp != null) ? vProp : "ISO-8859-1"; 
    827     } 
    828  
    829     public String getCurrentDestUri() { 
    830         return fCurrentDestUri; 
    831     } 
     516        /** 
     517        * Dans un webGenerator, l'extension est donnée par le modèle de page. 
     518        * L'URL de la page fournie par l'agent ne doit pas contenir d'extension. 
     519        * L'agent peut ne pas fournir d'URL, une URL aléatoire est alors générée. 
     520        *  
     521        * @see com.scenari.m.ge.generateur.IGenerator#wNewDynamicFile(com.scenari.m.ge.agent.IWADialogExport, com.scenari.m.ge.generateur.IFileModel) 
     522        */ 
     523        public IDynamicFile wNewDynamicFile(IWADialogExport pDialog, IFileModel pFileModel) throws Exception { 
     524                DynamicFile vResult = new DynamicFile(); 
     525                vResult.fFileModel = pFileModel; 
     526 
     527                //Path prédéfini par l'agent (sans l'extension) 
     528                String vPathFile = pDialog.hGetUrlPageRes(); 
     529 
     530                //Calcul de l'extension et si folder ou fichier.  
     531                String vExt = pFileModel.hGetExtension(pDialog); 
     532                boolean vIsFolder = false; 
     533                if (vExt == null) { 
     534                        vExt = ""; 
     535                } else { 
     536                        vIsFolder = vExt.startsWith("/"); 
     537                } 
     538                if (vPathFile == null) { 
     539                        //Calcul auto d'un path 
     540                        String vNameFile = pDialog.hGetAgent().hGetComposant().hGetDocSource().hGetName(); 
     541                        int vLastPoint = vNameFile.lastIndexOf('.'); 
     542                        if (vLastPoint > 0) vNameFile = vNameFile.substring(0, vLastPoint); 
     543                        if (!vIsFolder) { 
     544                                vNameFile = vNameFile.concat(vExt); 
     545                                IHSource vFile = fDestFolderCo.hFindSource(transformNameWithOneExt(HCharSeqUtil.stringWithoutAccent(vNameFile).toString())); 
     546                                vFile = xLookForFreeDst(vFile); 
     547                                vFile.hNewFile(); 
     548                                vResult.fDocument = vFile; 
     549                        } else { 
     550                                //L'extension spécifie qu'il faut créer un dossier. 
     551                                IHSource vFile = fDestFolderCo.hFindSource(HCharSeqUtil.stringWithoutAccent(vNameFile).toString()); 
     552                                vFile = xLookForFreeDst(vFile); 
     553                                vFile.hNewFolder(); 
     554                                vResult.fDocument = vFile.hFindSource(vExt.substring(1)); 
     555                        } 
     556                } else { 
     557                        int vLastPoint = vPathFile.lastIndexOf('.'); 
     558                        if (vLastPoint > 0 && vLastPoint > vPathFile.lastIndexOf('/')) { 
     559                                //Le path spécifié possède une extension 
     560                                if (vIsFolder) { 
     561                                        //La cible est un dossier, on vire l'extension 
     562                                        vPathFile = vPathFile.substring(0, vLastPoint); 
     563                                } else { 
     564                                        if (vExt != null && vExt.length() > 0) { 
     565                                                //On l'élimine si le modèle spéciie une extension 
     566                                                vPathFile = vPathFile.substring(0, vLastPoint) + vExt; 
     567                                        } 
     568                                } 
     569                        } 
     570                        vResult.fDocument = xLookForFreeDst(fDestFolderCo.hFindSource(transformNameWithOneExt(HCharSeqUtil.stringWithoutAccent(vPathFile).toString()))); 
     571                        if (vIsFolder) { 
     572                                vResult.fDocument.hNewFolder(); 
     573                                vResult.fDocument = vResult.fDocument.hFindSource(vExt.substring(1)); 
     574                        } else { 
     575                                vResult.fDocument.hNewFile(); 
     576                        } 
     577                } 
     578 
     579                return vResult; 
     580        } 
     581 
     582        /** 
     583        * Traitement de tous les fichiers d'un dossier en tant que fichiers WebMacro. Utiliser pour traiter les fichiers de 
     584        * l'IHM (non multisupports). 
     585        */ 
     586        protected void xCopyPubFolder2Dest(IHSource pPubFolder, String pFolderDest) throws java.lang.Exception { 
     587                List vChilds = new ArrayList(); 
     588                pPubFolder.hListSourceChilds(vChilds); 
     589                for (int i = 0; i < vChilds.size(); i++) { 
     590                        fCurrentPubFile = (IHSource) vChilds.get(i); 
     591                        String vUri = fCurrentPubFile.hGetUri(); 
     592                        String vName = vUri.substring(vUri.lastIndexOf('/') + 1); 
     593                        fCurrentDestUri = new StringBuilder(pFolderDest.length() + 1 + vName.length()).append(pFolderDest).append('/').append(vName).toString(); 
     594                        if (vName.charAt(0) != '_') { 
     595                                //On exclut tous les fichiers ou dossiers commencant par "_". 
     596                                if (fCurrentPubFile.hGetStatus() == IHSource.STATUS_FOLDER) { 
     597                                        //On traite le dossier récursivement 
     598                                        xCopyPubFolder2Dest(fCurrentPubFile, fCurrentDestUri); 
     599                                } else { 
     600                                        //On traite le fichier. 
     601                                        xCopyPubFile2Dest(); 
     602                                } 
     603                        } 
     604                } 
     605        } 
     606 
     607        /* (non-Javadoc) 
     608        * @see com.scenari.m.ge.generateur.GeneratorBase#wGetScriptableFunctions() 
     609        */ 
     610        public IScriptableFunctions wGetScriptableFunctions() { 
     611                if (fScriptableFunctions == null) fScriptableFunctions = new ScriptableFunctionsWm(); 
     612                return fScriptableFunctions; 
     613        } 
     614 
     615        /** 
     616        * Traitement du fichier d'IHM en cours. les champs fUrlExportEncours et fUrlInSourceEncours définissent le fichier 
     617        * à traiter. Méthode utilisée par wExportFolderIhm(). 
     618        */ 
     619        protected void xCopyPubFile2Dest() throws java.lang.Exception { 
     620 
     621                //        long vLastModifSrc = fCurrentPubFile.hGetLastModif(); 
     622                //        if (vLastModifSrc == IHSourceElem.LAST_MODIF_UNKNOWN && fCurrentPubFile.hGetStatus() != IHSourceElem.STATUS_FILE) { 
     623                //            //On exclu si le fichier n'existe pas (peut arriver en multi-support) 
     624                //            return; 
     625                //        } 
     626 
     627                //On traite le fichier. 
     628                if (fCurrentDestUri.endsWith(EXT_WM)) { 
     629 
     630                        //Url d destination 
     631                        fCurrentDestUri = fCurrentDestUri.substring(0, fCurrentDestUri.length() - EXT_WM.length()); 
     632 
     633                        //Controle si l'export a déjà été réalisé et Suppression de l'extension WebMacro du fichier d'export 
     634                        WFileIhmExported vFile = wIsFileAlreadyExported(fCurrentPubFile.hGetUri(), fCurrentDestUri); 
     635                        if (vFile != null) { 
     636                                vFile.fReexported = true; 
     637                        } 
     638 
     639                        //Fichier WebMacro, on execute. 
     640                        //wAddTrace("<exportwebmacro url=\"" + fUrlExportEncours + "\"/>"); 
     641 
     642                        //Préparation du context, du template et de l'output 
     643                        if (fBroker == null) { 
     644                                fBroker = Broker.getBroker(); 
     645                        } 
     646                        Context vContext = new Context(fBroker); 
     647                        vContext.put(IData.NAMEVARINSCRIPT_DIALOG, fCurrentDialog); 
     648                        vContext.put(IAgentData.NAMEVARINSCRIPT_AGENT, ((IWADialog) fCurrentDialog).hGetAgent()); 
     649                        vContext.put(IScriptableFunctions.NAMEVARINSCRIPT_GENERATOR_UTILS, wGetScriptableFunctions()); 
     650 
     651                        Template vTemplate = (Template) fTemplates.get(fCurrentPubFile.hGetUri()); 
     652                        if (vTemplate == null) { 
     653                                String vUrlFile = fCurrentPubFile.hGetUrlFileFormat(); 
     654                                if (vUrlFile == null) { 
     655                                        //Impossible d'accéder au fichier wm par l'API File avec ce docserveur : on accède par stream. 
     656                                        Reader vReader = fCurrentPubFile.hGetReader(); 
     657                                        if (vReader != null) { 
     658                                                vTemplate = new StreamTemplate(fBroker, vReader); 
     659                                                vTemplate.setName(fCurrentPubFile.hGetUri()); 
     660                                                fTemplates.put(fCurrentPubFile.hGetUri(), vTemplate); 
     661                                        } 
     662                                } else { 
     663                                        vTemplate = new FileTemplate(fBroker, new File(vUrlFile), xGetWmSourceEncoding()); 
     664                                        vTemplate.setName(fCurrentPubFile.hGetUri()); 
     665                                        fTemplates.put(fCurrentPubFile.hGetUri(), vTemplate); 
     666                                } 
     667                        } 
     668                        if (vTemplate != null) { 
     669                                //On crée la sortie 
     670                                FastWriter vWriterEncours = fBroker.getFastWriter(fDestRoot.hFindElemByPath(fCurrentDestUri).hGetOutputStream(), xGetWmDstEncoding()); 
     671                                //Exécution du template 
     672                                try { 
     673                                        vTemplate.write(vWriterEncours, vContext); 
     674                                } catch (PropertyException e) { 
     675                                        if (e.getCause() != null && (e.getCause() instanceof Exception)) { 
     676                                                HLogMgr.hAddMessage(e.getCause(), e.getMessage()); 
     677                                                throw (Exception) e.getCause(); 
     678                                        } else { 
     679                                                throw e; 
     680                                        } 
     681                                } finally { 
     682                                        vWriterEncours.close(); 
     683                                } 
     684                        } 
     685                } 
     686 
     687                // 
     688                else { 
     689                        //Fichier avec extension inconnue, on recopie. 
     690                        //wAddTrace("<copiefichier url=\"" + fUrlExportEncours + "\"/>"); 
     691                        long vLastModifSrc = fCurrentPubFile.hGetLastModif(); 
     692                        WFileIhmExported vFile = wIsFileAlreadyExported(fCurrentPubFile.hGetUri(), fCurrentDestUri); 
     693                        if (vFile == null) { 
     694                                fDestRoot.hFindSource(fCurrentDestUri).hCopyFrom(fCurrentPubFile); 
     695                        } else { 
     696                                if (vLastModifSrc == IHSourceElem.LAST_MODIF_UNKNOWN || vLastModifSrc != vFile.fLastModifSrc) { 
     697                                        fDestRoot.hFindSource(fCurrentDestUri).hCopyFrom(fCurrentPubFile); 
     698                                } 
     699                                vFile.fReexported = true; 
     700                        } 
     701                        //On ajoute ce fichier dans la liste des fichiers traités 
     702                        wAddFileExported(fCurrentPubFile.hGetUri(), vLastModifSrc, fCurrentDestUri); 
     703                } 
     704        } 
     705 
     706        /** 
     707        * En cas de translate du dossier site, l'url est transformée ; en cas  
     708        * de translate en dehors, le fichier est recopié dans le dossier des  
     709        * mutableDst du site. 
     710        *  
     711        * TODO Pour les fichiers copiés, intégrer un filtre à la copie pour résoudre les url intégrées dans le fichier. 
     712        *  
     713        * @see com.scenari.m.ge.generateur.IGenerator#translatePubUri2DestUri(String) 
     714        *  
     715        */ 
     716        public String translatePubUri2DestUri(String pPubUri) throws Exception { 
     717                // ATTENTION : fPubUriRootSite doit se terminer par "/" pour que le test soit fiable. 
     718                //voir l'initialisation dans xGenerate() 
     719                if (pPubUri.startsWith(fPubUriRootSite)) { 
     720                        //Ressource du site déjà copiée. 
     721                        return pPubUri.substring(fPubUriRootSite.length() - 1); 
     722                } else { 
     723                        //On demande une PubUri en dehors du site pour obtenir une DestUri  
     724                        //-> on le veut dans le site généré, donc on recopie cette ressource dans  
     725                        //le site de destination. 
     726 
     727                        //Erreur, on ne va recopier tout le ui.doss dans les res. 
     728                        if (pPubUri.length() == 0 || pPubUri.equals("/")) return ""; 
     729 
     730                        String vDestUri = (String) fPubFilesCopied.get(pPubUri); 
     731                        if (vDestUri != null) return vDestUri; 
     732                        vDestUri = ""; 
     733 
     734                        //On check la source 
     735                        IHSource vPubFile = fPubRoot.hFindSource(pPubUri); 
     736                        if (vPubFile.hGetStatus() != IHSource.STATUS_NONE) { 
     737                                //On cherche un nom de destniation 
     738                                String vName = vPubFile.hGetName(); 
     739                                IHSource vDestFile = fDestFolderMutableDst.hFindSource(vName); 
     740                                if (vDestFile.hGetStatus() != IHSource.STATUS_NONE) { 
     741                                        String vExt = ""; 
     742                                        int vLastPoint = vName.indexOf('.', 1); 
     743                                        if (vLastPoint > 0) { 
     744                                                vExt = vName.substring(vLastPoint); 
     745                                                vName = vName.substring(0, vLastPoint); 
     746                                        } 
     747                                        do { 
     748                                                vDestFile = fDestFolderMutableDst.hFindSource(vName + '_' + xEncodeId((int) (Math.random() * 456975)) + vExt); //4 caractères a-z aléatoires 
     749                                        } while (vDestFile.hGetStatus() != IHSourceElem.STATUS_NONE); 
     750                                } 
     751                                vDestFile.hCopyFrom(vPubFile); 
     752                                vDestUri = vDestFile.hGetUri(); 
     753                        } 
     754                        fPubFilesCopied.put(pPubUri, vDestUri); 
     755                        return vDestUri; 
     756                } 
     757        } 
     758 
     759        /** 
     760        * Dans cet implémentation on élimine par défaut le 1er dossier correpondant 
     761        * au code de l'atelier qui est inutile pour créer une DestUri unique. 
     762        */ 
     763        public String translateSrcUri2DestUri(String pUriSource) throws Exception { 
     764                String vResult = pUriSource; 
     765 
     766                //Exclusion des 1ers dossiers 
     767                if (fSrcUri2DestUriExcludeFolders < 0) { 
     768                        //Valeur par défaut. 
     769                        fSrcUri2DestUriExcludeFolders = 1; 
     770                        String vProp = (String) getProperty(KEYPROPERTY_BUILDURIFROMSOURCE_EXCLUDE); 
     771                        if (vProp != null) { 
     772                                try { 
     773                                        fSrcUri2DestUriExcludeFolders = Integer.parseInt(vProp); 
     774                                } catch (Exception e) { 
     775                                        // 
     776                                } 
     777                        } 
     778                } 
     779 
     780                int vIdx = (vResult.startsWith("/")) ? 1 : 0; 
     781                for (int i = 0; i < fSrcUri2DestUriExcludeFolders; i++) { 
     782                        vIdx = vResult.indexOf('/', vIdx) + 1; 
     783                } 
     784                if (vIdx > 0) vResult = vResult.substring(vIdx); 
     785 
     786                //Elimination des extensions du nom du fichier en supprimant les ".". 
     787                /*        vIdx = vResult.lastIndexOf('/'); 
     788                int vPointIdx = vResult.indexOf('.', vIdx); 
     789                if (vPointIdx > 0) { 
     790                 StringBuilder vBuf = new StringBuilder(vResult.length() - 1); 
     791                for (int i = 0; i < vPointIdx; i++) { 
     792                vBuf.append(vResult.charAt(i)); 
     793                } 
     794                for (int i = vPointIdx + 1; i < vResult.length(); i++) { 
     795                char vChar = vResult.charAt(i); 
     796                if (vChar != '.') vBuf.append(vChar); 
     797                } 
     798                vResult = vBuf.toString(); 
     799                } 
     800                */ 
     801                return vResult; 
     802        } 
     803 
     804        /** 
     805        * On pose qu'un DestPath est en relatif à DestFolderCo. 
     806        * Peut-etre envisager un principe de prefix comme pour l'espace source. 
     807        */ 
     808        public String resolveDestPath2DestUri(String pDestPath) throws Exception { 
     809                if (pDestPath == null || pDestPath.length() == 0) return ""; 
     810                return fDestFolderCo.hFindSource(pDestPath).hGetUri(); 
     811        } 
     812 
     813        /* (non-Javadoc) 
     814        * @see com.scenari.m.ge.generateur.HGenerateur#wCreeScripter() 
     815        */ 
     816        public IScripter wNewScripter() throws Exception { 
     817                IScripter vResult = new ScripterUrl(); 
     818                vResult.init(this); 
     819                return vResult; 
     820 
     821        } 
     822 
     823        protected String xGetWmSourceEncoding() { 
     824                String vProp = (String) getProperty(KEYPROPERTY_SOURCE_WM_ENCODING); 
     825                return (vProp != null) ? vProp : "ISO-8859-1"; 
     826        } 
     827 
     828        protected String xGetWmDstEncoding() { 
     829                String vProp = (String) getProperty(KEYPROPERTY_DEST_WM_ENCODING); 
     830                return (vProp != null) ? vProp : "ISO-8859-1"; 
     831        } 
     832 
     833        public String getCurrentDestUri() { 
     834                return fCurrentDestUri; 
     835        } 
    832836} 
  • trunk/Jav_GE/com/scenari/m/ge/pages/DynamicInclWriter.java

    r5731 r10372  
    8383 
    8484    /** Buffer de l'inclusion. */ 
    85     protected StringBuffer fBuff = null; 
     85    protected StringBuilder fBuff = null; 
    8686     
    8787    /** Liste des resolvers d'inclusion. */ 
     
    172172                    //On a trouvé un tag d'ouverture 
    173173                    if (fBuff == null) { 
    174                         fBuff = new StringBuffer(64); 
     174                        fBuff = new StringBuilder(64); 
    175175                    } 
    176176                    fStatus = STATUS_TAGIN; 
     
    191191                    //On a trouvé un tag d'ouverture 
    192192                    if (fBuff == null) { 
    193                         fBuff = new StringBuffer(64); 
     193                        fBuff = new StringBuilder(64); 
    194194                    } 
    195195                    fStatus = STATUS_TAGIN; 
  • trunk/Jav_GE/com/scenari/m/ge/pages/TplXslPage.java

    r10350 r10372  
    120120        //DTM fNextDtm = null; 
    121121 
    122         protected StringWriter fStringBuffer = null; 
     122        protected StringWriter fStringBuilder = null; 
    123123 
    124124        protected class ParamsContentHandler extends DefaultHandler { 
     
    198198                                        //Version OPTIMISEE en attente de suppr disable-output-escaping. 
    199199                                        //fNextTransformer.transformNode(fNextDtm.getDocument(), xPrepareNextAndGetOutputTarget(i + 1, vStream, pDialogPage)); 
    200                                         fNextTransformer.transform(new StreamSource(new StringReader(fStringBuffer.toString())), xPrepareNextAndGetOutputTarget(i + 1, vStream, pDialogPage)); 
     200                                        fNextTransformer.transform(new StreamSource(new StringReader(fStringBuilder.toString())), xPrepareNextAndGetOutputTarget(i + 1, vStream, pDialogPage)); 
    201201                                } 
    202202                        } 
     
    262262                        fNextTransformer = null; 
    263263                        //fNextDtm = null; 
    264                         fStringBuffer = null; 
     264                        fStringBuilder = null; 
    265265 
    266266                        //On est à la fin on retourne le sérialisateur final 
     
    275275                        //return new SAXResult(fNextDtm.getContentHandler()); 
    276276 
    277                         fStringBuffer = new StringWriter(); 
    278                         ContentHandler vHandler = SerializerFactory.getSerializerFactory(Method.XML).makeSerializer(fStringBuffer, sXmlDefaulFormat).asContentHandler(); 
     277                        fStringBuilder = new StringWriter(); 
     278                        ContentHandler vHandler = SerializerFactory.getSerializerFactory(Method.XML).makeSerializer(fStringBuilder, sXmlDefaulFormat).asContentHandler(); 
    279279                        return new SAXResult(vHandler); 
    280280                } 
  • trunk/Jav_GE/com/scenari/m/ge/xpath/dom/ZXPathIdExportAgentHier.java

    r9559 r10372  
    9797                if (vDialog != null && vDialog instanceof IWADialog) { 
    9898                        try { 
    99                                 StringBuffer vBuf = new StringBuffer(); 
     99                                StringBuilder vBuf = new StringBuilder(); 
    100100                                IWAgent vAgent = null; 
    101101                                Iterator vHierIt = ((IWADialog)vDialog).hGetHier().iterator(); 
  • trunk/Jav_GE/com/scenari/m/ge/xpath/dom/builder/ZXPathGetContent.java

    r7467 r10372  
    9595        if (vCdModel != null) { 
    9696            if (vAxis != null && vAxis.length() > 0) { 
    97                 StringBuffer vBuf = new StringBuffer(vCdModel.length() + vAxis.length() + ZXPathSwitchAxis.PREFIX.length()); 
     97                StringBuilder vBuf = new StringBuilder(vCdModel.length() + vAxis.length() + ZXPathSwitchAxis.PREFIX.length()); 
    9898                vBuf.append(vCdModel); 
    9999                vBuf.append(ZXPathSwitchAxis.PREFIX); 
  • trunk/Jav_GE/com/scenari/m/ge/xpath/dom/builder/ZXPathGetFullTitleText.java

    r7467 r10372  
    9696        if (vCdModel != null) { 
    9797            if (vAxis != null && vAxis.length() > 0) { 
    98                 StringBuffer vBuf = new StringBuffer(vCdModel.length() + vAxis.length() + ZXPathSwitchAxis.PREFIX.length()); 
     98                StringBuilder vBuf = new StringBuilder(vCdModel.length() + vAxis.length() + ZXPathSwitchAxis.PREFIX.length()); 
    9999                vBuf.append(vCdModel); 
    100100                vBuf.append(ZXPathSwitchAxis.PREFIX); 
  • trunk/Jav_GE/com/scenari/m/ge/xpath/dom/builder/ZXPathGetShortTitleText.java

    r7467 r10372  
    9696        if (vCdModel != null) { 
    9797            if (vAxis != null && vAxis.length() > 0) { 
    98                 StringBuffer vBuf = new StringBuffer(vCdModel.length() + vAxis.length() + ZXPathSwitchAxis.PREFIX.length()); 
     98                StringBuilder vBuf = new StringBuilder(vCdModel.length() + vAxis.length() + ZXPathSwitchAxis.PREFIX.length()); 
    9999                vBuf.append(vCdModel); 
    100100                vBuf.append(ZXPathSwitchAxis.PREFIX); 
  • trunk/Jav_GE/com/scenari/m/ge/xpath/dom/builder/ZXPathGetUrl.java

    r7467 r10372  
    9898        if (vCdModel != null) { 
    9999            if (vAxis != null && vAxis.length() > 0) { 
    100                 StringBuffer vBuf = new StringBuffer(vCdModel.length() + vAxis.length() + ZXPathSwitchAxis.PREFIX.length()); 
     100                StringBuilder vBuf = new StringBuilder(vCdModel.length() + vAxis.length() + ZXPathSwitchAxis.PREFIX.length()); 
    101101                vBuf.append(vCdModel); 
    102102                vBuf.append(ZXPathSwitchAxis.PREFIX); 
  • trunk/Jav_GE/com/scenari/m/ge/xpath/dom/builder/ZXPathGetView.java

    r8684 r10372  
    102102        if (vCdModel != null) { 
    103103            if (vAxis != null && vAxis.length() > 0) { 
    104                 StringBuffer vBuf = new StringBuffer(vCdModel.length() + vAxis.length() + ZXPathSwitchAxis.PREFIX.length()); 
     104                StringBuilder vBuf = new StringBuilder(vCdModel.length() + vAxis.length() + ZXPathSwitchAxis.PREFIX.length()); 
    105105                vBuf.append(vCdModel); 
    106106                vBuf.append(ZXPathSwitchAxis.PREFIX); 
  • trunk/Jav_GE/com/scenari/m/ge/xpath/dom/builder/ZXPathSwitchAxis.java

    r5778 r10372  
    9696            int vEnd = vCdAgent.indexOf(PREFIX); 
    9797            if(vAxis != null && vAxis.length() > 0) { 
    98                 StringBuffer vBuf = new StringBuffer(vCdAgent.length() + vAxis.length() + PREFIX.length()); 
     98                StringBuilder vBuf = new StringBuilder(vCdAgent.length() + vAxis.length() + PREFIX.length()); 
    9999                vBuf.append((vEnd < 0) ? vCdAgent : vCdAgent.substring(0, vEnd)); 
    100100                vBuf.append(PREFIX); 
  • trunk/Jav_GE/com/scenari/m/ge/xpath/dtm/ZXPathIdExportAgentHier.java

    r10215 r10372  
    123123                if (vDialog != null && vDialog instanceof IWADialog) { 
    124124                        try { 
    125                                 StringBuffer vBuf = new StringBuffer(); 
     125                                StringBuilder vBuf = new StringBuilder(); 
    126126                                IWAgent vAgent = null; 
    127127                                Iterator vHierIt = ((IWADialog)vDialog).hGetHier().iterator(); 
  • trunk/Jav_GE/com/scenari/s/ge/javascript/HJavascriptUtil.java

    r7460 r10372  
    3939package com.scenari.s.ge.javascript; 
    4040 
     41import java.io.IOException; 
     42 
    4143import com.scenari.m.co.donnee.IData; 
    4244import com.scenari.s.fw.log.HLogMgr; 
     
    4749 */ 
    4850public class HJavascriptUtil { 
    49 /** 
    50  * HJsExpression constructor comment. 
    51  */ 
    52 public HJavascriptUtil() { 
    53         super(); 
    54 } 
    55 /** 
    56  * Transforme le script javascript en chaine compatible en attributs Xml. 
    57  *  
    58  * @return java.lang.String 
    59  * @param pString java.lang.String 
    60  */ 
    61 public static final String hGetJsInXmlAttr(String pString) { 
    62  
    63         StringBuffer vBuf = new StringBuffer((int)(pString.length() * 1.1 + 10)); 
    64          
    65         HEncodingXml.hWriteAttributHtmlValue(vBuf, pString); 
    66  
    67         return vBuf.toString(); 
    68 } 
    69 /** 
    70  * Escape tous les caractères pour consituer une chaine 
    71  * String utilisable dans du code Javascript. 
    72  *  
    73  * @return java.lang.String 
    74  * @param pString java.lang.String 
    75  */ 
    76 public static final String hGetJsString(String pString) { 
    77  
    78         StringBuffer vBuf = new StringBuffer((int)(pString.length() * 1.1 + 5)); 
    79          
    80         hWriteJsString(vBuf, pString); 
    81  
    82         return vBuf.toString(); 
    83 } 
    84 /** 
    85  * Place une donnée dans une expression qui peut être utilisée dans un test dans une affectation. 
    86  *  
    87  * @param pBuf java.lang.StringBuffer 
    88  * @param pExp Expression 
    89  * @param pMime Mime de l'expression (exp ou fonction javascript) 
    90  */ 
    91 public final static void hWriteExpression(StringBuffer pBuf, String pExp, String pMime) throws Exception { 
    92         if (pMime == IData.MIME_TEXT_JS_EXP) { 
    93                 pBuf.append(pExp); 
    94         } else if (pMime == IData.MIME_TEXT_JS_FCT) { 
    95                 pBuf.append("{f:function(){"); 
    96                 pBuf.append(pExp); 
    97                 pBuf.append("}}.f()"); 
    98         } else { 
    99                 throw HLogMgr.hNewException("le Mime '" + pMime + "' est inconnu pour l'expression '" + pExp + "'."); 
     51        /** 
     52         * HJsExpression constructor comment. 
     53         */ 
     54        public HJavascriptUtil() { 
     55                super(); 
    10056        } 
    10157 
    102 } 
     58        /** 
     59         * Transforme le script javascript en chaine compatible en attributs Xml. 
     60         *  
     61         * @return java.lang.String 
     62         * @param pString java.lang.String 
     63         */ 
     64        public static final String hGetJsInXmlAttr(String pString) { 
    10365 
    104 /** 
    105  * Ajoute un test "if(...){...}" ou "if(...){...}else{...}" si pBlockFalse est non null. 
    106  *  
    107  * @param pBuf java.lang.StringBuffer 
    108  * @param pBlockTrue Block si la condition est vraie. 
    109  * @param pBlockFalse Block si la condition est fausse. 
    110  */ 
    111 public final static void hWriteIf(StringBuffer pBuf, String pCondition, String pMimeCondition, String pBlockTrue, String pBlockFalse) throws Exception { 
    112  
    113         pBuf.append("if("); 
    114         pBuf.append(pCondition); 
    115         hWriteExpression(pBuf, pCondition, pMimeCondition); 
    116         pBuf.append("){"); 
    117         pBuf.append(pBlockTrue); 
    118         pBuf.append("}"); 
    119         if (pBlockFalse != null) { 
    120                 pBuf.append("else{"); 
    121                 pBuf.append(pBlockFalse); 
    122                 pBuf.append("}"); 
     66                StringBuilder vBuf = new StringBuilder((int) (pString.length() * 1.1 + 10)); 
     67                try { 
     68                        HEncodingXml.hWriteAttributHtmlValue(vBuf, pString); 
     69                } catch (IOException e) { 
     70                        // 
     71                } 
     72                return vBuf.toString(); 
    12373        } 
    12474 
    125 } 
    126 /** 
    127  * Escape tous les caractères pour consituer une chaine 
    128  * String utilisable dans du code Javascript. 
    129  *  
    130  */ 
    131 public static final void hWriteJsString(StringBuffer pBuf, String pString) {; 
    132          
    133         for (int i = 0; i < pString.length(); i++) { 
    134                 char vCar = pString.charAt(i); 
    135                 switch (vCar) { 
    136                         case '\'' : { 
     75        /** 
     76         * Escape tous les caractères pour consituer une chaine 
     77         * String utilisable dans du code Javascript. 
     78         *  
     79         * @return java.lang.String 
     80         * @param pString java.lang.String 
     81         */ 
     82        public static final String hGetJsString(String pString) { 
     83 
     84                StringBuilder vBuf = new StringBuilder((int) (pString.length() * 1.1 + 5)); 
     85 
     86                hWriteJsString(vBuf, pString); 
     87 
     88                return vBuf.toString(); 
     89        } 
     90 
     91        /** 
     92         * Place une donnée dans une expression qui peut être utilisée dans un test dans une affectation. 
     93         *  
     94         * @param pBuf java.lang.StringBuilder 
     95         * @param pExp Expression 
     96         * @param pMime Mime de l'expression (exp ou fonction javascript) 
     97         */ 
     98        public final static void hWriteExpression(StringBuilder pBuf, String pExp, String pMime) throws Exception { 
     99                if (pMime == IData.MIME_TEXT_JS_EXP) { 
     100                        pBuf.append(pExp); 
     101                } else if (pMime == IData.MIME_TEXT_JS_FCT) { 
     102                        pBuf.append("{f:function(){"); 
     103                        pBuf.append(pExp); 
     104                        pBuf.append("}}.f()"); 
     105                } else { 
     106                        throw HLogMgr.hNewException("le Mime '" + pMime + "' est inconnu pour l'expression '" + pExp + "'."); 
     107                } 
     108 
     109        } 
     110 
     111        /** 
     112         * Ajoute un test "if(...){...}" ou "if(...){...}else{...}" si pBlockFalse est non null. 
     113         *  
     114         * @param pBuf java.lang.StringBuilder 
     115         * @param pBlockTrue Block si la condition est vraie. 
     116         * @param pBlockFalse Block si la condition est fausse. 
     117         */ 
     118        public final static void hWriteIf(StringBuilder pBuf, String pCondition, String pMimeCondition, String pBlockTrue, String pBlockFalse) throws Exception { 
     119 
     120                pBuf.append("if("); 
     121                pBuf.append(pCondition); 
     122                hWriteExpression(pBuf, pCondition, pMimeCondition); 
     123                pBuf.append("){"); 
     124                pBuf.append(pBlockTrue); 
     125                pBuf.append("}"); 
     126                if (pBlockFalse != null) { 
     127                        pBuf.append("else{"); 
     128                        pBuf.append(pBlockFalse); 
     129                        pBuf.append("}"); 
     130                } 
     131 
     132        } 
     133 
     134        /** 
     135         * Escape tous les caractères pour consituer une chaine 
     136         * String utilisable dans du code Javascript. 
     137         *  
     138         */ 
     139        public static final void hWriteJsString(Appendable pBuf, String pString) { 
     140                try { 
     141                for (int i = 0; i < pString.length(); i++) { 
     142                        char vCar = pString.charAt(i); 
     143                        switch (vCar) { 
     144                        case '\'': { 
    137145                                pBuf.append("\\\'"); 
    138146                                break; 
    139147                        } 
    140                         case '\"' : { 
     148                        case '\"': { 
    141149                                pBuf.append("\\\""); 
    142150                                break; 
    143151                        } 
    144                         case '\\' : { 
     152                        case '\\': { 
    145153                                pBuf.append("\\\\"); 
    146154                                break; 
    147155                        } 
    148                         case '\n' : { 
     156                        case '\n': { 
    149157                                pBuf.append("\\n"); 
    150158                                break; 
    151159                        } 
    152                         case '\r' : { 
     160                        case '\r': { 
    153161                                // 
    154162                                break; 
    155163                        } 
    156                         case '\t' : { 
     164                        case '\t': { 
    157165                                pBuf.append("\\t"); 
    158166                                break; 
    159                         }  
     167                        } 
    160168                        default: { 
    161169                                pBuf.append(vCar); 
    162170                        } 
     171                        } 
     172                } 
     173                } catch  (IOException e) { 
     174                        HLogMgr.hPublishException(e); 
    163175                } 
    164176        } 
    165177} 
    166 } 
  • trunk/Res_ScXmlParser/com/bluecast/xml/Piccolo.java

    r10191 r10372  
    429429        int attributeType = -1; 
    430430 
    431         StringBuffer modelBuffer = new StringBuffer(100); 
     431        StringBuilder modelBuffer = new StringBuilder(100); 
    432432 
    433433        ElementDefinition elementDefinition = null; 
  • trunk/Res_ScXmlParser/com/bluecast/xml/Piccolo.y

    r937 r10372  
    561561int saxVersion = 0; 
    562562int attributeType=-1; 
    563 StringBuffer modelBuffer = new StringBuffer(100); 
     563StringBuilder modelBuffer = new StringBuilder(100); 
    564564ElementDefinition elementDefinition=null; 
    565565String pubID=null,sysID=null; 
  • trunk/Res_ScXmlParser/com/scenari/entitymap/GeneralEntitiesMap.java

    r10191 r10372  
    132132                Properties vProps = new Properties(); 
    133133                vProps.load(pStream); 
    134                 StringBuffer vBuf = new StringBuffer(32); 
     134                StringBuilder vBuf = new StringBuilder(32); 
    135135                for (Iterator vIt = vProps.entrySet().iterator(); vIt.hasNext();) { 
    136136                        vBuf.setLength(0); 
  • trunk/Res_ScXmlSerializer/com/scenari/xerces/serialize/BaseMarkupSerializer.java

    r10348 r10372  
    228228 
    229229        /** Temporary buffer to store character data */ 
    230         protected final StringBuffer fStrBuffer = new StringBuffer(40); 
     230        protected final StringBuilder fStrBuffer = new StringBuilder(40); 
    231231 
    232232        /** 
  • trunk/Res_ScXmlSerializer/com/scenari/xerces/serialize/IndentPrinter.java

    r10214 r10372  
    8181     * be reused by deleting its contents instead of reallocating it. 
    8282     */ 
    83     private StringBuffer    _line; 
     83    private StringBuilder    _line; 
    8484 
    8585 
     
    8989     * or {@link #breakLine}, this part is added to the accumulated line. 
    9090     */ 
    91     private StringBuffer    _text; 
     91    private StringBuilder    _text; 
    9292 
    9393 
     
    118118        super( writer, format ); 
    119119        // Initialize everything for a first/second run. 
    120         _line = new StringBuffer( 80 ); 
    121         _text = new StringBuffer( 20 ); 
     120        _line = new StringBuilder( 80 ); 
     121        _text = new StringBuilder( 20 ); 
    122122        _spaces = 0; 
    123123        _thisIndent = _nextIndent = 0; 
     
    139139        if ( _dtdWriter == null ) { 
    140140            _line.append( _text ); 
    141             _text = new StringBuffer( 20 ); 
     141            _text = new StringBuilder( 20 ); 
    142142            flushLine( false ); 
    143143            _dtdWriter = new StringWriter(); 
     
    158158        if ( _writer == _dtdWriter ) { 
    159159            _line.append( _text ); 
    160             _text = new StringBuffer( 20 ); 
     160            _text = new StringBuilder( 20 ); 
    161161            flushLine( false ); 
    162162            _writer = _docWriter; 
     
    182182     
    183183     
    184     public void printText( StringBuffer text ) 
     184    public void printText( StringBuilder text ) 
    185185    { 
    186186        _text.append( text.toString() ); 
     
    250250            } 
    251251            _line.append( _text ); 
    252             _text = new StringBuffer( 20 ); 
     252            _text = new StringBuilder( 20 ); 
    253253        } 
    254254        // Starting a new word: accumulate the text between the line 
     
    280280            } 
    281281            _line.append( _text ); 
    282             _text = new StringBuffer( 20 ); 
     282            _text = new StringBuilder( 20 ); 
    283283        } 
    284284        flushLine( preserveSpace ); 
     
    329329                _writer.write( _line.toString() ); 
    330330                 
    331                 _line = new StringBuffer( 40 ); 
     331                _line = new StringBuilder( 40 ); 
    332332            } catch ( IOException except ) { 
    333333                // We don't throw an exception, but hold it 
  • trunk/Res_ScXmlSerializer/com/scenari/xerces/serialize/NamespaceSupport.java

    r10214 r10372  
    307307 
    308308                public String toString() { 
    309                         StringBuffer buf = new StringBuffer(); 
     309                        StringBuilder buf = new StringBuilder(); 
    310310                        for (int i = 0; i < size; i++) { 
    311311                                buf.append(prefixes[i]); 
  • trunk/Res_ScXmlSerializer/com/scenari/xerces/serialize/Printer.java

    r10214 r10372  
    222222 
    223223 
    224     public void printText( StringBuffer text ) 
     224    public void printText( StringBuilder text ) 
    225225        throws IOException 
    226226    { 
  • trunk/Res_ScXmlSerializer/com/scenari/xerces/serialize/XMLSerializer.java

    r10214 r10372  
    517517 
    518518                        if (!_format.getOmitXMLDeclaration()) { 
    519                                 StringBuffer buffer; 
     519                                StringBuilder buffer; 
    520520 
    521521                                // Serialize the document declaration appreaing at the head 
    522522                                // of very XML document (unless asked not to). 
    523                                 buffer = new StringBuffer("<?xml version=\""); 
     523                                buffer = new StringBuilder("<?xml version=\""); 
    524524                                if (_format.getVersion() != null) 
    525525                                        buffer.append(_format.getVersion()); 
  • trunk/Res_ScXslt/com/scenari/xsldom/xalan/extensions/MethodResolver.java

    r9494 r10372  
    10191019  private static String errArgs(Object[] xsltArgs, int startingArg) 
    10201020  { 
    1021     StringBuffer returnArgs = new StringBuffer(); 
     1021    StringBuilder returnArgs = new StringBuilder(); 
    10221022    for (int i = startingArg; i < xsltArgs.length; i++) 
    10231023    { 
  • trunk/Res_ScXslt/com/scenari/xsldom/xalan/processor/CompiledStylesheetBundle.java

    r1711 r10372  
    352352        { 
    353353                int fnstart=baseLocation.lastIndexOf(separator); 
    354             StringBuffer subdir=new StringBuffer( 
     354            StringBuilder subdir=new StringBuilder( 
    355355                    (fnstart>=0) 
    356356                        ? baseLocation.substring(0,fnstart+1) 
  • trunk/Res_ScXslt/com/scenari/xsldom/xalan/processor/CompilingStylesheetHandler.java

    r1711 r10372  
    377377          // though I doubt that's significantly faster than SAX and it's 
    378378          // definitely less convenient if further processing is desired. 
    379           StringBuffer body=exec.getBody().append( 
     379          StringBuilder body=exec.getBody().append( 
    380380              "if(transformer.S_DEBUG)\n" 
    381381              +"  transformer.getTraceManager().fireTraceEvent(sourceNode, mode, this);\n" 
     
    459459  } 
    460460   
    461   int compileElemTemplateElement(ElemTemplateElement kid,StringBuffer body,Vector interpretVector) 
     461  int compileElemTemplateElement(ElemTemplateElement kid,StringBuilder body,Vector interpretVector) 
    462462  { 
    463463        int maythrow=0;   
     
    491491  }   
    492492   
    493   int compileElemLiteralResult(ElemLiteralResult ele,StringBuffer body,Vector interpretVector) 
     493  int compileElemLiteralResult(ElemLiteralResult ele,StringBuilder body,Vector interpretVector) 
    494494  { 
    495495        int maythrow=0; 
     
    570570                    "avtStringedValue=((com.scenari.xsldom.xalan.templates.AVT)" 
    571571                    +"(m_interpretArray["+offset+"])" 
    572                     +").evaluate(xctxt,sourceNode,this,new StringBuffer());\n" 
     572                    +").evaluate(xctxt,sourceNode,this,new StringBuilder());\n" 
    573573                    +"if(null!=avtStringedValue)\n{\n" 
    574574                    ); 
     
    612612  Stack attrSetStack=new Stack(); 
    613613     
    614   void compileUseAttrSet(ElemTemplateElement ete,StringBuffer body,Vector interpretVector) 
     614  void compileUseAttrSet(ElemTemplateElement ete,StringBuilder body,Vector interpretVector) 
    615615  { 
    616616    ++uniqueVarSuffix; // Maintain unique variable naming 
     
    665665  } 
    666666   
    667   String compileAVTvalue(com.scenari.xsldom.xalan.templates.AVT avt,StringBuffer body,Vector interpretVector) 
     667  String compileAVTvalue(com.scenari.xsldom.xalan.templates.AVT avt,StringBuilder body,Vector interpretVector) 
    668668  { 
    669669      // Literal string is easy -- except for potential of " within "". 
     
    690690          "( ((com.scenari.xsldom.xalan.templates.AVT)m_interpretArray[" 
    691691                  +offset 
    692                   +"]).evaluate(transformer.getXPathContext(),sourceNode,this,new StringBuffer()) )" 
     692                  +"]).evaluate(transformer.getXPathContext(),sourceNode,this,new StringBuilder()) )" 
    693693          ; 
    694694  } 
     
    702702                return "null"; 
    703703         
    704     StringBuffer out=new StringBuffer("\""); // don't use '"', it's taken as int 
     704    StringBuilder out=new StringBuilder("\""); // don't use '"', it's taken as int 
    705705       
    706706    int startpos=0,quotepos; 
     
    718718  // String val = transformer.transformToString(this, sourceNode, mode); 
    719719  // Returns string econtaiing result expression 
    720   String compileTransformToString(ElemTemplateElement ea,StringBuffer body,Vector interpretVector) 
     720  String compileTransformToString(ElemTemplateElement ea,StringBuilder body,Vector interpretVector) 
    721721  { 
    722722    ++uniqueVarSuffix; // Maintain unique variable naming 
     
    760760   
    761761   
    762   void compileElemAttribute(ElemAttribute ea,StringBuffer body,Vector interpretVector) 
     762  void compileElemAttribute(ElemAttribute ea,StringBuilder body,Vector interpretVector) 
    763763  { 
    764764    ++uniqueVarSuffix; // Maintain unique variable naming 
     
    884884  int uniqueVarSuffix=0; 
    885885   
    886   void compileChildTemplates(ElemTemplateElement source,StringBuffer body,Vector interpretVector) 
     886  void compileChildTemplates(ElemTemplateElement source,StringBuilder body,Vector interpretVector) 
    887887  {       
    888888    int maythrow=0; 
     
    966966     
    967967    int fnstart=filename.lastIndexOf(File.separator); 
    968     StringBuffer subdir=new StringBuffer( 
     968    StringBuilder subdir=new StringBuilder( 
    969969        (fnstart>=0) 
    970970        ? filename.substring(0,fnstart) 
  • trunk/Res_ScXslt/com/scenari/xsldom/xalan/processor/ProcessorCharacters.java

    r1711 r10372  
    226226   * occured. 
    227227   */ 
    228   private StringBuffer m_accumulator = new StringBuffer(); 
     228  private StringBuilder m_accumulator = new StringBuilder(); 
    229229 
    230230  /** 
  • trunk/Res_ScXslt/com/scenari/xsldom/xalan/processor/XSLTAttributeDef.java

    r3876 r10372  
    439439      } 
    440440 
    441       StringBuffer outBuf = new StringBuffer(); 
     441      StringBuilder outBuf = new StringBuilder(); 
    442442 
    443443      outBuf.append("set"); 
  • trunk/Res_ScXslt/com/scenari/xsldom/xalan/stree/DocImpl.java

    r2194 r10372  
    9595package com.scenari.xsldom.xalan.stree; 
    9696 
    97 import com.scenari.xsldom.xml.utils.FastStringBuffer; 
     97import com.scenari.xsldom.xml.utils.FastStringBuilder; 
    9898import com.scenari.xsldom.xpath.XPathContext; 
    9999 
     
    116116     * characters events.  This allows us to not have to allocate  
    117117     * a million little arrays.  */ 
    118     FastStringBuffer m_chars; 
     118    FastStringBuilder m_chars; 
    119119 
    120120    /** Contains exception thrown from transformation thread,  
     
    147147        super(null); 
    148148        // Just an initial guess at reasonable tuning parameters 
    149         m_chars = new FastStringBuffer(13, 13); 
     149        m_chars = new FastStringBuilder(13, 13); 
    150150        //    m_id = m_idCount++; 
    151151    } 
     
    159159        /* 
    160160         * (Note that this takes an initial text buffer size, in characters, 
    161          * as its input parameter. FastStringBuffer's constructor expects the 
     161         * as its input parameter. FastStringBuilder's constructor expects the 
    162162         * number of bits (power of two) needed to span that size. We need to 
    163163         * convert.) 
     
    174174        if ((charBufSize & mask) != 0) ++bitCount; 
    175175 
    176         m_chars = new FastStringBuffer(bitCount); 
     176        m_chars = new FastStringBuilder(bitCount); 
    177177 
    178178        //    m_id = m_idCount++; 
  • trunk/Res_ScXslt/com/scenari/xsldom/xalan/stree/TextImpl.java

    r7476 r10372  
    100100import org.xml.sax.ContentHandler; 
    101101 
    102 import com.scenari.xsldom.xml.utils.FastStringBuffer; 
     102import com.scenari.xsldom.xml.utils.FastStringBuilder; 
    103103import com.scenari.xsldom.xml.utils.XMLCharacterRecognizer; 
    104104 
     
    169169 
    170170        // m_data = new String(ch, start, start+length); 
    171         FastStringBuffer fsb = doc.m_chars; 
     171        FastStringBuilder fsb = doc.m_chars; 
    172172 
    173173        synchronized (fsb) { 
     
    182182    /** 
    183183     * Send content of this text node as a SAX Characters event. Handles both the case where the Text node has stored 
    184      * its data as a local string and that in which the data has been placed in a FastStringBuffer pool. 
     184     * its data as a local string and that in which the data has been placed in a FastStringBuilder pool. 
    185185     *  
    186186     * @param ch 
     
    292292                m_start = -1; 
    293293        } 
    294         m_data = new StringBuffer(m_data.length()+length).append(m_data).append(ch, start, length).toString(); 
     294        m_data = new StringBuilder(m_data.length()+length).append(m_data).append(ch, start, length).toString(); 
    295295    } 
    296296 
  • trunk/Res_ScXslt/com/scenari/xsldom/xalan/templates/AVT.java

    r9560 r10372  
    105105import com.scenari.xsldom.xalan.res.XSLMessages; 
    106106import com.scenari.xsldom.xalan.res.XSLTErrorResources; 
    107 import com.scenari.xsldom.xml.utils.FastStringBuffer; 
    108 import com.scenari.xsldom.xml.utils.StringBufferPool; 
     107import com.scenari.xsldom.xml.utils.FastStringBuilder; 
     108import com.scenari.xsldom.xml.utils.StringBuilderPool; 
    109109import com.scenari.xsldom.xpath.XPath; 
    110110import com.scenari.xsldom.xpath.XPathContext; 
     
    226226                        int nTokens = tokenizer.countTokens(); 
    227227                         
    228                         FastStringBuffer buffer = StringBufferPool.get(); 
    229                         FastStringBuffer exprBuffer = StringBufferPool.get(); 
     228                        FastStringBuilder buffer = StringBuilderPool.get(); 
     229                        FastStringBuilder exprBuffer = StringBuilderPool.get(); 
    230230 
    231231                        try { 
     
    409409                                } 
    410410                        } finally { 
    411                                 StringBufferPool.free(buffer); 
    412                                 StringBufferPool.free(exprBuffer); 
     411                                StringBuilderPool.free(buffer); 
     412                                StringBuilderPool.free(exprBuffer); 
    413413                        } 
    414414                } // end else nTokens > 1 
     
    431431                        return m_simpleString; 
    432432                } else if (null != m_parts) { 
    433                         FastStringBuffer buf = StringBufferPool.get(); 
     433                        FastStringBuilder buf = StringBuilderPool.get(); 
    434434                        String s; 
    435435 
     
    447447                                s = buf.toString(); 
    448448                        } finally { 
    449                                 StringBufferPool.free(buf); 
     449                                StringBuilderPool.free(buf); 
    450450                        } 
    451451 
     
    470470        public String evaluate(XPathContext xctxt, Node context, com.scenari.xsldom.xml.utils.PrefixResolver nsNode) throws javax.xml.transform.TransformerException { 
    471471 
    472                 FastStringBuffer buf = StringBufferPool.get(); 
     472                FastStringBuilder buf = StringBuilderPool.get(); 
    473473 
    474474                try { 
     
    491491                        } 
    492492                } finally { 
    493                         StringBufferPool.free(buf); 
     493                        StringBuilderPool.free(buf); 
    494494                } 
    495495        } 
  • trunk/Res_ScXslt/com/scenari/xsldom/xalan/templates/AVTPart.java

    r9560 r10372  
    9797import org.w3c.dom.Node; 
    9898 
    99 import com.scenari.xsldom.xml.utils.FastStringBuffer; 
     99import com.scenari.xsldom.xml.utils.FastStringBuilder; 
    100100import com.scenari.xsldom.xpath.XPathContext; 
    101101 
     
    133133   */ 
    134134  public abstract void evaluate( 
    135     XPathContext xctxt, FastStringBuffer buf, Node context, 
     135    XPathContext xctxt, FastStringBuilder buf, Node context, 
    136136      com.scenari.xsldom.xml.utils.PrefixResolver nsNode) 
    137137        throws javax.xml.transform.TransformerException; 
  • trunk/Res_ScXslt/com/scenari/xsldom/xalan/templates/AVTPartSimple.java

    r1711 r10372  
    9797import org.w3c.dom.Node; 
    9898 
    99 import com.scenari.xsldom.xml.utils.FastStringBuffer; 
     99import com.scenari.xsldom.xml.utils.FastStringBuilder; 
    100100import com.scenari.xsldom.xpath.XPathContext; 
    101101 
     
    144144   * @param NodeList The current Context Node List. 
    145145   */ 
    146   public void evaluate(XPathContext xctxt, FastStringBuffer buf, 
     146  public void evaluate(XPathContext xctxt, FastStringBuilder buf, 
    147147                       Node context, 
    148148                       com.scenari.xsldom.xml.utils.PrefixResolver nsNode) 
  • trunk/Res_ScXslt/com/scenari/xsldom/xalan/templates/AVTPartXPath.java

    r9559 r10372  
    9797import org.w3c.dom.Node; 
    9898 
    99 import com.scenari.xsldom.xml.utils.FastStringBuffer; 
     99import com.scenari.xsldom.xml.utils.FastStringBuilder; 
    100100import com.scenari.xsldom.xpath.XPath; 
    101101import com.scenari.xsldom.xpath.XPathContext; 
     
    179179   */ 
    180180  public void evaluate( 
    181           XPathContext xctxt, FastStringBuffer buf, Node context, com.scenari.xsldom.xml.utils.PrefixResolver nsNode) 
     181          XPathContext xctxt, FastStringBuilder buf, Node context, com.scenari.xsldom.xml.utils.PrefixResolver nsNode) 
    182182            throws javax.xml.transform.TransformerException 
    183183  { 
  • trunk/Res_ScXslt/com/scenari/xsldom/xalan/templates/ElemNumber.java

    r7307 r10372  
    111111import com.scenari.xsldom.xalan.transformer.DecimalToRoman; 
    112112import com.scenari.xsldom.xalan.transformer.TransformerImpl; 
    113 import com.scenari.xsldom.xml.utils.FastStringBuffer; 
     113import com.scenari.xsldom.xml.utils.FastStringBuilder; 
    114114import com.scenari.xsldom.xml.utils.NodeVector; 
    115115import com.scenari.xsldom.xml.utils.QName; 
    116 import com.scenari.xsldom.xml.utils.StringBufferPool; 
     116import com.scenari.xsldom.xml.utils.StringBuilderPool; 
    117117import com.scenari.xsldom.xml.utils.res.XResourceBundle; 
    118118import com.scenari.xsldom.xpath.NodeSet; 
     
    11201120 
    11211121    String numStr; 
    1122     FastStringBuffer formattedNumber = StringBufferPool.get(); 
     1122    FastStringBuilder formattedNumber = StringBuilderPool.get(); 
    11231123 
    11241124    try 
     
    12481248    finally 
    12491249    { 
    1250       StringBufferPool.free(formattedNumber); 
     1250      StringBuilderPool.free(formattedNumber); 
    12511251    } 
    12521252 
     
    12741274          TransformerImpl transformer, Node contextNode,  
    12751275          char numberType, int numberWidth, int listElement,  
    1276           FastStringBuffer formattedNumber) 
     1276          FastStringBuilder formattedNumber) 
    12771277            throws javax.xml.transform.TransformerException 
    12781278  { 
     
    13191319      } 
    13201320 
    1321       FastStringBuffer stringBuf = StringBufferPool.get(); 
     1321      FastStringBuilder stringBuf = StringBuilderPool.get(); 
    13221322 
    13231323      try 
     
    13301330      finally 
    13311331      { 
    1332         StringBufferPool.free(stringBuf); 
     1332        StringBuilderPool.free(stringBuf); 
    13331333      } 
    13341334      break; 
     
    15971597   */ 
    15981598  protected void int2alphaCount(int val, char[] aTable, 
    1599                                 FastStringBuffer stringBuf) 
     1599                                FastStringBuilder stringBuf) 
    16001600  { 
    16011601 
  • trunk/Res_ScXslt/com/scenari/xsldom/xalan/templates/OutputProperties.java

    r7456 r10372  
    107107 
    108108import com.scenari.xsldom.xalan.serialize.Method; 
    109 import com.scenari.xsldom.xml.utils.FastStringBuffer; 
     109import com.scenari.xsldom.xml.utils.FastStringBuilder; 
    110110import com.scenari.xsldom.xml.utils.QName; 
    111111import com.scenari.xsldom.xml.utils.WrappedRuntimeException; 
     
    678678 
    679679                // Just an initial guess at reasonable tuning parameters 
    680                 FastStringBuffer fsb = new FastStringBuffer(9, 9); 
     680                FastStringBuilder fsb = new FastStringBuilder(9, 9); 
    681681 
    682682                for (int i = 0; i < s; i++) { 
     
    741741                        int l = s.length(); 
    742742                        boolean inCurly = false; 
    743                         FastStringBuffer buf = new FastStringBuffer(); 
     743                        FastStringBuilder buf = new FastStringBuilder(); 
    744744 
    745745                        // parse through string, breaking on whitespaces.  I do this instead  
  • trunk/Res_ScXslt/com/scenari/xsldom/xalan/xslt/EnvironmentCheck.java

    r3877 r10372  
    797797 
    798798      // Found Xalan-J 1.x, grab it's version fields 
    799       StringBuffer buf = new StringBuffer(); 
     799      StringBuilder buf = new StringBuilder(); 
    800800      Field f = clazz.getField("PRODUCT"); 
    801801 
     
    826826 
    827827      // Found Xalan-J 2.x, grab it's version fields 
    828       StringBuffer buf = new StringBuffer(); 
     828      StringBuilder buf = new StringBuilder(); 
    829829      Field f = clazz.getField("PRODUCT"); 
    830830 
  • trunk/Res_ScXslt/com/scenari/xsldom/xml/utils/FastStringBuilder.java

    r1711 r10372  
    9898 * Bare-bones, unsafe, fast string buffer. No thread-safety, no 
    9999 * parameter range checking, exposed fields. Note that in typical 
    100  * applications, thread-safety of a StringBuffer is a somewhat  
     100 * applications, thread-safety of a StringBuilder is a somewhat  
    101101 * dubious concept in any case. 
    102102 * <p> 
    103  * Note that Stree is using a single FastStringBuffer as a string pool, 
     103 * Note that Stree is using a single FastStringBuilder as a string pool, 
    104104 * by recording start and length indices within a single buffer. This 
    105105 * minimizes heap overhead, but of course requires more work when retrieving 
     
    119119 * <p> 
    120120 * */ 
    121 public class FastStringBuffer 
     121public class FastStringBuilder 
    122122{ 
    123123  /** Field m_chunkBits sets our chunking strategy, by saying how many 
     
    128128         
    129129  /** Field m_maxChunkBits affects our chunk-growth strategy, by saying what 
    130    * the largest permissible chunk size is in this particular FastStringBuffer  
     130   * the largest permissible chunk size is in this particular FastStringBuilder  
    131131   * hierarchy. */ 
    132132  int m_maxChunkBits=15; 
     
    136136   * into the first chunk of the next size up. For example, if m_rechunkBits 
    137137   * is set to 3, then after 8 chunks at a given size we will rebundle 
    138    * them as the first element of a FastStringBuffer using a chunk size 
     138   * them as the first element of a FastStringBuilder using a chunk size 
    139139   * 8 times larger (chunkBits shifted left three bits). 
    140140   */ 
     
    162162  /** Field m_lastChunk is an index into m_array[], pointing to the last 
    163163   * chunk of the Chunked Array currently in use. Note that additional 
    164    * chunks may actually be allocated, eg if the FastStringBuffer had 
     164   * chunks may actually be allocated, eg if the FastStringBuilder had 
    165165   * previously been truncated or if someone issued an ensureSpace request. 
    166166   * <p> 
     
    172172  /** Field m_firstFree is an index into m_array[m_lastChunk][], pointing to  
    173173   * the first character in the Chunked Array which is not part of the 
    174    * FastStringBuffer's current content. Since m_array[][] is zero-based,  
     174   * FastStringBuilder's current content. Since m_array[][] is zero-based,  
    175175   * the length of that content can be calculated as  
    176176   * (m_lastChunk<<m_chunkBits) + m_firstFree */ 
    177177  int m_firstFree = 0; 
    178178   
    179   /** Field m_innerFSB, when non-null, is a FastStringBuffer whose total 
     179  /** Field m_innerFSB, when non-null, is a FastStringBuilder whose total 
    180180   * length equals m_chunkSize, and which replaces m_array[0]. This allows 
    181    * building a hierarchy of FastStringBuffers, where early appends use 
     181   * building a hierarchy of FastStringBuilders, where early appends use 
    182182   * a smaller chunkSize (for less wasted memory overhead) but later 
    183183   * ones use a larger chunkSize (for less heap activity overhead). 
    184184   */ 
    185   FastStringBuffer m_innerFSB=null; 
    186  
    187   /** 
    188    * Construct a FastStringBuffer, with allocation policy as per parameters. 
     185  FastStringBuilder m_innerFSB=null; 
     186 
     187  /** 
     188   * Construct a FastStringBuilder, with allocation policy as per parameters. 
    189189   * <p> 
    190190   * For coding convenience, I've expressed both allocation sizes in terms of 
     
    207207   * advance before we attempt to take a step from initChunkBits to maxChunkBits 
    208208   */ 
    209   public FastStringBuffer(int initChunkBits,int maxChunkBits, int rebundleBits) 
     209  public FastStringBuilder(int initChunkBits,int maxChunkBits, int rebundleBits) 
    210210  { 
    211211    m_array = new char[16][]; 
     
    225225 
    226226  /** 
    227    * Construct a FastStringBuffer, using a default rebundleBits value. 
    228    */ 
    229   public FastStringBuffer(int initChunkBits,int maxChunkBits) 
     227   * Construct a FastStringBuilder, using a default rebundleBits value. 
     228   */ 
     229  public FastStringBuilder(int initChunkBits,int maxChunkBits) 
    230230  { 
    231231          this(initChunkBits,maxChunkBits,2); 
     
    233233 
    234234  /** 
    235    * Construct a FastStringBuffer, using default maxChunkBits and 
     235   * Construct a FastStringBuilder, using default maxChunkBits and 
    236236   * rebundleBits values. 
    237237   * <p> 
     
    241241   * @param  
    242242   */ 
    243   public FastStringBuffer(int initChunkBits) 
     243  public FastStringBuilder(int initChunkBits) 
    244244  { 
    245245    this(initChunkBits,15,2); 
    246246  } 
    247247  /** 
    248    * Construct a FastStringBuffer, using a default allocation policy. 
    249    */ 
    250   public FastStringBuffer() 
     248   * Construct a FastStringBuilder, using a default allocation policy. 
     249   */ 
     250  public FastStringBuilder() 
    251251  { 
    252252    // 10 bits is 1K. 15 bits is 32K. Remember that these are character 
    253253    // counts, so actual memory allocation unit is doubled for UTF-16 chars. 
    254254    // 
    255     // For reference: In the original FastStringBuffer, we simply 
     255    // For reference: In the original FastStringBuilder, we simply 
    256256    // overallocated by blocksize (default 1KB) on each buffer-growth. 
    257257    this(10,15,2); 
     
    262262   * Get the length of the list. Synonym for length(). 
    263263   * 
    264    * @return the number of characters in the FastStringBuffer's content. 
     264   * @return the number of characters in the FastStringBuilder's content. 
    265265   */ 
    266266  public final int size() 
     
    272272   * Get the length of the list. Synonym for size(). 
    273273   * 
    274    * @return the number of characters in the FastStringBuffer's content. 
     274   * @return the number of characters in the FastStringBuilder's content. 
    275275   */ 
    276276  public final int length() 
     
    280280 
    281281  /** 
    282    * Discard the content of the FastStringBuffer, and most of the memory 
     282   * Discard the content of the FastStringBuilder, and most of the memory 
    283283   * that was allocated by it, restoring the initial state. Note that this 
    284284   * may eventually be different from setLength(0), which see. 
     
    290290         
    291291        // Recover the original chunk size 
    292         FastStringBuffer innermost=this; 
     292        FastStringBuilder innermost=this; 
    293293        while(innermost.m_innerFSB!=null) 
    294294                innermost=innermost.m_innerFSB; 
     
    305305 
    306306  /** 
    307    * Directly set how much of the FastStringBuffer's storage is to be 
     307   * Directly set how much of the FastStringBuilder's storage is to be 
    308308   * considered part of its content. This is a fast but hazardous 
    309309   * operation. It is not protected against negative values, or values 
    310310   * greater than the amount of storage currently available... and even 
    311311   * if additional storage does exist, its contents are unpredictable. 
    312    * The only safe use for our setLength() is to truncate the FastStringBuffer 
     312   * The only safe use for our setLength() is to truncate the FastStringBuilder 
    313313   * to a shorter string. 
    314314   * <p> 
     
    340340   * that truncation may require restoring one of the innerFSBs 
    341341   */ 
    342   final void setLength(int l, FastStringBuffer rootFSB) 
     342  final void setLength(int l, FastStringBuilder rootFSB) 
    343343  { 
    344344        m_lastChunk = l >>> m_chunkBits; 
     
    369369   * directly from an array of arrays and hence a double copy is needed. 
    370370   * By using ensureCapacity we hope to minimize the heap overhead of building  
    371    * the intermediate StringBuffer. 
     371   * the intermediate StringBuilder. 
    372372   * <p> 
    373373   * (It really is a pity that Java didn't design String as a final subclass 
    374    * of MutableString, rather than having StringBuffer be a separate hierarchy. 
     374   * of MutableString, rather than having StringBuilder be a separate hierarchy. 
    375375   * We'd avoid a <strong>lot</strong> of double-buffering.) 
    376376   *  
    377    * @return the contents of the FastStringBuffer as a standard Java string. 
     377   * @return the contents of the FastStringBuilder as a standard Java string. 
    378378   */ 
    379379  public final String toString() 
    380380  { 
    381381        int length=(m_lastChunk<<m_chunkBits)+m_firstFree; 
    382     return getString(new StringBuffer(length),0,0,length).toString(); 
    383   } 
    384  
    385   /** 
    386    * Append a single character onto the FastStringBuffer, growing the  
     382    return getString(new StringBuilder(length),0,0,length).toString(); 
     383  } 
     384 
     385  /** 
     386   * Append a single character onto the FastStringBuilder, growing the  
    387387   * storage if necessary. 
    388388   * <p> 
     
    424424                  // Should do all the work of both encapsulating 
    425425                  // existing data and establishing new sizes/offsets 
    426                   m_innerFSB=new FastStringBuffer(this); 
     426                  m_innerFSB=new FastStringBuilder(this); 
    427427                } 
    428428                                 
     
    439439 
    440440  /** 
    441    * Append the contents of a String onto the FastStringBuffer,  
     441   * Append the contents of a String onto the FastStringBuilder,  
    442442   * growing the storage if necessary. 
    443443   * <p> 
     
    486486                  // Should do all the work of both encapsulating 
    487487                  // existing data and establishing new sizes/offsets 
    488                   m_innerFSB=new FastStringBuffer(this); 
     488                  m_innerFSB=new FastStringBuilder(this); 
    489489                } 
    490490 
     
    503503 
    504504  /** 
    505    * Append the contents of a StringBuffer onto the FastStringBuffer, 
     505   * Append the contents of a StringBuilder onto the FastStringBuilder, 
    506506   * growing the storage if necessary. 
    507507   * <p> 
     
    509509   * references to m_array[] may no longer be valid. 
    510510   * 
    511    * @param value StringBuffer whose contents are to be appended. 
    512    */ 
    513   public final void append(StringBuffer value) 
     511   * @param value StringBuilder whose contents are to be appended. 
     512   */ 
     513  public final void append(StringBuilder value) 
    514514  { 
    515515    int strlen=value.length(); 
     
    550550                  // Should do all the work of both encapsulating 
    551551                  // existing data and establishing new sizes/offsets 
    552                   m_innerFSB=new FastStringBuffer(this); 
     552                  m_innerFSB=new FastStringBuilder(this); 
    553553                } 
    554554                // Add a chunk. 
     
    567567  /** 
    568568   * Append part of the contents of a Character Array onto the  
    569    * FastStringBuffer,  growing the storage if necessary. 
     569   * FastStringBuilder,  growing the storage if necessary. 
    570570   * <p> 
    571571   * NOTE THAT after calling append(), previously obtained 
     
    616616                  // Should do all the work of both encapsulating 
    617617                  // existing data and establishing new sizes/offsets 
    618                   m_innerFSB=new FastStringBuffer(this); 
     618                  m_innerFSB=new FastStringBuilder(this); 
    619619                } 
    620620                // Add a chunk. 
     
    632632 
    633633  /** 
    634    * Append the contents of another FastStringBuffer onto  
    635    * this FastStringBuffer, growing the storage if necessary. 
     634   * Append the contents of another FastStringBuilder onto  
     635   * this FastStringBuilder, growing the storage if necessary. 
    636636   * <p> 
    637637   * NOTE THAT after calling append(), previously obtained 
    638638   * references to m_array[] may no longer be valid. 
    639639   * 
    640    * @param value FastStringBuffer whose contents are 
     640   * @param value FastStringBuilder whose contents are 
    641641   * to be appended. 
    642642   */ 
    643   public final void append(FastStringBuffer value) 
     643  public final void append(FastStringBuilder value) 
    644644  { 
    645645    // Complicating factor here is that the two buffers may use 
     
    694694                  // Should do all the work of both encapsulating 
    695695                  // existing data and establishing new sizes/offsets 
    696                   m_innerFSB=new FastStringBuffer(this); 
     696                  m_innerFSB=new FastStringBuilder(this); 
    697697                } 
    698698                // Add a chunk.  
     
    753753  public String getString(int start, int length) 
    754754  { 
    755     return getString(new StringBuffer(length),start>>>m_chunkBits,start&m_chunkMask,length).toString(); 
     755    return getString(new StringBuilder(length),start>>>m_chunkBits,start&m_chunkMask,length).toString(); 
    756756  } 
    757757   
    758758  /** 
    759    * @param sb StringBuffer to be appended to 
     759   * @param sb StringBuilder to be appended to 
    760760   * @param start Offset of first character in the range. 
    761761   * @param length Number of characters to send. 
    762762   * @return sb with the requested text appended to it 
    763763   */ 
    764   StringBuffer getString(StringBuffer sb, int start, int length) 
     764  StringBuilder getString(StringBuilder sb, int start, int length) 
    765765  { 
    766766    return getString(sb,start>>>m_chunkBits,start&m_chunkMask,length); 
     
    769769  /** Internal support for toString() and getString(). 
    770770   * PLEASE NOTE SIGNATURE CHANGE from earlier versions; it now appends into 
    771    * and returns a StringBuffer supplied by the caller. This simplifies  
     771   * and returns a StringBuilder supplied by the caller. This simplifies  
    772772   * m_innerFSB support. 
    773773   * <p> 
     
    776776   * directly from an array of arrays and hence a double copy is needed. 
    777777   * By presetting length we hope to minimize the heap overhead of building  
    778    * the intermediate StringBuffer. 
     778   * the intermediate StringBuilder. 
    779779   * <p> 
    780780   * (It really is a pity that Java didn't design String as a final subclass 
    781    * of MutableString, rather than having StringBuffer be a separate hierarchy. 
     781   * of MutableString, rather than having StringBuilder be a separate hierarchy. 
    782782   * We'd avoid a <strong>lot</strong> of double-buffering.) 
    783783   *  
    784    * @return the contents of the FastStringBuffer as a standard Java string. 
    785    */ 
    786   StringBuffer getString(StringBuffer sb,int startChunk,int startColumn,int length) 
     784   * @return the contents of the FastStringBuilder as a standard Java string. 
     785   */ 
     786  StringBuilder getString(StringBuilder sb,int startChunk,int startColumn,int length) 
    787787  { 
    788788    int stop=(startChunk<<m_chunkBits)+startColumn+length; 
     
    791791       
    792792        // Factored out 
    793     //StringBuffer sb=new StringBuffer(length); 
     793    //StringBuilder sb=new StringBuilder(length); 
    794794           
    795795    for(int i=startChunk;i<stopChunk;++i) 
     
    813813   * events. 
    814814   * Note that the buffer reference passed to the ContentHandler may be  
    815    * invalidated if the FastStringBuffer is edited; it's the user's  
    816    * responsibility to manage access to the FastStringBuffer to prevent this 
     815   * invalidated if the FastStringBuilder is edited; it's the user's  
     816   * responsibility to manage access to the FastStringBuilder to prevent this 
    817817   * problem from arising. 
    818818   * <p> 
     
    853853  } 
    854854 
    855   /** Encapsulation c'tor. After this is called, the source FastStringBuffer 
     855  /** Encapsulation c'tor. After this is called, the source FastStringBuilder 
    856856   * will be reset to use the new object as its m_innerFSB, and will have 
    857857   * had its chunk size reset appropriately. IT SHOULD NEVER BE CALLED 
    858858   * EXCEPT WHEN source.length()==1<<(source.m_chunkBits+source.m_rebundleBits) 
    859859   */ 
    860   private FastStringBuffer(FastStringBuffer source) 
     860  private FastStringBuilder(FastStringBuilder source) 
    861861  { 
    862862        // Copy existing information into new encapsulation 
  • trunk/Res_ScXslt/com/scenari/xsldom/xml/utils/StringBuilderPool.java

    r1711 r10372  
    101101 * their supporting character arrays. 
    102102 */ 
    103 public class StringBufferPool 
     103public class StringBuilderPool 
    104104{ 
    105105 
    106106  /** The global pool of string buffers.   */ 
    107107  private static ObjectPool m_stringBufPool = 
    108     new ObjectPool(com.scenari.xsldom.xml.utils.FastStringBuffer.class); 
     108    new ObjectPool(com.scenari.xsldom.xml.utils.FastStringBuilder.class); 
    109109 
    110110  /** 
     
    114114   * @return A string buffer ready for use. 
    115115   */ 
    116   public static FastStringBuffer get() 
     116  public static FastStringBuilder get() 
    117117  { 
    118     return (FastStringBuffer) m_stringBufPool.getInstance(); 
     118    return (FastStringBuilder) m_stringBufPool.getInstance(); 
    119119  } 
    120120 
     
    124124   * @param sb Must be a non-null reference to a string buffer. 
    125125   */ 
    126   public static void free(FastStringBuffer sb) 
     126  public static void free(FastStringBuilder sb) 
    127127  { 
    128128    // Since this isn't synchronized, setLength must be  
  • trunk/Res_ScXslt/com/scenari/xsldom/xml/utils/URI.java

    r1711 r10372  
    933933  { 
    934934 
    935     StringBuffer schemespec = new StringBuffer(); 
     935    StringBuilder schemespec = new StringBuilder(); 
    936936 
    937937    if (m_userinfo != null || m_host != null || m_port != -1) 
     
    10251025  { 
    10261026 
    1027     StringBuffer pathString = new StringBuffer(m_path); 
     1027    StringBuilder pathString = new StringBuilder(m_path); 
    10281028 
    10291029    if (p_includeQueryString && m_queryString != null) 
     
    14211421  { 
    14221422 
    1423     StringBuffer uriSpecString = new StringBuffer(); 
     1423    StringBuilder uriSpecString = new StringBuilder(); 
    14241424 
    14251425    if (m_scheme != null) 
  • trunk/Res_ScXslt/com/scenari/xsldom/xml/utils/XMLCharacterRecognizer.java

    r1711 r10372  
    141141   * Tell if the string is whitespace. 
    142142   * 
    143    * @param buf StringBuffer to check as XML whitespace. 
     143   * @param buf StringBuilder to check as XML whitespace. 
    144144   * @return True if characters in buffer are XML whitespace, false otherwise 
    145145   */ 
    146   public static boolean isWhiteSpace(StringBuffer buf) 
     146  public static boolean isWhiteSpace(StringBuilder buf) 
    147147  { 
    148148 
     
    161161   * Tell if the string is whitespace. 
    162162   * 
    163    * @param buf StringBuffer to check as XML whitespace. 
     163   * @param buf StringBuilder to check as XML whitespace. 
    164164   * @return True if characters in buffer are XML whitespace, false otherwise 
    165165   */ 
  • trunk/Res_ScXslt/com/scenari/xsldom/xml/utils/synthetic/Class.java

    r1711 r10372  
    391391    if (className.endsWith("]")) 
    392392    { 
    393       StringBuffer arrayname = new StringBuffer(); 
     393      StringBuilder arrayname = new StringBuilder(); 
    394394 
    395395      for (int i = className.indexOf('['); i != -1; 
     
    14961496    // add another [ for each level of array 
    14971497    int count = name.lastIndexOf('['); 
    1498     StringBuffer jname = new StringBuffer(name.substring(count + 2)); 
     1498    StringBuilder jname = new StringBuilder(name.substring(count + 2)); 
    14991499 
    15001500    // Trim the trailing ';' 
     
    15551555    // add another [ for each level of array 
    15561556    int count = shortname.lastIndexOf('['); 
    1557     StringBuffer jname = new StringBuffer(shortname.substring(count + 2)); 
     1557    StringBuilder jname = new StringBuilder(shortname.substring(count + 2)); 
    15581558 
    15591559    // Trim the trailing ';' 
     
    21482148  { 
    21492149 
    2150     StringBuffer t = new StringBuffer(); 
     2150    StringBuilder t = new StringBuilder(); 
    21512151 
    21522152    while (depth-- > 0) 
  • trunk/Res_ScXslt/com/scenari/xsldom/xml/utils/synthetic/reflection/EntryPoint.java

    r1711 r10372  
    143143 
    144144  /** Field body          */ 
    145   private StringBuffer body = null; 
     145  private StringBuilder body = null; 
    146146 
    147147  /** Field language          */ 
     
    521521  { 
    522522 
    523     StringBuffer sb = 
    524       new StringBuffer(java.lang.reflect.Modifier.toString(getModifiers())); 
     523    StringBuilder sb = 
     524      new StringBuilder(java.lang.reflect.Modifier.toString(getModifiers())); 
    525525 
    526526    if (this instanceof com.scenari.xsldom.xml.utils.synthetic.reflection.Method) 
     
    573573   * @throws SynthesisException 
    574574   */ 
    575   public void setBody(String language, StringBuffer body) 
     575  public void setBody(String language, StringBuilder body) 
    576576          throws SynthesisException 
    577577  { 
     
    590590   * 
    591591   */ 
    592   public StringBuffer getBody() 
     592  public StringBuilder getBody() 
    593593  { 
    594594 
    595595    if (body == null) 
    596       body = new StringBuffer(); 
     596      body = new StringBuilder(); 
    597597 
    598598    return body; 
     
    618618  { 
    619619 
    620     StringBuffer sb = new StringBuffer(); 
     620    StringBuilder sb = new StringBuilder(); 
    621621 
    622622    sb.append(basetab).append( 
  • trunk/Res_ScXslt/com/scenari/xsldom/xml/utils/synthetic/reflection/Field.java

    r1711 r10372  
    858858  { 
    859859 
    860     StringBuffer sb = new StringBuffer( 
     860    StringBuilder sb = new StringBuilder( 
    861861      java.lang.reflect.Modifier.toString(getModifiers())).append(' ').append( 
    862862      getType().getJavaName()).append(' ').append(getName()); 
  • trunk/Res_ScXslt/com/scenari/xsldom/xpath/DOMHelper.java

    r1711 r10372  
    113113 
    114114import com.scenari.xsldom.xalan.res.XSLMessages; 
    115 import com.scenari.xsldom.xml.utils.FastStringBuffer; 
     115import com.scenari.xsldom.xml.utils.FastStringBuilder; 
    116116import com.scenari.xsldom.xml.utils.NSInfo; 
    117117import com.scenari.xsldom.xml.utils.QName; 
    118 import com.scenari.xsldom.xml.utils.StringBufferPool; 
     118import com.scenari.xsldom.xml.utils.StringBuilderPool; 
    119119import com.scenari.xsldom.xpath.res.XPATHErrorResources; 
    120120 
     
    12911291  /** 
    12921292   * Get the textual contents of the node. See 
    1293    * getNodeData(Node,FastStringBuffer) for discussion of how 
     1293   * getNodeData(Node,FastStringBuilder) for discussion of how 
    12941294   * whitespace nodes are handled. 
    12951295   * 
     
    12971297   * @return String containing a concatenation of all the  
    12981298   * textual content within that node.  
    1299    * @see #getNodeData(Node,FastStringBuffer) 
     1299   * @see #getNodeData(Node,FastStringBuilder) 
    13001300   *  
    13011301   */ 
     
    13031303  { 
    13041304 
    1305     FastStringBuffer buf = StringBufferPool.get(); 
     1305    FastStringBuilder buf = StringBuilderPool.get(); 
    13061306    String s; 
    13071307 
     
    13141314    finally 
    13151315    { 
    1316       StringBufferPool.free(buf); 
     1316      StringBuilderPool.free(buf); 
    13171317    } 
    13181318 
     
    13221322  /** 
    13231323   * Retrieve the text content of a DOM subtree, appending it into a 
    1324    * user-supplied FastStringBuffer object. Note that attributes are 
     1324   * user-supplied FastStringBuilder object. Note that attributes are 
    13251325   * not considered part of the content of an element. 
    13261326   * <p> 
     
    13341334   * @param node Node whose subtree is to be walked, gathering the 
    13351335   * contents of all Text or CDATASection nodes. 
    1336    * @param buf FastStringBuffer into which the contents of the text 
     1336   * @param buf FastStringBuilder into which the contents of the text 
    13371337   * nodes are to be concatenated. 
    13381338   */ 
    1339   public static void getNodeData(Node node, FastStringBuffer buf) 
     1339  public static void getNodeData(Node node, FastStringBuilder buf) 
    13401340  { 
    13411341 
  • trunk/Res_ScXslt/com/scenari/xsldom/xpath/functions/FuncConcat.java

    r1711 r10372  
    117117  { 
    118118 
    119     StringBuffer sb = new StringBuffer(); 
     119    StringBuilder sb = new StringBuilder(); 
    120120 
    121121    // Compiler says we must have at least two arguments. 
  • trunk/Res_ScXslt/com/scenari/xsldom/xpath/functions/FuncTranslate.java

    r1711 r10372  
    125125    // A vector to contain the new characters.  We'll use it to construct 
    126126    // the result string. 
    127     StringBuffer sbuffer = new StringBuffer(); 
     127    StringBuilder sbuffer = new StringBuilder(); 
    128128 
    129129    for (int i = 0; i < theFirstStringLength; i++) 
  • trunk/Res_ScXslt/com/scenari/xsldtm/xalan/extensions/MethodResolver.java

    r10215 r10372  
    290290  { 
    291291    char dash = '-'; 
    292     StringBuffer buff = new StringBuffer(""); 
     292    StringBuilder buff = new StringBuilder(""); 
    293293    for (int i=0; i<name.length(); i++) 
    294294    { 
     
    975975  private static String errArgs(Object[] xsltArgs, int startingArg) 
    976976  { 
    977     StringBuffer returnArgs = new StringBuffer(); 
     977    StringBuilder returnArgs = new StringBuilder(); 
    978978    for (int i = startingArg; i < xsltArgs.length; i++) 
    979979    { 
  • trunk/Res_ScXslt/com/scenari/xsldtm/xalan/lib/ExsltBase.java

    r10215 r10372  
    4747      { 
    4848        NodeList nodelist = n.getChildNodes(); 
    49         StringBuffer buf = new StringBuffer(); 
     49        StringBuilder buf = new StringBuilder(); 
    5050        for (int i = 0; i < nodelist.getLength(); i++) 
    5151        { 
  • trunk/Res_ScXslt/com/scenari/xsldtm/xalan/lib/ExsltDatetime.java

    r10215 r10372  
    7878      SimpleDateFormat dateFormat = new SimpleDateFormat(dt); 
    7979       
    80       StringBuffer buff = new StringBuffer(dateFormat.format(datetime)); 
     80      StringBuilder buff = new StringBuilder(dateFormat.format(datetime)); 
    8181      // Must also include offset from UTF. 
    8282      // Get the offset (in milliseconds). 
     
    10781078        int quoteSemaphore = 0; 
    10791079        int i = 0; 
    1080         StringBuffer result = new StringBuffer(pattern.length()); 
     1080        StringBuilder result = new StringBuilder(pattern.length()); 
    10811081 
    10821082        while (i < pattern.length()) 
  • trunk/Res_ScXslt/com/scenari/xsldtm/xalan/lib/ExsltStrings.java

    r10215 r10372  
    118118  public static String concat(NodeList nl) 
    119119  { 
    120     StringBuffer sb = new StringBuffer(); 
     120    StringBuilder sb = new StringBuilder(); 
    121121    for (int i = 0; i < nl.getLength(); i++) 
    122122    { 
     
    151151      return ""; 
    152152     
    153     StringBuffer sb = new StringBuffer(); 
     153    StringBuilder sb = new StringBuilder(); 
    154154    int len = (int)length; 
    155155    int numAdded = 0; 
  • trunk/Res_ScXslt/com/scenari/xsldtm/xalan/processor/ProcessorCharacters.java

    r10215 r10372  
    159159   * occured. 
    160160   */ 
    161   private StringBuffer m_accumulator = new StringBuffer(); 
     161  private StringBuilder m_accumulator = new StringBuilder(); 
    162162 
    163163  /** 
  • trunk/Res_ScXslt/com/scenari/xsldtm/xalan/processor/XSLTAttributeDef.java

    r10215 r10372  
    455455      } 
    456456 
    457       StringBuffer outBuf = new StringBuffer(); 
     457      StringBuilder outBuf = new StringBuilder(); 
    458458 
    459459      outBuf.append("set"); 
     
    642642        if (retVal == StringToIntTable.INVALID_KEY)  
    643643    { 
    644        StringBuffer enumNamesList = getListOfEnums(); 
     644       StringBuilder enumNamesList = getListOfEnums(); 
    645645       handleError(handler, XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },null); 
    646646       return null; 
     
    705705                 
    706706                        if (qname.getPrefix() == null) { 
    707                    StringBuffer enumNamesList = getListOfEnums(); 
     707                   StringBuilder enumNamesList = getListOfEnums(); 
    708708 
    709709                   enumNamesList.append(" <qname-but-not-ncname>"); 
     
    715715        catch (IllegalArgumentException ie)  
    716716        { 
    717            StringBuffer enumNamesList = getListOfEnums(); 
     717           StringBuilder enumNamesList = getListOfEnums(); 
    718718           enumNamesList.append(" <qname-but-not-ncname>"); 
    719719            
     
    724724        catch (RuntimeException re) 
    725725        { 
    726            StringBuffer enumNamesList = getListOfEnums(); 
     726           StringBuilder enumNamesList = getListOfEnums(); 
    727727           enumNamesList.append(" <qname-but-not-ncname>"); 
    728728 
     
    15321532   
    15331533  /** 
    1534    * StringBuffer containing comma delimited list of valid values for ENUM type. 
     1534   * StringBuilder containing comma delimited list of valid values for ENUM type. 
    15351535   * Used to build error message. 
    15361536   */ 
    1537   private StringBuffer getListOfEnums()  
    1538   { 
    1539      StringBuffer enumNamesList = new StringBuffer();             
     1537  private StringBuilder getListOfEnums()  
     1538  { 
     1539     StringBuilder enumNamesList = new StringBuilder();             
    15401540     String [] enumValues = this.getEnumNames(); 
    15411541 
  • trunk/Res_ScXslt/com/scenari/xsldtm/xalan/templates/AVT.java

    r10215 r10372  
    2727import com.scenari.xsldtm.xalan.res.XSLMessages; 
    2828import com.scenari.xsldtm.xalan.res.XSLTErrorResources; 
    29 import com.scenari.xsldtm.xml.utils.FastStringBuffer; 
    30 import com.scenari.xsldtm.xml.utils.StringBufferPool; 
     29import com.scenari.xsldtm.xml.utils.FastStringBuilder; 
     30import com.scenari.xsldtm.xml.utils.StringBuilderPool; 
    3131import com.scenari.xsldtm.xpath.XPath; 
    3232import com.scenari.xsldtm.xpath.XPathContext; 
     
    148148                        int nTokens = tokenizer.countTokens(); 
    149149 
    150                         FastStringBuffer buffer = StringBufferPool.get(); 
    151                         FastStringBuffer exprBuffer = StringBufferPool.get(); 
     150                        FastStringBuilder buffer = StringBuilderPool.get(); 
     151                        FastStringBuilder exprBuffer = StringBuilderPool.get(); 
    152152 
    153153                        try { 
     
    338338                                } 
    339339                        } finally { 
    340                                 StringBufferPool.free(buffer); 
    341                                 StringBufferPool.free(exprBuffer); 
     340                                StringBuilderPool.free(buffer); 
     341                                StringBuilderPool.free(exprBuffer); 
    342342                        } 
    343343                } // end else nTokens > 1 
     
    360360                        return m_simpleString; 
    361361                } else if (null != m_parts) { 
    362                         FastStringBuffer buf = StringBufferPool.get(); 
     362                        FastStringBuilder buf = StringBuilderPool.get(); 
    363363                        String s; 
    364364 
     
    376376                                s = buf.toString(); 
    377377                        } finally { 
    378                                 StringBufferPool.free(buf); 
     378                                StringBuilderPool.free(buf); 
    379379                        } 
    380380 
     
    399399        public String evaluate(XPathContext xctxt, int context, com.scenari.xsldtm.xml.utils.PrefixResolver nsNode) throws javax.xml.transform.TransformerException { 
    400400 
    401                 FastStringBuffer buf = StringBufferPool.get(); 
     401                FastStringBuilder buf = StringBuilderPool.get(); 
    402402 
    403403                try { 
     
    420420                        } 
    421421                } finally { 
    422                         StringBufferPool.free(buf); 
     422                        StringBuilderPool.free(buf); 
    423423                } 
    424424        } 
  • trunk/Res_ScXslt/com/scenari/xsldtm/xalan/templates/AVTPart.java

    r10215 r10372  
    1919package com.scenari.xsldtm.xalan.templates; 
    2020 
    21 import com.scenari.xsldtm.xml.utils.FastStringBuffer; 
     21import com.scenari.xsldtm.xml.utils.FastStringBuilder; 
    2222import com.scenari.xsldtm.xpath.XPathContext; 
    2323 
     
    5555   */ 
    5656  public abstract void evaluate( 
    57     XPathContext xctxt, FastStringBuffer buf, int context, 
     57    XPathContext xctxt, FastStringBuilder buf, int context, 
    5858      com.scenari.xsldtm.xml.utils.PrefixResolver nsNode) 
    5959        throws javax.xml.transform.TransformerException; 
  • trunk/Res_ScXslt/com/scenari/xsldtm/xalan/templates/AVTPartSimple.java

    r10215 r10372  
    1919package com.scenari.xsldtm.xalan.templates; 
    2020 
    21 import com.scenari.xsldtm.xml.utils.FastStringBuffer; 
     21import com.scenari.xsldtm.xml.utils.FastStringBuilder; 
    2222import com.scenari.xsldtm.xpath.XPathContext; 
    2323 
     
    8282   * @param NodeList The current Context Node List. 
    8383   */ 
    84   public void evaluate(XPathContext xctxt, FastStringBuffer buf, 
     84  public void evaluate(XPathContext xctxt, FastStringBuilder buf, 
    8585                       int context, 
    8686                       com.scenari.xsldtm.xml.utils.PrefixResolver nsNode) 
  • trunk/Res_ScXslt/com/scenari/xsldtm/xalan/templates/AVTPartXPath.java

    r10215 r10372  
    1919package com.scenari.xsldtm.xalan.templates; 
    2020 
    21 import com.scenari.xsldtm.xml.utils.FastStringBuffer; 
     21import com.scenari.xsldtm.xml.utils.FastStringBuilder; 
    2222import com.scenari.xsldtm.xpath.XPath; 
    2323import com.scenari.xsldtm.xpath.XPathContext; 
     
    127127   */ 
    128128  public void evaluate( 
    129           XPathContext xctxt, FastStringBuffer buf, int context, com.scenari.xsldtm.xml.utils.PrefixResolver nsNode) 
     129          XPathContext xctxt, FastStringBuilder buf, int context, com.scenari.xsldtm.xml.utils.PrefixResolver nsNode) 
    130130            throws javax.xml.transform.TransformerException 
    131131  { 
  • trunk/Res_ScXslt/com/scenari/xsldtm/xalan/templates/ElemNumber.java

    r10215 r10372  
    3737import com.scenari.xsldtm.xalan.transformer.TransformerImpl; 
    3838import com.scenari.xsldtm.xml.dtm.DTM; 
    39 import com.scenari.xsldtm.xml.utils.FastStringBuffer; 
     39import com.scenari.xsldtm.xml.utils.FastStringBuilder; 
    4040import com.scenari.xsldtm.xml.utils.NodeVector; 
    4141import com.scenari.xsldtm.xml.utils.PrefixResolver; 
    42 import com.scenari.xsldtm.xml.utils.StringBufferPool; 
     42import com.scenari.xsldtm.xml.utils.StringBuilderPool; 
    4343import com.scenari.xsldtm.xml.utils.res.XResourceBundle; 
    4444import com.scenari.xsldtm.xpath.NodeSetDTM; 
     
    11611161 
    11621162    String numStr; 
    1163     FastStringBuffer formattedNumber = StringBufferPool.get(); 
     1163    FastStringBuilder formattedNumber = StringBuilderPool.get(); 
    11641164 
    11651165    try 
     
    12891289    finally 
    12901290    { 
    1291       StringBufferPool.free(formattedNumber); 
     1291      StringBuilderPool.free(formattedNumber); 
    12921292    } 
    12931293 
     
    13151315          TransformerImpl transformer, int contextNode,  
    13161316          char numberType, int numberWidth, long listElement,  
    1317           FastStringBuffer formattedNumber) 
     1317          FastStringBuilder formattedNumber) 
    13181318            throws javax.xml.transform.TransformerException 
    13191319  { 
     
    13591359      } 
    13601360 
    1361       FastStringBuffer stringBuf = StringBufferPool.get(); 
     1361      FastStringBuilder stringBuf = StringBuilderPool.get(); 
    13621362 
    13631363      try 
     
    13701370      finally 
    13711371      { 
    1372         StringBufferPool.free(stringBuf); 
     1372        StringBuilderPool.free(stringBuf); 
    13731373      } 
    13741374      break; 
     
    16391639   */ 
    16401640  protected void int2alphaCount(long val, char[] aTable, 
    1641                                 FastStringBuffer stringBuf) 
     1641                                FastStringBuilder stringBuf) 
    16421642  { 
    16431643 
  • trunk/Res_ScXslt/com/scenari/xsldtm/xalan/templates/OutputProperties.java

    r10215 r10372  
    3030import com.scenari.xsldtm.xml.serializer.OutputPropertiesFactory; 
    3131import com.scenari.xsldtm.xml.serializer.OutputPropertyUtils; 
    32 import com.scenari.xsldtm.xml.utils.FastStringBuffer; 
     32import com.scenari.xsldtm.xml.utils.FastStringBuilder; 
    3333import com.scenari.xsldtm.xml.utils.QName; 
    3434 
     
    419419 
    420420    // Just an initial guess at reasonable tuning parameters 
    421     FastStringBuffer fsb = new FastStringBuffer(9,9); 
     421    FastStringBuilder fsb = new FastStringBuilder(9,9); 
    422422 
    423423    for (int i = 0; i < s; i++) 
     
    488488      int l = s.length(); 
    489489      boolean inCurly = false; 
    490       FastStringBuffer buf = new FastStringBuffer(); 
     490      FastStringBuilder buf = new FastStringBuilder(); 
    491491 
    492492      // parse through string, breaking on whitespaces.  I do this instead  
  • trunk/Res_ScXslt/com/scenari/xsldtm/xalan/xslt/EnvironmentCheck.java

    r10215 r10372  
    844844 
    845845      // Found Xalan-J 1.x, grab it's version fields 
    846       StringBuffer buf = new StringBuffer(); 
     846      StringBuilder buf = new StringBuilder(); 
    847847      Field f = clazz.getField("PRODUCT"); 
    848848 
     
    877877 
    878878      // Found Xalan-J 2.x, grab it's version fields 
    879       StringBuffer buf = new StringBuffer(); 
     879      StringBuilder buf = new StringBuilder(); 
    880880      Field f = clazz.getField("S_VERSION"); 
    881881      buf.append(f.get(null)); 
  • trunk/Res_ScXslt/com/scenari/xsldtm/xml/dtm/DTM.java

    r10215 r10372  
    4343 * 
    4444 * <p>Text content of a node is represented by an index and length, 
    45  * permitting efficient storage such as a shared FastStringBuffer.</p> 
     45 * permitting efficient storage such as a shared FastStringBuilder.</p> 
    4646 * 
    4747 * <p>The model of the tree, as well as the general navigation model, 
  • trunk/Res_ScXslt/com/scenari/xsldtm/xml/dtm/DTMException.java

    r10215 r10372  
    212212    public String getMessageAndLocation() { 
    213213 
    214         StringBuffer sbuffer = new StringBuffer(); 
     214        StringBuilder sbuffer = new StringBuilder(); 
    215215        String       message = super.getMessage(); 
    216216 
     
    252252 
    253253        if (null != locator) { 
    254             StringBuffer sbuffer  = new StringBuffer(); 
     254            StringBuilder sbuffer  = new StringBuilder(); 
    255255            String       systemID = locator.getSystemId(); 
    256256            int          line     = locator.getLineNumber(); 
  • trunk/Res_ScXslt/com/scenari/xsldtm/xml/dtm/ref/DTMDefaultBase.java

    r10215 r10372  
    843843        } 
    844844 
    845       StringBuffer sb=new StringBuffer(); 
     845      StringBuilder sb=new StringBuilder(); 
    846846          sb.append("["+nodeHandle+": "+typestring+ 
    847847                                "(0x"+Integer.toHexString(getExpandedTypeID(nodeHandle))+") "+ 
  • trunk/Res_ScXslt/com/scenari/xsldtm/xml/dtm/ref/DTMDocumentImpl.java

    r10215 r10372  
    3232import com.scenari.xsldtm.xml.dtm.DTMManager; 
    3333import com.scenari.xsldtm.xml.dtm.DTMWSFilter; 
    34 import com.scenari.xsldtm.xml.utils.FastStringBuffer; 
     34import com.scenari.xsldtm.xml.utils.FastStringBuilder; 
    3535import com.scenari.xsldtm.xml.utils.XMLString; 
    3636import com.scenari.xsldtm.xml.utils.XMLStringFactory; 
     
    108108        // text/comment table: string buffer to hold the text string values of the document, 
    109109        // each of which is addressed by the absolute offset and length in the buffer 
    110         private FastStringBuffer m_char = new FastStringBuffer(); 
     110        private FastStringBuilder m_char = new FastStringBuilder(); 
    111111        // Start of string currently being accumulated into m_char; 
    112112        // needed because the string may be appended in several chunks. 
     
    253253          * Set a reference pointer to the content-text repository 
    254254          * 
    255           * @param bufferRef FastStringBuffer reference to an instance of 
     255          * @param bufferRef FastStringBuilder reference to an instance of 
    256256          * buffer 
    257257          */ 
    258          void setContentBuffer(FastStringBuffer buffer) { 
     258         void setContentBuffer(FastStringBuilder buffer) { 
    259259                 m_char = buffer; 
    260260         } 
     
    263263          * Get a reference pointer to the content-text repository 
    264264          * 
    265           * @return FastStringBuffer reference to an instance of buffer 
     265          * @return FastStringBuilder reference to an instance of buffer 
    266266          */ 
    267          FastStringBuffer getContentBuffer() { 
     267         FastStringBuilder getContentBuffer() { 
    268268                 return m_char; 
    269269         } 
     
    372372    if(len!=m_char_current_start) 
    373373      { 
    374         // The FastStringBuffer has been previously agreed upon 
     374        // The FastStringBuilder has been previously agreed upon 
    375375        appendTextChild(m_char_current_start,len-m_char_current_start); 
    376376        m_char_current_start=len; 
     
    14071407         * underlying m_chars object may not store characters in a 
    14081408         * single contiguous array -- for example,the current 
    1409          * FastStringBuffer may split a single node's text across 
     1409         * FastStringBuilder may split a single node's text across 
    14101410         * multiple allocation units.  This call tells us how many 
    14111411         * separate accesses will be required to retrieve the entire 
     
    14361436         * the underlying m_chars object may not store characters in a 
    14371437         * single contiguous array -- for example,the current 
    1438          * FastStringBuffer may split a single node's text across 
     1438         * FastStringBuilder may split a single node's text across 
    14391439         * multiple allocation units.  This call retrieves a single 
    14401440         * contiguous portion of the text -- as much as m-chars was 
  • trunk/Res_ScXslt/com/scenari/xsldtm/xml/dtm/ref/dom2dtm/DOM2DTM.java

    r10215 r10372  
    4141import com.scenari.xsldtm.xml.res.XMLErrorResources; 
    4242import com.scenari.xsldtm.xml.res.XMLMessages; 
    43 import com.scenari.xsldtm.xml.utils.FastStringBuffer; 
     43import com.scenari.xsldtm.xml.utils.FastStringBuilder; 
    4444import com.scenari.xsldtm.xml.utils.QName; 
    45 import com.scenari.xsldtm.xml.utils.StringBufferPool; 
     45import com.scenari.xsldtm.xml.utils.StringBuilderPool; 
    4646import com.scenari.xsldtm.xml.utils.TreeWalker; 
    4747import com.scenari.xsldtm.xml.utils.XMLCharacterRecognizer; 
     
    817817    || DTM.DOCUMENT_FRAGMENT_NODE == type) 
    818818    { 
    819       FastStringBuffer buf = StringBufferPool.get(); 
     819      FastStringBuilder buf = StringBuilderPool.get(); 
    820820      String s; 
    821821   
     
    828828      finally 
    829829      { 
    830         StringBufferPool.free(buf); 
     830        StringBuilderPool.free(buf); 
    831831      } 
    832832   
     
    842842      // %REVIEW% DOM Level 3 is expected to add a "whole text" 
    843843      // retrieval method which performs this function for us. 
    844       FastStringBuffer buf = StringBufferPool.get(); 
     844      FastStringBuilder buf = StringBuilderPool.get(); 
    845845      while(node!=null) 
    846846      { 
     
    849849      } 
    850850      String s=(buf.length() > 0) ? buf.toString() : ""; 
    851       StringBufferPool.free(buf); 
     851      StringBuilderPool.free(buf); 
    852852      return m_xstrf.newstr( s ); 
    853853    } 
     
    876876      // %REVIEW% DOM Level 3 is expected to add a "whole text" 
    877877      // retrieval method which performs this function for us. 
    878       FastStringBuffer buf = StringBufferPool.get(); 
     878      FastStringBuilder buf = StringBuilderPool.get(); 
    879879      while(node!=null) 
    880880      { 
     
    883883      } 
    884884     boolean b = buf.isWhitespace(0, buf.length()); 
    885       StringBufferPool.free(buf); 
     885      StringBuilderPool.free(buf); 
    886886     return b; 
    887887    } 
     
    891891  /** 
    892892   * Retrieve the text content of a DOM subtree, appending it into a 
    893    * user-supplied FastStringBuffer object. Note that attributes are 
     893   * user-supplied FastStringBuilder object. Note that attributes are 
    894894   * not considered part of the content of an element. 
    895895   * <p> 
     
    908908   * @param node Node whose subtree is to be walked, gathering the 
    909909   * contents of all Text or CDATASection nodes. 
    910    * @param buf FastStringBuffer into which the contents of the text 
     910   * @param buf FastStringBuilder into which the contents of the text 
    911911   * nodes are to be concatenated. 
    912912   */ 
    913   protected static void getNodeData(Node node, FastStringBuffer buf) 
     913  protected static void getNodeData(Node node, FastStringBuilder buf) 
    914914  { 
    915915 
     
    12491249      return node.getNodeValue(); 
    12501250     
    1251     FastStringBuffer buf = StringBufferPool.get(); 
     1251    FastStringBuilder buf = StringBuilderPool.get(); 
    12521252        buf.append(node.getNodeValue()); 
    12531253    while(n!=null) 
     
    12571257    } 
    12581258    String s = (buf.length() > 0) ? buf.toString() : ""; 
    1259     StringBufferPool.free(buf); 
     1259    StringBuilderPool.free(buf); 
    12601260    return s; 
    12611261  } 
     
    16261626  /** 
    16271627   * Retrieve the text content of a DOM subtree, appending it into a 
    1628    * user-supplied FastStringBuffer object. Note that attributes are 
     1628   * user-supplied FastStringBuilder object. Note that attributes are 
    16291629   * not considered part of the content of an element. 
    16301630   * <p> 
     
    16431643   * @param node Node whose subtree is to be walked, gathering the 
    16441644   * contents of all Text or CDATASection nodes. 
    1645    * @param buf FastStringBuffer into which the contents of the text 
     1645   * @param buf FastStringBuilder into which the contents of the text 
    16461646   * nodes are to be concatenated. 
    16471647   */ 
  • trunk/Res_ScXslt/com/scenari/xsldtm/xml/dtm/ref/sax2dtm/SAX2DTM.java

    r10215 r10372  
    4747import com.scenari.xsldtm.xml.res.XMLErrorResources; 
    4848import com.scenari.xsldtm.xml.res.XMLMessages; 
    49 import com.scenari.xsldtm.xml.utils.FastStringBuffer; 
     49import com.scenari.xsldtm.xml.utils.FastStringBuilder; 
    5050import com.scenari.xsldtm.xml.utils.IntStack; 
    5151import com.scenari.xsldtm.xml.utils.IntVector; 
     
    8080   * Made protected rather than private so SAX2RTFDTM can access it. 
    8181   */ 
    82   //private FastStringBuffer m_chars = new FastStringBuffer(13, 13); 
    83   protected FastStringBuffer m_chars; 
     82  //private FastStringBuilder m_chars = new FastStringBuilder(13, 13); 
     83  protected FastStringBuilder m_chars; 
    8484 
    8585  /** This vector holds offset and length data. 
     
    266266      m_dataOrQName = new SuballocatedIntVector(blocksize, DEFAULT_NUMBLOCKS_SMALL); 
    267267      m_valuesOrPrefixes = new DTMStringPool(16); 
    268       m_chars = new FastStringBuffer(7, 10); 
     268      m_chars = new FastStringBuilder(7, 10); 
    269269      m_contextIndexes = new IntStack(4); 
    270270      m_parents = new IntStack(4); 
     
    275275      m_dataOrQName = new SuballocatedIntVector(blocksize, DEFAULT_NUMBLOCKS); 
    276276      m_valuesOrPrefixes = new DTMStringPool(); 
    277       m_chars = new FastStringBuffer(10, 13); 
     277      m_chars = new FastStringBuilder(10, 13); 
    278278      m_contextIndexes = new IntStack(); 
    279279      m_parents = new IntStack(); 
     
    528528 
    529529          if(normalize) 
    530             FastStringBuffer.sendNormalizedSAXcharacters(str.toCharArray(), 
     530            FastStringBuilder.sendNormalizedSAXcharacters(str.toCharArray(), 
    531531                                                         0, str.length(), ch); 
    532532          else 
  • trunk/Res_ScXslt/com/scenari/xsldtm/xml/dtm/ref/sax2dtm/SAX2DTM2.java

    r10215 r10372  
    3030import com.scenari.xsldtm.xml.res.XMLMessages; 
    3131import com.scenari.xsldtm.xml.serializer.SerializationHandler; 
    32 import com.scenari.xsldtm.xml.utils.FastStringBuffer; 
     32import com.scenari.xsldtm.xml.utils.FastStringBuilder; 
    3333import com.scenari.xsldtm.xml.utils.XMLString; 
    3434import com.scenari.xsldtm.xml.utils.XMLStringDefault; 
     
    29782978    if (child == DTM.NULL) return EMPTY_STR; 
    29792979       
    2980     // optimization: only create StringBuffer if > 1 child       
     2980    // optimization: only create StringBuilder if > 1 child       
    29812981    if ((_exptype2(child) == DTM.TEXT_NODE) && (_nextsib2(child) == DTM.NULL)) 
    29822982    { 
     
    31093109       
    31103110      if(normalize) 
    3111         FastStringBuffer.sendNormalizedSAXcharacters(str.toCharArray(), 
     3111        FastStringBuilder.sendNormalizedSAXcharacters(str.toCharArray(), 
    31123112                                                     0, str.length(), ch); 
    31133113      else 
  • trunk/Res_ScXslt/com/scenari/xsldtm/xml/serializer/ToStream.java

    r10215 r10372  
    3838import com.scenari.xsldtm.xml.res.XMLMessages; 
    3939import com.scenari.xsldtm.xml.utils.BoolStack; 
    40 import com.scenari.xsldtm.xml.utils.FastStringBuffer; 
     40import com.scenari.xsldtm.xml.utils.FastStringBuilder; 
    4141import com.scenari.xsldtm.xml.utils.QName; 
    4242import com.scenari.xsldtm.xml.utils.TreeWalker; 
     
    24692469            int l = s.length(); 
    24702470            boolean inCurly = false; 
    2471             FastStringBuffer buf = new FastStringBuffer(); 
     2471            FastStringBuilder buf = new FastStringBuilder(); 
    24722472 
    24732473            // parse through string, breaking on whitespaces.  I do this instead 
     
    27622762                m_writer.flush(); 
    27632763                 
    2764                 // make a StringBuffer to write the name="value" pairs to. 
    2765                 StringBuffer sb = new StringBuffer(); 
     2764                // make a StringBuilder to write the name="value" pairs to. 
     2765                StringBuilder sb = new StringBuilder(); 
    27662766                int nAttrs = m_attributes.getLength(); 
    27672767                if (nAttrs > 0) 
    27682768                { 
    27692769                    // make a writer that internally appends to the same 
    2770                     // StringBuffer 
     2770                    // StringBuilder 
    27712771                    java.io.Writer writer = 
    2772                         new ToStream.WritertoStringBuffer(sb); 
     2772                        new ToStream.WritertoStringBuilder(sb); 
    27732773 
    27742774                    processAttributes(writer, nAttrs); 
     
    27782778                } 
    27792779                sb.append('>');  // the potential > after the attributes. 
    2780                 // convert the StringBuffer to a char array and 
     2780                // convert the StringBuilder to a char array and 
    27812781                // emit the trace event that these characters "might" 
    27822782                // be written                 
     
    28052805     * the same code. 
    28062806     */ 
    2807     private class WritertoStringBuffer extends java.io.Writer 
    2808     { 
    2809         final private StringBuffer m_stringbuf; 
     2807    private class WritertoStringBuilder extends java.io.Writer 
     2808    { 
     2809        final private StringBuilder m_stringbuf; 
    28102810        /** 
    28112811         * @see java.io.Writer#write(char[], int, int) 
    28122812         */ 
    2813         WritertoStringBuffer(StringBuffer sb) 
     2813        WritertoStringBuilder(StringBuilder sb) 
    28142814        { 
    28152815            m_stringbuf = sb; 
  • trunk/Res_ScXslt/com/scenari/xsldtm/xml/serializer/ToUnknownStream.java

    r10215 r10372  
    12831283         
    12841284        if (m_tracer != null) { 
    1285             StringBuffer sb = new StringBuffer(); 
     1285            StringBuilder sb = new StringBuilder(); 
    12861286                 
    12871287            sb.append('<'); 
    12881288            sb.append(elementName); 
    12891289             
    1290             // convert the StringBuffer to a char array and 
     1290            // convert the StringBuilder to a char array and 
    12911291            // emit the trace event that these characters "might" 
    12921292            // be written 
  • trunk/Res_ScXslt/com/scenari/xsldtm/xml/utils/DOMHelper.java

    r10215 r10372  
    12281228  /** 
    12291229   * Get the textual contents of the node. See 
    1230    * getNodeData(Node,FastStringBuffer) for discussion of how 
     1230   * getNodeData(Node,FastStringBuilder) for discussion of how 
    12311231   * whitespace nodes are handled. 
    12321232   * 
     
    12341234   * @return String containing a concatenation of all the  
    12351235   * textual content within that node.  
    1236    * @see #getNodeData(Node,FastStringBuffer) 
     1236   * @see #getNodeData(Node,FastStringBuilder) 
    12371237   *  
    12381238   */ 
     
    12401240  { 
    12411241 
    1242     FastStringBuffer buf = StringBufferPool.get(); 
     1242    FastStringBuilder buf = StringBuilderPool.get(); 
    12431243    String s; 
    12441244 
     
    12511251    finally 
    12521252    { 
    1253       StringBufferPool.free(buf); 
     1253      StringBuilderPool.free(buf); 
    12541254    } 
    12551255 
     
    12591259  /** 
    12601260   * Retrieve the text content of a DOM subtree, appending it into a 
    1261    * user-supplied FastStringBuffer object. Note that attributes are 
     1261   * user-supplied FastStringBuilder object. Note that attributes are 
    12621262   * not considered part of the content of an element. 
    12631263   * <p> 
     
    12711271   * @param node Node whose subtree is to be walked, gathering the 
    12721272   * contents of all Text or CDATASection nodes. 
    1273    * @param buf FastStringBuffer into which the contents of the text 
     1273   * @param buf FastStringBuilder into which the contents of the text 
    12741274   * nodes are to be concatenated. 
    12751275   */ 
    1276   public static void getNodeData(Node node, FastStringBuffer buf) 
     1276  public static void getNodeData(Node node, FastStringBuilder buf) 
    12771277  { 
    12781278 
  • trunk/Res_ScXslt/com/scenari/xsldtm/xml/utils/FastStringBuilder.java

    r10215 r10372  
    1515 */ 
    1616/* 
    17  * $Id: FastStringBuffer.java,v 1.25 2004/02/17 04:21:14 minchau Exp $ 
     17 * $Id: FastStringBuilder.java,v 1.25 2004/02/17 04:21:14 minchau Exp $ 
    1818 */ 
    1919package com.scenari.xsldtm.xml.utils; 
     
    2222 * Bare-bones, unsafe, fast string buffer. No thread-safety, no 
    2323 * parameter range checking, exposed fields. Note that in typical 
    24  * applications, thread-safety of a StringBuffer is a somewhat 
     24 * applications, thread-safety of a StringBuilder is a somewhat 
    2525 * dubious concept in any case. 
    2626 * <p> 
    27  * Note that Stree and DTM used a single FastStringBuffer as a string pool, 
     27 * Note that Stree and DTM used a single FastStringBuilder as a string pool, 
    2828 * by recording start and length indices within this single buffer. This 
    2929 * minimizes heap overhead, but of course requires more work when retrieving 
    3030 * the data. 
    3131 * <p> 
    32  * FastStringBuffer operates as a "chunked buffer". Doing so 
     32 * FastStringBuilder operates as a "chunked buffer". Doing so 
    3333 * reduces the need to recopy existing information when an append 
    3434 * exceeds the space available; we just allocate another chunk and 
     
    4343 * <p> 
    4444 * %REVIEW% An experiment in self-tuning is 
    45  * included in the code (using nested FastStringBuffers to achieve 
     45 * included in the code (using nested FastStringBuilders to achieve 
    4646 * variation in chunk sizes), but this implementation has proven to 
    4747 * be problematic when data may be being copied from the FSB into itself. 
     
    5050 * <p> 
    5151 */ 
    52 public class FastStringBuffer 
     52public class FastStringBuilder 
    5353{ 
    5454  // If nonzero, forces the inial chunk size. 
     
    101101  /** 
    102102   * Field m_maxChunkBits affects our chunk-growth strategy, by saying what 
    103    * the largest permissible chunk size is in this particular FastStringBuffer 
     103   * the largest permissible chunk size is in this particular FastStringBuilder 
    104104   * hierarchy.  
    105105   */ 
     
    111111   * into the first chunk of the next size up. For example, if m_rechunkBits 
    112112   * is set to 3, then after 8 chunks at a given size we will rebundle 
    113    * them as the first element of a FastStringBuffer using a chunk size 
     113   * them as the first element of a FastStringBuilder using a chunk size 
    114114   * 8 times larger (chunkBits shifted left three bits). 
    115115   */ 
     
    143143   * Field m_lastChunk is an index into m_array[], pointing to the last 
    144144   * chunk of the Chunked Array currently in use. Note that additional 
    145    * chunks may actually be allocated, eg if the FastStringBuffer had 
     145   * chunks may actually be allocated, eg if the FastStringBuilder had 
    146146   * previously been truncated or if someone issued an ensureSpace request. 
    147147   * <p> 
     
    154154   * Field m_firstFree is an index into m_array[m_lastChunk][], pointing to 
    155155   * the first character in the Chunked Array which is not part of the 
    156    * FastStringBuffer's current content. Since m_array[][] is zero-based, 
     156   * FastStringBuilder's current content. Since m_array[][] is zero-based, 
    157157   * the length of that content can be calculated as 
    158158   * (m_lastChunk<<m_chunkBits) + m_firstFree  
     
    161161 
    162162  /** 
    163    * Field m_innerFSB, when non-null, is a FastStringBuffer whose total 
     163   * Field m_innerFSB, when non-null, is a FastStringBuilder whose total 
    164164   * length equals m_chunkSize, and which replaces m_array[0]. This allows 
    165    * building a hierarchy of FastStringBuffers, where early appends use 
     165   * building a hierarchy of FastStringBuilders, where early appends use 
    166166   * a smaller chunkSize (for less wasted memory overhead) but later 
    167167   * ones use a larger chunkSize (for less heap activity overhead). 
    168168   */ 
    169   FastStringBuffer m_innerFSB = null; 
    170  
    171   /** 
    172    * Construct a FastStringBuffer, with allocation policy as per parameters. 
     169  FastStringBuilder m_innerFSB = null; 
     170 
     171  /** 
     172   * Construct a FastStringBuilder, with allocation policy as per parameters. 
    173173   * <p> 
    174174   * For coding convenience, I've expressed both allocation sizes in terms of 
     
    191191   * advance before we attempt to take a step from initChunkBits to maxChunkBits 
    192192   */ 
    193   public FastStringBuffer(int initChunkBits, int maxChunkBits, 
     193  public FastStringBuilder(int initChunkBits, int maxChunkBits, 
    194194                          int rebundleBits) 
    195195  { 
     
    221221 
    222222  /** 
    223    * Construct a FastStringBuffer, using a default rebundleBits value. 
     223   * Construct a FastStringBuilder, using a default rebundleBits value. 
    224224   * 
    225225   * NEEDSDOC @param initChunkBits 
    226226   * NEEDSDOC @param maxChunkBits 
    227227   */ 
    228   public FastStringBuffer(int initChunkBits, int maxChunkBits) 
     228  public FastStringBuilder(int initChunkBits, int maxChunkBits) 
    229229  { 
    230230    this(initChunkBits, maxChunkBits, 2); 
     
    232232 
    233233  /** 
    234    * Construct a FastStringBuffer, using default maxChunkBits and 
     234   * Construct a FastStringBuilder, using default maxChunkBits and 
    235235   * rebundleBits values. 
    236236   * <p> 
     
    242242   * NEEDSDOC @param initChunkBits 
    243243   */ 
    244   public FastStringBuffer(int initChunkBits) 
     244  public FastStringBuilder(int initChunkBits) 
    245245  { 
    246246    this(initChunkBits, 15, 2); 
     
    248248 
    249249  /** 
    250    * Construct a FastStringBuffer, using a default allocation policy. 
    251    */ 
    252   public FastStringBuffer() 
     250   * Construct a FastStringBuilder, using a default allocation policy. 
     251   */ 
     252  public FastStringBuilder() 
    253253  { 
    254254 
     
    256256    // counts, so actual memory allocation unit is doubled for UTF-16 chars. 
    257257    // 
    258     // For reference: In the original FastStringBuffer, we simply 
     258    // For reference: In the original FastStringBuilder, we simply 
    259259    // overallocated by blocksize (default 1KB) on each buffer-growth. 
    260260    this(10, 15, 2); 
     
    264264   * Get the length of the list. Synonym for length(). 
    265265   * 
    266    * @return the number of characters in the FastStringBuffer's content. 
     266   * @return the number of characters in the FastStringBuilder's content. 
    267267   */ 
    268268  public final int size() 
     
    274274   * Get the length of the list. Synonym for size(). 
    275275   * 
    276    * @return the number of characters in the FastStringBuffer's content. 
     276   * @return the number of characters in the FastStringBuilder's content. 
    277277   */ 
    278278  public final int length() 
     
    282282 
    283283  /** 
    284    * Discard the content of the FastStringBuffer, and most of the memory 
     284   * Discard the content of the FastStringBuilder, and most of the memory 
    285285   * that was allocated by it, restoring the initial state. Note that this 
    286286   * may eventually be different from setLength(0), which see. 
     
    293293 
    294294    // Recover the original chunk size 
    295     FastStringBuffer innermost = this; 
     295    FastStringBuilder innermost = this; 
    296296 
    297297    while (innermost.m_innerFSB != null) 
     
    311311 
    312312  /** 
    313    * Directly set how much of the FastStringBuffer's storage is to be 
     313   * Directly set how much of the FastStringBuilder's storage is to be 
    314314   * considered part of its content. This is a fast but hazardous 
    315315   * operation. It is not protected against negative values, or values 
    316316   * greater than the amount of storage currently available... and even 
    317317   * if additional storage does exist, its contents are unpredictable. 
    318    * The only safe use for our setLength() is to truncate the FastStringBuffer 
     318   * The only safe use for our setLength() is to truncate the FastStringBuilder 
    319319   * to a shorter string. 
    320320   * 
     
    355355   * NEEDSDOC @param rootFSB 
    356356   */ 
    357   private final void setLength(int l, FastStringBuffer rootFSB) 
     357  private final void setLength(int l, FastStringBuilder rootFSB) 
    358358  { 
    359359 
     
    388388   * directly from an array of arrays and hence a double copy is needed. 
    389389   * By using ensureCapacity we hope to minimize the heap overhead of building 
    390    * the intermediate StringBuffer. 
     390   * the intermediate StringBuilder. 
    391391   * <p> 
    392392   * (It really is a pity that Java didn't design String as a final subclass 
    393    * of MutableString, rather than having StringBuffer be a separate hierarchy. 
     393   * of MutableString, rather than having StringBuilder be a separate hierarchy. 
    394394   * We'd avoid a <strong>lot</strong> of double-buffering.) 
    395395   * 
    396    * @return the contents of the FastStringBuffer as a standard Java string. 
     396   * @return the contents of the FastStringBuilder as a standard Java string. 
    397397   */ 
    398398  public final String toString() 
     
    401401    int length = (m_lastChunk << m_chunkBits) + m_firstFree; 
    402402 
    403     return getString(new StringBuffer(length), 0, 0, length).toString(); 
    404   } 
    405  
    406   /** 
    407    * Append a single character onto the FastStringBuffer, growing the 
     403    return getString(new StringBuilder(length), 0, 0, length).toString(); 
     404  } 
     405 
     406  /** 
     407   * Append a single character onto the FastStringBuilder, growing the 
    408408   * storage if necessary. 
    409409   * <p> 
     
    449449          // Should do all the work of both encapsulating 
    450450          // existing data and establishing new sizes/offsets 
    451           m_innerFSB = new FastStringBuffer(this); 
     451          m_innerFSB = new FastStringBuilder(this); 
    452452        } 
    453453 
     
    464464 
    465465  /** 
    466    * Append the contents of a String onto the FastStringBuffer, 
     466   * Append the contents of a String onto the FastStringBuilder, 
    467467   * growing the storage if necessary. 
    468468   * <p> 
     
    529529            // Should do all the work of both encapsulating 
    530530            // existing data and establishing new sizes/offsets 
    531             m_innerFSB = new FastStringBuffer(this); 
     531            m_innerFSB = new FastStringBuilder(this); 
    532532          } 
    533533 
     
    546546 
    547547  /** 
    548    * Append the contents of a StringBuffer onto the FastStringBuffer, 
     548   * Append the contents of a StringBuilder onto the FastStringBuilder, 
    549549   * growing the storage if necessary. 
    550550   * <p> 
     
    552552   * references to m_array[] may no longer be valid. 
    553553   * 
    554    * @param value StringBuffer whose contents are to be appended. 
    555    */ 
    556   public final void append(StringBuffer value) 
     554   * @param value StringBuilder whose contents are to be appended. 
     555   */ 
     556  public final void append(StringBuilder value) 
    557557  { 
    558558 
     
    611611            // Should do all the work of both encapsulating 
    612612            // existing data and establishing new sizes/offsets 
    613             m_innerFSB = new FastStringBuffer(this); 
     613            m_innerFSB = new FastStringBuilder(this); 
    614614          } 
    615615 
     
    629629  /** 
    630630   * Append part of the contents of a Character Array onto the 
    631    * FastStringBuffer,  growing the storage if necessary. 
     631   * FastStringBuilder,  growing the storage if necessary. 
    632632   * <p> 
    633633   * NOTE THAT after calling append(), previously obtained 
     
    694694            // Should do all the work of both encapsulating 
    695695            // existing data and establishing new sizes/offsets 
    696             m_innerFSB = new FastStringBuffer(this); 
     696            m_innerFSB = new FastStringBuilder(this); 
    697697          } 
    698698 
     
    711711 
    712712  /** 
    713    * Append the contents of another FastStringBuffer onto 
    714    * this FastStringBuffer, growing the storage if necessary. 
     713   * Append the contents of another FastStringBuilder onto 
     714   * this FastStringBuilder, growing the storage if necessary. 
    715715   * <p> 
    716716   * NOTE THAT after calling append(), previously obtained 
    717717   * references to m_array[] may no longer be valid. 
    718718   * 
    719    * @param value FastStringBuffer whose contents are 
     719   * @param value FastStringBuilder whose contents are 
    720720   * to be appended. 
    721721   */ 
    722   public final void append(FastStringBuffer value) 
     722  public final void append(FastStringBuilder value) 
    723723  { 
    724724 
     
    794794            // Should do all the work of both encapsulating 
    795795            // existing data and establishing new sizes/offsets 
    796             m_innerFSB = new FastStringBuffer(this); 
     796            m_innerFSB = new FastStringBuilder(this); 
    797797          } 
    798798 
     
    864864      return getOneChunkString(startChunk, startColumn, length); 
    865865    } 
    866     return getString(new StringBuffer(length), startChunk, startColumn, 
     866    return getString(new StringBuilder(length), startChunk, startColumn, 
    867867                     length).toString();