Changeset 10372
- Timestamp:
- 01/23/08 19:45:25 (4 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 205 edited
- 4 moved
-
Jav_Audio/com/scenari/s/audio/Util.java (modified) (1 diff)
-
Jav_Audio/com/scenari/s/audio/transform/TransformerSox.java (modified) (1 diff)
-
Jav_BDP/com/scenari/m/bdp/facet/chain/FacetChainLoader.java (modified) (2 diffs)
-
Jav_BDP/com/scenari/m/bdp/facet/outline/FacetOutline.java (modified) (1 diff)
-
Jav_BDP/com/scenari/m/bdp/item/HQCode.java (modified) (6 diffs)
-
Jav_BDP/com/scenari/m/bdp/item/IWReqItemJdbc.java (modified) (4 diffs)
-
Jav_BDP/com/scenari/m/bdp/item/base/HItem.java (modified) (1 diff)
-
Jav_BDP/com/scenari/m/bdp/itemtype/XItemTypeSaxHandler.java (modified) (1 diff)
-
Jav_BDP/com/scenari/m/bdp/module/genitem/HModuleGenItemBeanshellLoader.java (modified) (1 diff)
-
Jav_BDP/com/scenari/m/bdp/module/genpresc/HModuleGenPrescWsp.java (modified) (3 diffs)
-
Jav_BDP/com/scenari/m/bdp/module/rename/uii/WRenamedUiiStream.java (modified) (1 diff)
-
Jav_BDP/com/scenari/m/bdp/module/viewvirtualfolder/HVirtualFolder.java (modified) (4 diffs)
-
Jav_BDP/com/scenari/m/bdp/service/tabpresc/HSDialogTabPresc.java (modified) (2 diffs)
-
Jav_BDP/com/scenari/m/bdp/service/tabsupport/HSDialogTabSupport.java (modified) (2 diffs)
-
Jav_BDP/com/scenari/m/bdp/service/viewfiles/HFileZipper.java (modified) (1 diff)
-
Jav_BDP/com/scenari/m/bdp/source/WSourceBdpItem.java (modified) (1 diff)
-
Jav_BDP/com/scenari/m/bdp/source/WSourceBdpSpace.java (modified) (1 diff)
-
Jav_BDP/com/scenari/m/bdp/univers/support/WInstancesMgrBdp.java (modified) (2 diffs)
-
Jav_BDP_FS/com/scenari/m/bdp/item/fs/FacetCache.java (modified) (3 diffs)
-
Jav_BDP_FS/com/scenari/m/bdp/item/fs/HRepositoryFs2.java (modified) (5 diffs)
-
Jav_BDP_FS/com/scenari/m/bdp/item/fs/HRepositoryFsAsp.java (modified) (1 diff)
-
Jav_BDP_FS/com/scenari/m/bdp/item/fs/HWorkspaceFs.java (modified) (2 diffs)
-
Jav_BDP_FS/com/scenari/m/bdp/item/fs/XItemCache.java (modified) (9 diffs)
-
Jav_BDP_FS/com/scenari/m/bdp/item/fs/XSpace.java (modified) (5 diffs)
-
Jav_BDP_FS/com/scenari/m/bdp/item/fs/XSpaceSystem.java (modified) (1 diff)
-
Jav_BDP_FS/com/scenari/m/bdp/itemtype/fs/XItemTypeFsSaxHandler.java (modified) (1 diff)
-
Jav_Builder/com/scenari/m/builder/gen/HModelGenerator.java (modified) (6 diffs)
-
Jav_Builder/com/scenari/m/builder/gen/XhtmlXslTemplatePage.java (modified) (2 diffs)
-
Jav_Builder/com/scenari/m/builder/xpath/dom/ZXPathBuildGUID.java (modified) (1 diff)
-
Jav_Builder/com/scenari/m/builder/xpath/dom/ZXPathEncodeNameOd.java (modified) (1 diff)
-
Jav_Builder/com/scenari/m/builder/xpath/dom/ZXPathListXmlFromBuffer.java (modified) (1 diff)
-
Jav_CO/Description fonctions XPath.xml (modified) (1 diff)
-
Jav_CO/com/scenari/m/co/agent/HADialog.java (modified) (1 diff)
-
Jav_CO/com/scenari/m/co/composant/HComposantTypeLoader.java (modified) (2 diffs)
-
Jav_CO/com/scenari/m/co/composant/WComposant.java (modified) (1 diff)
-
Jav_CO/com/scenari/m/co/context/HContextInteractif.java (modified) (5 diffs)
-
Jav_CO/com/scenari/m/co/context/IHContextBuffers.java (modified) (2 diffs)
-
Jav_CO/com/scenari/m/co/dialog/webdav/WResultatOptions.java (modified) (1 diff)
-
Jav_CO/com/scenari/m/co/donnee/WDonneeFixeSystemProps.java (modified) (1 diff)
-
Jav_CO/com/scenari/m/co/donnee/WDonneeXPath.java (modified) (2 diffs)
-
Jav_CO/com/scenari/m/co/donnee/WDonneeXslMonoTemplate.java (modified) (1 diff)
-
Jav_CO/com/scenari/m/co/donnee/XSaxHandlerDonnees.java (modified) (3 diffs)
-
Jav_CO/com/scenari/m/co/donnee/XSaxHandlerToDom.java (modified) (1 diff)
-
Jav_CO/com/scenari/m/co/donnee/XSaxHandlerToXml.java (modified) (3 diffs)
-
Jav_CO/com/scenari/m/co/donnee/composition/XCompositionSaxHandler.java (modified) (10 diffs)
-
Jav_CO/com/scenari/m/co/donnee/externe/XSInitDonneeSaxHandler.java (modified) (4 diffs)
-
Jav_CO/com/scenari/m/co/donnee/inclusion/WDonneeInclusionDynamique.java (modified) (2 diffs)
-
Jav_CO/com/scenari/m/co/donnee/inclusion/XWriter.java (modified) (4 diffs)
-
Jav_CO/com/scenari/m/co/service/HServiceLoader.java (modified) (2 diffs)
-
Jav_CO/com/scenari/m/co/service/WService.java (modified) (1 diff)
-
Jav_CO/com/scenari/m/co/univers/HContextExecHttpServlet.java (modified) (8 diffs)
-
Jav_CO/com/scenari/m/co/univers/HInstanceDef.java (modified) (1 diff)
-
Jav_CO/com/scenari/m/co/univers/XParamUniversSaxHandler.java (modified) (1 diff)
-
Jav_CO/com/scenari/m/co/univers/wsp/WContenuMgrWsp.java (modified) (3 diffs)
-
Jav_CO/com/scenari/m/co/univers/wsp/XFcSaxHandler.java (modified) (1 diff)
-
Jav_CO/com/scenari/m/co/user/fs/XUserSaxHandler.java (modified) (1 diff)
-
Jav_CO/com/scenari/m/co/xpath/dom/ZXPath.java (modified) (2 diffs)
-
Jav_CO/com/scenari/m/co/xpath/dom/ZXPathChaineProtegeAttHtml.java (modified) (1 diff)
-
Jav_CO/com/scenari/m/co/xpath/dom/ZXPathChaineProtegeJs.java (modified) (1 diff)
-
Jav_CO/com/scenari/m/co/xpath/dom/ZXPathConcatExpr.java (modified) (1 diff)
-
Jav_CO/com/scenari/m/co/xpath/dom/ZXPathEscapeXslAtt.java (modified) (1 diff)
-
Jav_CO/com/scenari/m/co/xpath/dom/ZXPathIdNode.java (modified) (2 diffs)
-
Jav_CO/com/scenari/m/co/xpath/dom/ZXPathListXml.java (modified) (2 diffs)
-
Jav_CO/com/scenari/m/co/xpath/dom/ZXPathListXmlExpr.java (modified) (2 diffs)
-
Jav_CO/com/scenari/m/co/xpath/dtm/ZXPathChaineProtegeAttHtml.java (modified) (1 diff)
-
Jav_CO/com/scenari/m/co/xpath/dtm/ZXPathChaineProtegeJs.java (modified) (1 diff)
-
Jav_CO/com/scenari/m/co/xpath/dtm/ZXPathConcatExpr.java (modified) (1 diff)
-
Jav_CO/com/scenari/m/co/xpath/dtm/ZXPathListXml.java (modified) (2 diffs)
-
Jav_CO/com/scenari/m/co/xpath/dtm/ZXPathListXmlExpr.java (modified) (2 diffs)
-
Jav_CO/com/scenari/s/co/source/HRootSourceLoader.java (modified) (1 diff)
-
Jav_CO/com/scenari/s/co/source/HSource.java (modified) (1 diff)
-
Jav_CO/com/scenari/s/co/source/HZipper.java (modified) (1 diff)
-
Jav_CO/com/scenari/s/co/source/fs/HSourceFs.java (modified) (3 diffs)
-
Jav_CO/com/scenari/s/co/sourcerel/WSourceRel.java (modified) (1 diff)
-
Jav_CO/com/scenari/s/co/sourcerel/WSourceRelFrontEnd.java (modified) (1 diff)
-
Jav_CO/com/scenari/s/co/sourcerel/WSourceRelFrontEndWithRights.java (modified) (1 diff)
-
Jav_CO/com/scenari/s/co/transform/HTransformParams.java (modified) (6 diffs)
-
Jav_CO/com/scenari/s/co/transform/xml/HTransformerPonctuation.java (modified) (2 diffs)
-
Jav_FW/com/scenari/c/fw/main/EServletModelXml.java (modified) (1 diff)
-
Jav_FW/com/scenari/s/fw/enumeration/WView.java (modified) (1 diff)
-
Jav_FW/com/scenari/s/fw/log/HLogMessage.java (modified) (5 diffs)
-
Jav_FW/com/scenari/s/fw/log/IHLogMessage.java (modified) (2 diffs)
-
Jav_FW/com/scenari/s/fw/mem/HMemoryMgr.java (modified) (1 diff)
-
Jav_FW/com/scenari/s/fw/pooljdbc/HPoolMySql.java (modified) (1 diff)
-
Jav_FW/com/scenari/s/fw/properties/HTextFileWriter.java (modified) (3 diffs)
-
Jav_FW/com/scenari/s/fw/properties/loaders/xml/XAloneSaxHandler.java (modified) (1 diff)
-
Jav_FW/com/scenari/s/fw/properties/loaders/xml/XLogParamSaxHandler.java (modified) (1 diff)
-
Jav_FW/com/scenari/s/fw/properties/stringlist/HStringListLoaderFromTextFile.java (modified) (3 diffs)
-
Jav_FW/com/scenari/s/fw/properties/stringlist/HStringListProperties.java (modified) (2 diffs)
-
Jav_FW/com/scenari/s/fw/util/xml/HEncodingXml.java (modified) (2 diffs)
-
Jav_FW/com/scenari/s/fw/util/xml/HExtraitSaxHandlerToText.java (modified) (11 diffs)
-
Jav_FW/com/scenari/s/fw/util/xml/HExtraitSaxHandlerToXml.java (modified) (11 diffs)
-
Jav_FW/com/scenari/s/fw/util/xml/HSaxHandlerToXml.java (modified) (12 diffs)
-
Jav_FW/com/scenari/s/fw/util/xml/HXmlWriterSB.java (modified) (1 diff)
-
Jav_FW/com/scenari/s/fw/utils/HCharSeqUtil.java (modified) (1 diff)
-
Jav_FW/com/scenari/s/fw/utils/HParamsQueryString.java (modified) (5 diffs)
-
Jav_FW/com/scenari/s/fw/utils/HPoolBuffer.java (modified) (4 diffs)
-
Jav_FW/com/scenari/s/fw/utils/HStringBuffer.java (deleted)
-
Jav_FW/com/scenari/s/fw/utils/HUrl.java (modified) (2 diffs)
-
Jav_FW/com/scenari/s/fw/utils/stream/HBufferStreamChar.java (modified) (1 diff)
-
Jav_FW/com/scenari/s/fw/utils/stream/HStream.java (modified) (3 diffs)
-
Jav_GE/com/scenari/m/ge/agent/HADialogExport.java (modified) (13 diffs)
-
Jav_GE/com/scenari/m/ge/agent/HAgentExport.java (modified) (6 diffs)
-
Jav_GE/com/scenari/m/ge/agent/IWADialogExport.java (modified) (2 diffs)
-
Jav_GE/com/scenari/m/ge/agent/OutlineWalker.java (modified) (1 diff)
-
Jav_GE/com/scenari/m/ge/agent/callgen/HDialogCallGen.java (modified) (3 diffs)
-
Jav_GE/com/scenari/m/ge/agent/grouppages/HDialogGroupPages.java (modified) (2 diffs)
-
Jav_GE/com/scenari/m/ge/agent/pages/HDialogPages.java (modified) (4 diffs)
-
Jav_GE/com/scenari/m/ge/agent/scenario/HDialogScenario.java (modified) (6 diffs)
-
Jav_GE/com/scenari/m/ge/composant/scenario/WComposantScenario.java (modified) (1 diff)
-
Jav_GE/com/scenari/m/ge/composant/scenario/XNoeud.java (modified) (5 diffs)
-
Jav_GE/com/scenari/m/ge/composant/scenario/XNoeudFinal.java (modified) (3 diffs)
-
Jav_GE/com/scenari/m/ge/composant/scenario/XNoeudInit.java (modified) (3 diffs)
-
Jav_GE/com/scenari/m/ge/composant/scenario/XNoeudInteractif.java (modified) (3 diffs)
-
Jav_GE/com/scenari/m/ge/composant/scenario/XNoeudListe.java (modified) (3 diffs)
-
Jav_GE/com/scenari/m/ge/composant/scenario/XNoeudSingleton.java (modified) (3 diffs)
-
Jav_GE/com/scenari/m/ge/composant/scenario/XTransition.java (modified) (2 diffs)
-
Jav_GE/com/scenari/m/ge/context/HContextGenerator.java (modified) (1 diff)
-
Jav_GE/com/scenari/m/ge/generateur/GeneratorBase.java (modified) (11 diffs)
-
Jav_GE/com/scenari/m/ge/generateur/IScripter.java (modified) (2 diffs)
-
Jav_GE/com/scenari/m/ge/generateur/ScripterDefault.java (modified) (4 diffs)
-
Jav_GE/com/scenari/m/ge/generateur/ScripterJs.java (modified) (4 diffs)
-
Jav_GE/com/scenari/m/ge/generator/web/ScripterUrl.java (modified) (4 diffs)
-
Jav_GE/com/scenari/m/ge/generator/web/WebGenerator.java (modified) (3 diffs)
-
Jav_GE/com/scenari/m/ge/pages/DynamicInclWriter.java (modified) (3 diffs)
-
Jav_GE/com/scenari/m/ge/pages/TplXslPage.java (modified) (4 diffs)
-
Jav_GE/com/scenari/m/ge/xpath/dom/ZXPathIdExportAgentHier.java (modified) (1 diff)
-
Jav_GE/com/scenari/m/ge/xpath/dom/builder/ZXPathGetContent.java (modified) (1 diff)
-
Jav_GE/com/scenari/m/ge/xpath/dom/builder/ZXPathGetFullTitleText.java (modified) (1 diff)
-
Jav_GE/com/scenari/m/ge/xpath/dom/builder/ZXPathGetShortTitleText.java (modified) (1 diff)
-
Jav_GE/com/scenari/m/ge/xpath/dom/builder/ZXPathGetUrl.java (modified) (1 diff)
-
Jav_GE/com/scenari/m/ge/xpath/dom/builder/ZXPathGetView.java (modified) (1 diff)
-
Jav_GE/com/scenari/m/ge/xpath/dom/builder/ZXPathSwitchAxis.java (modified) (1 diff)
-
Jav_GE/com/scenari/m/ge/xpath/dtm/ZXPathIdExportAgentHier.java (modified) (1 diff)
-
Jav_GE/com/scenari/s/ge/javascript/HJavascriptUtil.java (modified) (2 diffs)
-
Res_ScXmlParser/com/bluecast/xml/Piccolo.java (modified) (1 diff)
-
Res_ScXmlParser/com/bluecast/xml/Piccolo.y (modified) (1 diff)
-
Res_ScXmlParser/com/scenari/entitymap/GeneralEntitiesMap.java (modified) (1 diff)
-
Res_ScXmlSerializer/com/scenari/xerces/serialize/BaseMarkupSerializer.java (modified) (1 diff)
-
Res_ScXmlSerializer/com/scenari/xerces/serialize/IndentPrinter.java (modified) (9 diffs)
-
Res_ScXmlSerializer/com/scenari/xerces/serialize/NamespaceSupport.java (modified) (1 diff)
-
Res_ScXmlSerializer/com/scenari/xerces/serialize/Printer.java (modified) (1 diff)
-
Res_ScXmlSerializer/com/scenari/xerces/serialize/XMLSerializer.java (modified) (1 diff)
-
Res_ScXslt/com/scenari/xsldom/xalan/extensions/MethodResolver.java (modified) (1 diff)
-
Res_ScXslt/com/scenari/xsldom/xalan/processor/CompiledStylesheetBundle.java (modified) (1 diff)
-
Res_ScXslt/com/scenari/xsldom/xalan/processor/CompilingStylesheetHandler.java (modified) (12 diffs)
-
Res_ScXslt/com/scenari/xsldom/xalan/processor/ProcessorCharacters.java (modified) (1 diff)
-
Res_ScXslt/com/scenari/xsldom/xalan/processor/XSLTAttributeDef.java (modified) (1 diff)
-
Res_ScXslt/com/scenari/xsldom/xalan/stree/DocImpl.java (modified) (5 diffs)
-
Res_ScXslt/com/scenari/xsldom/xalan/stree/TextImpl.java (modified) (4 diffs)
-
Res_ScXslt/com/scenari/xsldom/xalan/templates/AVT.java (modified) (7 diffs)
-
Res_ScXslt/com/scenari/xsldom/xalan/templates/AVTPart.java (modified) (2 diffs)
-
Res_ScXslt/com/scenari/xsldom/xalan/templates/AVTPartSimple.java (modified) (2 diffs)
-
Res_ScXslt/com/scenari/xsldom/xalan/templates/AVTPartXPath.java (modified) (2 diffs)
-
Res_ScXslt/com/scenari/xsldom/xalan/templates/ElemNumber.java (modified) (7 diffs)
-
Res_ScXslt/com/scenari/xsldom/xalan/templates/OutputProperties.java (modified) (3 diffs)
-
Res_ScXslt/com/scenari/xsldom/xalan/xslt/EnvironmentCheck.java (modified) (2 diffs)
-
Res_ScXslt/com/scenari/xsldom/xml/utils/FastStringBuilder.java (moved) (moved from trunk/Res_ScXslt/com/scenari/xsldom/xml/utils/FastStringBuffer.java) (33 diffs)
-
Res_ScXslt/com/scenari/xsldom/xml/utils/StringBuilderPool.java (moved) (moved from trunk/Res_ScXslt/com/scenari/xsldom/xml/utils/StringBufferPool.java) (3 diffs)
-
Res_ScXslt/com/scenari/xsldom/xml/utils/URI.java (modified) (3 diffs)
-
Res_ScXslt/com/scenari/xsldom/xml/utils/XMLCharacterRecognizer.java (modified) (2 diffs)
-
Res_ScXslt/com/scenari/xsldom/xml/utils/synthetic/Class.java (modified) (4 diffs)
-
Res_ScXslt/com/scenari/xsldom/xml/utils/synthetic/reflection/EntryPoint.java (modified) (5 diffs)
-
Res_ScXslt/com/scenari/xsldom/xml/utils/synthetic/reflection/Field.java (modified) (1 diff)
-
Res_ScXslt/com/scenari/xsldom/xpath/DOMHelper.java (modified) (7 diffs)
-
Res_ScXslt/com/scenari/xsldom/xpath/functions/FuncConcat.java (modified) (1 diff)
-
Res_ScXslt/com/scenari/xsldom/xpath/functions/FuncTranslate.java (modified) (1 diff)
-
Res_ScXslt/com/scenari/xsldtm/xalan/extensions/MethodResolver.java (modified) (2 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xalan/lib/ExsltBase.java (modified) (1 diff)
-
Res_ScXslt/com/scenari/xsldtm/xalan/lib/ExsltDatetime.java (modified) (2 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xalan/lib/ExsltStrings.java (modified) (2 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xalan/processor/ProcessorCharacters.java (modified) (1 diff)
-
Res_ScXslt/com/scenari/xsldtm/xalan/processor/XSLTAttributeDef.java (modified) (6 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xalan/templates/AVT.java (modified) (7 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xalan/templates/AVTPart.java (modified) (2 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xalan/templates/AVTPartSimple.java (modified) (2 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xalan/templates/AVTPartXPath.java (modified) (2 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xalan/templates/ElemNumber.java (modified) (7 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xalan/templates/OutputProperties.java (modified) (3 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xalan/xslt/EnvironmentCheck.java (modified) (2 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xml/dtm/DTM.java (modified) (1 diff)
-
Res_ScXslt/com/scenari/xsldtm/xml/dtm/DTMException.java (modified) (2 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xml/dtm/ref/DTMDefaultBase.java (modified) (1 diff)
-
Res_ScXslt/com/scenari/xsldtm/xml/dtm/ref/DTMDocumentImpl.java (modified) (7 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xml/dtm/ref/dom2dtm/DOM2DTM.java (modified) (13 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xml/dtm/ref/sax2dtm/SAX2DTM.java (modified) (5 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xml/dtm/ref/sax2dtm/SAX2DTM2.java (modified) (3 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xml/serializer/ToStream.java (modified) (5 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xml/serializer/ToUnknownStream.java (modified) (1 diff)
-
Res_ScXslt/com/scenari/xsldtm/xml/utils/DOMHelper.java (modified) (6 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xml/utils/FastStringBuilder.java (moved) (moved from trunk/Res_ScXslt/com/scenari/xsldtm/xml/utils/FastStringBuffer.java) (42 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xml/utils/ListingErrorHandler.java (modified) (1 diff)
-
Res_ScXslt/com/scenari/xsldtm/xml/utils/StringBuilderPool.java (moved) (moved from trunk/Res_ScXslt/com/scenari/xsldtm/xml/utils/StringBufferPool.java) (4 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xml/utils/SystemIDResolver.java (modified) (1 diff)
-
Res_ScXslt/com/scenari/xsldtm/xml/utils/URI.java (modified) (3 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xml/utils/XMLCharacterRecognizer.java (modified) (2 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xml/utils/XMLString.java (modified) (1 diff)
-
Res_ScXslt/com/scenari/xsldtm/xml/utils/XMLStringFactory.java (modified) (1 diff)
-
Res_ScXslt/com/scenari/xsldtm/xml/utils/XMLStringFactoryDefault.java (modified) (2 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xpath/axes/WalkerFactory.java (modified) (1 diff)
-
Res_ScXslt/com/scenari/xsldtm/xpath/functions/FuncConcat.java (modified) (1 diff)
-
Res_ScXslt/com/scenari/xsldtm/xpath/functions/FuncTranslate.java (modified) (1 diff)
-
Res_ScXslt/com/scenari/xsldtm/xpath/objects/XMLStringFactoryImpl.java (modified) (3 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xpath/objects/XNodeSet.java (modified) (1 diff)
-
Res_ScXslt/com/scenari/xsldtm/xpath/objects/XObject.java (modified) (1 diff)
-
Res_ScXslt/com/scenari/xsldtm/xpath/objects/XRTreeFrag.java (modified) (1 diff)
-
Res_ScXslt/com/scenari/xsldtm/xpath/objects/XStringForChars.java (modified) (5 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xpath/objects/XStringForFSB.java (modified) (16 diffs)
-
Res_ScXslt/com/scenari/xsldtm/xpath/patterns/StepPattern.java (modified) (1 diff)
-
Res_ScXslt/com/scenari/xsldtm/xpath/res/XPATHErrorResources.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Jav_Audio/com/scenari/s/audio/Util.java
r6863 r10372 109 109 */ 110 110 public static String joinMap(List pList, List pKeys, List pValues) { 111 StringBu ffer vBuf = new StringBuffer();111 StringBuilder vBuf = new StringBuilder(); 112 112 for (int i = 0; i < pList.size(); i++) { 113 113 Object vKey = pList.get(i); -
trunk/Jav_Audio/com/scenari/s/audio/transform/TransformerSox.java
r9961 r10372 161 161 } 162 162 if(vH == null && vM == null) return Float.toString(pTc); 163 StringBu ffer vBuf = new StringBuffer(12);163 StringBuilder vBuf = new StringBuilder(12); 164 164 if(vH != null) { 165 165 vBuf.append(vH); -
trunk/Jav_BDP/com/scenari/m/bdp/facet/chain/FacetChainLoader.java
r10215 r10372 125 125 protected ArrayList fListAlreadyImported = null; 126 126 127 protected StringBu ffer fBuf = null;127 protected StringBuilder fBuf = null; 128 128 129 129 /** … … 203 203 // 204 204 else if (TAG_BEANSHELL.equals(pLocalName)) { 205 fBuf = new StringBu ffer(4096);205 fBuf = new StringBuilder(4096); 206 206 } 207 207 -
trunk/Jav_BDP/com/scenari/m/bdp/facet/outline/FacetOutline.java
r10086 r10372 215 215 if (pIdSubItem != null && pIdSubItem.length() > 0) vTransf.setParameter("pIdSubItem", pIdSubItem); 216 216 InputStream vSream = vWsp.hGetRepository().hGetContentAccess().hReadStream(pItemDef.hGetId(), null, null, null, null); 217 //StringBu ffer vBufUrl = new StringBuffer(pItemDef.hGetSpace().length()+pItemDef.hGetCode().length()+20);217 //StringBuilder vBufUrl = new StringBuilder(pItemDef.hGetSpace().length()+pItemDef.hGetCode().length()+20); 218 218 //vBufUrl.append("intern://"); 219 219 //HQCode.hBuildURL(vBufUrl, pItemDef.hGetSpace(), pItemDef.hGetCode()); -
trunk/Jav_BDP/com/scenari/m/bdp/item/HQCode.java
r8485 r10372 111 111 */ 112 112 public static final String hGetUri(String pSpace, String pCode) { 113 return new StringBu ffer(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(); 114 114 } 115 115 … … 216 216 return pSuffixe; 217 217 } 218 StringBu ffer vBuf = new StringBuffer(pStr.length() + pSuffixe.length() + 2);218 StringBuilder vBuf = new StringBuilder(pStr.length() + pSuffixe.length() + 2); 219 219 if(pStr.indexOf('%') >= 0 || pStr.indexOf('_') >= 0) { 220 220 for (int i = 0; i < pStr.length(); i++) { … … 253 253 * 254 254 * Note : Le caractère simple guillement (') EST protégé. Le chaine ajoutée 255 * au StringBu ffer ne peut donc être utilisé QUE "en dur" dans un statement255 * au StringBuilder ne peut donc être utilisé QUE "en dur" dans un statement 256 256 * et PAS en paramètre dynamique dans un prepareStatement. 257 257 * 258 258 * @param pStr Code à protéger 259 259 */ 260 public static final void hEscapeCodeInSql(StringBu ffer pBuf, String pStr, String pSuffixe) {260 public static final void hEscapeCodeInSql(StringBuilder pBuf, String pStr, String pSuffixe) { 261 261 if(pStr == null || pStr.length() == 0) { 262 262 if(pSuffixe!= null) pBuf.append(pSuffixe); … … 299 299 * @since 3.0 300 300 */ 301 public static final void hBuildUri(StringBu ffer pBuf, String pSpace, String pCode) {301 public static final void hBuildUri(StringBuilder pBuf, String pSpace, String pCode) { 302 302 pBuf.append(URI_SEPARATOR); 303 303 pBuf.append(pSpace); … … 312 312 * @since 3.0 313 313 */ 314 public static final void hBuildUri(StringBu ffer 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) { 315 315 pBuf.append(URI_SEPARATOR); 316 316 pBuf.append(pSpace); … … 334 334 if(pUriRes!=null) vLen += pUriRes.length(); 335 335 if(pIdSubItem!=null) vLen += pIdSubItem.length(); 336 StringBu ffer vBuf = new StringBuffer(vLen);336 StringBuilder vBuf = new StringBuilder(vLen); 337 337 hBuildUri(vBuf, pSpace, pCode, pUriRes, pIdSubItem); 338 338 return vBuf.toString(); -
trunk/Jav_BDP/com/scenari/m/bdp/item/IWReqItemJdbc.java
r1701 r10372 57 57 * @throws Exception 58 58 */ 59 public void wWriteClauseFrom(StringBu ffer pBuf, IHRepository pRepository) throws Exception;59 public void wWriteClauseFrom(StringBuilder pBuf, IHRepository pRepository) throws Exception; 60 60 61 61 /** … … 64 64 * @param pRepository Permettra de gérer des cas particuliers en fonction du type de repository et du SGBD (version Oracle, driver...) 65 65 */ 66 public void wWriteClauseWhere(StringBu ffer pBuf, IHRepository pRepository) throws Exception;66 public void wWriteClauseWhere(StringBuilder pBuf, IHRepository pRepository) throws Exception; 67 67 68 68 /** … … 71 71 * @param pRepository Permettra de gérer des cas particuliers en fonction du type de repository et du SGBD (version Oracle, driver...) 72 72 */ 73 public void wWriteClauseExtension(StringBu ffer pBuf, IHRepository pRepository) throws Exception;73 public void wWriteClauseExtension(StringBuilder pBuf, IHRepository pRepository) throws Exception; 74 74 75 75 /** … … 79 79 * @throws Exception 80 80 */ 81 public void wWriteClauseHint(StringBu ffer pBuf, IHRepository pRepository) throws Exception;81 public void wWriteClauseHint(StringBuilder pBuf, IHRepository pRepository) throws Exception; 82 82 83 83 /** -
trunk/Jav_BDP/com/scenari/m/bdp/item/base/HItem.java
r10086 r10372 204 204 205 205 /** Buffer pour les contenus des tags. */ 206 protected StringBu ffer fBuf = new StringBuffer();206 protected StringBuilder fBuf = new StringBuilder(); 207 207 208 208 /** ContentHandler déporté. */ -
trunk/Jav_BDP/com/scenari/m/bdp/itemtype/XItemTypeSaxHandler.java
r10086 r10372 91 91 92 92 /** Buffer. */ 93 //protected StringBu ffer fBuf = new StringBuffer();93 //protected StringBuilder fBuf = new StringBuilder(); 94 94 /** 95 95 * Constructor for XItemTypeSaxHandler. -
trunk/Jav_BDP/com/scenari/m/bdp/module/genitem/HModuleGenItemBeanshellLoader.java
r7979 r10372 59 59 60 60 /** Script. */ 61 protected StringBu ffer fTextBuf = new StringBuffer(256);61 protected StringBuilder fTextBuf = new StringBuilder(256); 62 62 63 63 /** -
trunk/Jav_BDP/com/scenari/m/bdp/module/genpresc/HModuleGenPrescWsp.java
r10086 r10372 176 176 */ 177 177 protected final String xGetUriIhm() { 178 StringBu ffer vBuf = new StringBuffer(fUiiIhm.length() + 48);178 StringBuilder vBuf = new StringBuilder(fUiiIhm.length() + 48); 179 179 vBuf.append('/'); 180 180 vBuf.append(fItemType.hGetWorkspace().hGetCodeWorkspace()); … … 191 191 String vCd = pItem.hGetCode(); 192 192 String vWsp = pItem.hGetWorkspace().hGetCodeWorkspace(); 193 StringBu ffer vBuf = new StringBuffer(vSp.length() + vCd.length() + vWsp.length() + 8);193 StringBuilder vBuf = new StringBuilder(vSp.length() + vCd.length() + vWsp.length() + 8); 194 194 vBuf.append('/'); 195 195 vBuf.append(vWsp); … … 204 204 */ 205 205 public final String hCreateUriFc() throws Exception { 206 StringBu ffer vBuf = new StringBuffer(fUiiJeuFc.length() + 48);206 StringBuilder vBuf = new StringBuilder(fUiiJeuFc.length() + 48); 207 207 vBuf.append('/'); 208 208 vBuf.append(fItemType.hGetWorkspace().hGetCodeWorkspace()); -
trunk/Jav_BDP/com/scenari/m/bdp/module/rename/uii/WRenamedUiiStream.java
r10214 r10372 86 86 // On clone cette liste d'attributs. 87 87 AttributesImpl vAtts = new AttributesImpl(pAtts); 88 StringBu ffer vBuf = new StringBuffer(vNewSpace.length() + vNewCode.length() + 10);88 StringBuilder vBuf = new StringBuilder(vNewSpace.length() + vNewCode.length() + 10); 89 89 HQCode.hBuildUri(vBuf, vNewSpace, vNewCode); 90 90 vAtts.setValue(vIdx, vBuf.toString()); -
trunk/Jav_BDP/com/scenari/m/bdp/module/viewvirtualfolder/HVirtualFolder.java
r7417 r10372 210 210 vResult = ((IHSourceServer) fServer).hFindElemByUri(pUriRes); 211 211 } else { 212 String vUri = new StringBu ffer(((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(); 213 213 vResult = ((IHSourceServer) fServer).hFindElemByUri(vUri); 214 214 } … … 219 219 String vUri = (String) ((Object[]) fUriRootRes)[i]; 220 220 if (vUri != null) { 221 vUri = new StringBu ffer(vUri.length() + pUriRes.length()).append(vUri).append(pUriRes).toString();221 vUri = new StringBuilder(vUri.length() + pUriRes.length()).append(vUri).append(pUriRes).toString(); 222 222 } else { 223 223 vUri = pUriRes; … … 229 229 if (vResult.hGetStatus() == IHSourceElem.STATUS_NONE) { 230 230 if (fParent != null) { 231 String vUri = new StringBu ffer(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(); 232 232 vResult = fParent.wFindElem(vUri); 233 233 } … … 321 321 if (vSource.fParent != null) { 322 322 if (vPrefixUri != null) { 323 vPrefixUri = new StringBu ffer(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(); 324 324 } else { 325 325 vPrefixUri = "/".concat(vSource.fName); -
trunk/Jav_BDP/com/scenari/m/bdp/service/tabpresc/HSDialogTabPresc.java
r10169 r10372 488 488 protected final String xCreateUriPublication(IHModuleGenPresc pModule, String pUriSubInst) throws Exception { 489 489 String vCdWsp = fWorkspace.hGetCodeWorkspace(); 490 StringBu ffer 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); 491 491 vBuf.append('/'); 492 492 vBuf.append(vCdWsp); … … 505 505 */ 506 506 protected final String xCreateUriGenInWsp(IHModuleGenPresc pModule, String pUriSubInst) throws Exception { 507 StringBu ffer 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); 508 508 HQCode.hBuildUri(vBuf, fItem.fSpace, fItem.fCode); 509 509 vBuf.append('/'); -
trunk/Jav_BDP/com/scenari/m/bdp/service/tabsupport/HSDialogTabSupport.java
r10138 r10372 426 426 */ 427 427 protected final String xCreateUriGenInWsp(IHModuleGenPresc pModule, String pUriSubInst) throws Exception { 428 StringBu ffer 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); 429 429 HQCode.hBuildUri(vBuf, fItem.hGetSpace(), fItem.hGetCode()); 430 430 vBuf.append('/'); … … 442 442 protected final String xCreateUriPublication(IHModuleGenPresc pModule, String pUriSubInst) throws Exception { 443 443 String vCdWsp = fWorkspace.hGetCodeWorkspace(); 444 StringBu ffer 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); 445 445 vBuf.append('/'); 446 446 vBuf.append(vCdWsp); -
trunk/Jav_BDP/com/scenari/m/bdp/service/viewfiles/HFileZipper.java
r8395 r10372 124 124 } 125 125 String vName = pSource.hGetName(); 126 vPath = new StringBu ffer(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(); 127 127 ZipEntry vEntry = new ZipEntry(vPath); 128 128 Date vDate = pSource.hGetModifDate(); -
trunk/Jav_BDP/com/scenari/m/bdp/source/WSourceBdpItem.java
r1757 r10372 184 184 vSubUri = "/".concat(pName); 185 185 } else { 186 vSubUri = new StringBu ffer(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(); 187 187 } 188 188 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 113 113 //On est sur un espace 114 114 if (fSpace != null) { 115 return new WSourceBdpSpace(fParams, fWsp, new StringBu ffer(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); 116 116 } else { 117 117 return new WSourceBdpSpace(fParams, fWsp, pName, false, fAliasResolver).wInit(fStockSpace, this); -
trunk/Jav_BDP/com/scenari/m/bdp/univers/support/WInstancesMgrBdp.java
r10170 r10372 138 138 String vIdInst; 139 139 if (pUriSubInst != null) { 140 vIdInst = new StringBu ffer(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 StringBu ffer(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(); 143 143 } 144 144 if (pForceReload) { … … 187 187 String vIdInst; 188 188 if (pUriSubInst != null) { 189 vIdInst = new StringBu ffer(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 StringBu ffer(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(); 192 192 } 193 193 if (pForceReload) { -
trunk/Jav_BDP_FS/com/scenari/m/bdp/item/fs/FacetCache.java
r9982 r10372 64 64 protected File fFileCache; 65 65 66 protected StringBu ffer fNewDef;66 protected StringBuilder fNewDef; 67 67 68 68 protected File fOldFile = null; … … 97 97 } 98 98 fCachDef.fStatus = CacheMgr.STATUS_INWRITE; 99 fNewDef = new StringBu ffer(fCachDef.fDef.length() + 128);99 fNewDef = new StringBuilder(fCachDef.fDef.length() + 128); 100 100 fNewDef.append(fCachDef.fDef); 101 101 return false; … … 170 170 fFileCache = File.createTempFile("fac", "", fCacheMgr); 171 171 int vTab = fCachDef.fDef.indexOf('\t'); 172 fNewDef = new StringBu ffer(vTab + 128);172 fNewDef = new StringBuilder(vTab + 128); 173 173 fNewDef.append(fCachDef.fDef.substring(0, vTab)); 174 174 } -
trunk/Jav_BDP_FS/com/scenari/m/bdp/item/fs/HRepositoryFs2.java
r10289 r10372 1704 1704 } else if (fSsOverlay != null && pName == "ssOverlay") { 1705 1705 // Surcharge d'une SS 1706 fSsOverlay.fContentOverlay = fSerilizerXml.hGetStringBu ffer().toString();1706 fSsOverlay.fContentOverlay = fSerilizerXml.hGetStringBuilder().toString(); 1707 1707 if (fSsOverlay.fCodeeSs != null && fSsOverlay.fCodeeSs.length() > 0 && fSsOverlay.fSpaceSs != null && fSsOverlay.fSpaceSs.length() > 0 && fSsOverlay.fContentOverlay != null && fSsOverlay.fContentOverlay.length() > 0) { 1708 1708 if (fWspType.fOverlaysSs == null) { … … 1714 1714 } 1715 1715 } else if (pName == "config") { 1716 fWspType.fConfig = fSerilizerXml.hGetStringBu ffer().toString();1716 fWspType.fConfig = fSerilizerXml.hGetStringBuilder().toString(); 1717 1717 } else if (pName == "wspOption") { 1718 1718 WspType vParent = (WspType) fStackWspType.get(fStackWspType.size() - 1); … … 1759 1759 fSsOverlay.fCodeeSs = pAttributes.getValue("code"); 1760 1760 fSerilizerXml = new HExtraitSaxHandlerToXml(); 1761 fSerilizerXml.hSetStringBu ffer(new StringBuffer(256));1761 fSerilizerXml.hSetStringBuilder(new StringBuilder(256)); 1762 1762 fSerilizerXml.hSetXmlReader(fXmlReader); 1763 1763 if (fListPrefixesNs != null) { … … 1771 1771 // Config pour les options. 1772 1772 fSerilizerXml = new HExtraitSaxHandlerToXml(); 1773 fSerilizerXml.hSetStringBu ffer(new StringBuffer(256));1773 fSerilizerXml.hSetStringBuilder(new StringBuilder(256)); 1774 1774 fSerilizerXml.hSetXmlReader(fXmlReader); 1775 1775 if (fListPrefixesNs != null) { … … 2475 2475 if (vList.size() != vNbRoles) { 2476 2476 // Si le user a tous les droits, on ne spécifie rien. 2477 StringBu ffer vBuf = new StringBuffer(vList.size() * 12);2477 StringBuilder vBuf = new StringBuilder(vList.size() * 12); 2478 2478 vBuf.append((String) vList.get(0)); 2479 2479 for (int j = 1; j < vList.size(); j++) { -
trunk/Jav_BDP_FS/com/scenari/m/bdp/item/fs/HRepositoryFsAsp.java
r10289 r10372 341 341 */ 342 342 protected String xFilterDomainKey(String pDomainKey) { 343 StringBu ffer vBuf = new StringBuffer(16);343 StringBuilder vBuf = new StringBuilder(16); 344 344 for (int i = pDomainKey.length() - 1; i >= 0; i--) { 345 345 char vCh = pDomainKey.charAt(i); -
trunk/Jav_BDP_FS/com/scenari/m/bdp/item/fs/HWorkspaceFs.java
r10124 r10372 799 799 // C'est un sous-espace 800 800 if (HQCode.hValidSpacePart(vName, false) == HQCode.VALID_STRING_OK) { 801 String vNewSpaceStr = new StringBu ffer(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(); 802 802 XSpaceSystem vNewSpace = (XSpaceSystem) pSpaceSystem.hGetOrCreateSpace(vNewSpaceStr, pSpace.length() + 1); 803 803 xLoadSystemSpace(vNewSpaceStr, vChild, vNewSpace); … … 963 963 protected String xGetPrivateDataPath(String pSpace, String pCode) throws Exception { 964 964 String vRoot = fPrivateData.getAbsolutePath(); 965 StringBu ffer 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)); 966 966 vBuf.append(vRoot); 967 967 vBuf.append('/'); -
trunk/Jav_BDP_FS/com/scenari/m/bdp/item/fs/XItemCache.java
r10215 r10372 288 288 } 289 289 290 public XString(StringBu ffer pBuf, String pValToAdd) {290 public XString(StringBuilder pBuf, String pValToAdd) { 291 291 super(); 292 292 fStart = pBuf.length(); … … 335 335 if (fCurrentPb != null) { 336 336 if (fCurrentPb.fMessage != null) { 337 fCurrentPb.fMessage = new StringBu ffer(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(); 338 338 } else { 339 339 fCurrentPb.fMessage = new String(pChar, pStart, pLength); … … 469 469 } 470 470 } else { 471 StringBu ffer vBuf = new StringBuffer(fSpace.length() + 1 + fCode.length());471 StringBuilder vBuf = new StringBuilder(fSpace.length() + 1 + fCode.length()); 472 472 vBuf.append(fSpace); 473 473 vBuf.append('/'); … … 601 601 */ 602 602 public final void hSaveInCache(IHItem pItem, boolean pFireEventUpdated, int pClientId) throws Exception { 603 StringBu ffer vBuf = HPoolBuffer.get().hGetStringBuffer();603 StringBuilder vBuf = HPoolBuffer.get().hGetStringBuilder(); 604 604 try { 605 605 //On se délie des anciens fils. … … 707 707 throw (Exception) HLogMgr.hAddMessage(e, "Echec au stockage d'un item dans le cache. (" + pItem.toString() + ")"); 708 708 } finally { 709 HPoolBuffer.get().hFreeStringBu ffer(vBuf);709 HPoolBuffer.get().hFreeStringBuilder(vBuf); 710 710 } 711 711 … … 730 730 if (fFirstPointer != null) { 731 731 //On ne peut pas supprimer physiquement cet item car d'autres items pointent dessus. 732 StringBu ffer vBuf = HPoolBuffer.get().hGetStringBuffer();732 StringBuilder vBuf = HPoolBuffer.get().hGetStringBuilder(); 733 733 try { 734 734 fData = ""; … … 742 742 throw (Exception) HLogMgr.hAddMessage(e, "Echec au stockage d'un item dans le cache."); 743 743 } finally { 744 HPoolBuffer.get().hFreeStringBu ffer(vBuf);744 HPoolBuffer.get().hFreeStringBuilder(vBuf); 745 745 } 746 746 //Revalidation des items pointeurs … … 1039 1039 public synchronized CacheMgr xGetCacheMgr() throws Exception { 1040 1040 if (fCacheMgr == null) { 1041 StringBu ffer vBuf = new StringBuffer(fSpace.length() + 1 + fCode.length());1041 StringBuilder vBuf = new StringBuilder(fSpace.length() + 1 + fCode.length()); 1042 1042 vBuf.append(fSpace); 1043 1043 vBuf.append('/'); … … 1051 1051 * Construit une CharSequence si la valeur n'est pas null. 1052 1052 */ 1053 protected final XString xGetCharSeq(StringBu ffer pBuf, String pValToAdd) {1053 protected final XString xGetCharSeq(StringBuilder pBuf, String pValToAdd) { 1054 1054 if (pValToAdd != null) { 1055 1055 return new XString(pBuf, pValToAdd); -
trunk/Jav_BDP_FS/com/scenari/m/bdp/item/fs/XSpace.java
r9453 r10372 477 477 //Ce n'est pas un item de type dossier 478 478 if (pParentsSpaces != null) { 479 StringBu ffer vBuf = new StringBuffer(pParentsSpaces.length() + 1 + vName.length());479 StringBuilder vBuf = new StringBuilder(pParentsSpaces.length() + 1 + vName.length()); 480 480 vBuf.append(pParentsSpaces); 481 481 vBuf.append(HQCode.SPACES_SEPARATOR); … … 616 616 vSp = vSpaceCache.fFirstChildItem.fSpace; 617 617 } else { 618 vSp = new StringBu ffer(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(); 619 619 } 620 620 } … … 626 626 String vSp = (String) vChilds.get(vIdx); //On récupère le name avec la bonne casse 627 627 if (pSpace != null) { 628 vSp = new StringBu ffer(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(); 629 629 } 630 630 vSpaceCache.hRefreshAll(vSp, pWsp, pRefreshRootSystemSpaceToo); … … 657 657 vNewSpace.fNextSpace = fFirstChildSpace; 658 658 fFirstChildSpace = vNewSpace; 659 String vSp = pSpace == null ? vName : new StringBu ffer(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(); 660 660 vNewSpace.hRefreshAll(vSp, pWsp, pRefreshRootSystemSpaceToo); 661 661 } … … 764 764 */ 765 765 protected final String xGetUriSource(String pSpace, String pCode) { 766 StringBu ffer vBuf = new StringBuffer(pSpace.length() + pCode.length() + 2);766 StringBuilder vBuf = new StringBuilder(pSpace.length() + pCode.length() + 2); 767 767 vBuf.append('/'); 768 768 vBuf.append(pSpace); -
trunk/Jav_BDP_FS/com/scenari/m/bdp/item/fs/XSpaceSystem.java
r7927 r10372 78 78 protected XSpace xCreateSpace(CharSequence pName, int pStart, int pEnd) throws Exception { 79 79 String vRealName = pName.subSequence(pStart, pEnd).toString(); 80 StringBu ffer vBuf = new StringBuffer(fSpace.length() + pEnd - pStart + 1);80 StringBuilder vBuf = new StringBuilder(fSpace.length() + pEnd - pStart + 1); 81 81 vBuf.append(fSpace); 82 82 vBuf.append(HQCode.SPACES_SEPARATOR); -
trunk/Jav_BDP_FS/com/scenari/m/bdp/itemtype/fs/XItemTypeFsSaxHandler.java
r10215 r10372 219 219 } else if (fIsInPb && fValidPtr != null) { 220 220 if(fValidPtr.fPbContent != null) { 221 fValidPtr.fPbContent = new StringBu ffer().append(fValidPtr.fPbContent).append(pChar, pStart, pLength).toString();221 fValidPtr.fPbContent = new StringBuilder().append(fValidPtr.fPbContent).append(pChar, pStart, pLength).toString(); 222 222 } else { 223 223 fValidPtr.fPbContent = new String(pChar, pStart, pLength); -
trunk/Jav_Builder/com/scenari/m/builder/gen/HModelGenerator.java
r10138 r10372 294 294 * Charge la page d'URL pUrl. 295 295 */ 296 public void loadPage(StringBu ffer pBuf, IDynamicFile pPage) throws Exception {296 public void loadPage(StringBuilder pBuf, IDynamicFile pPage) throws Exception { 297 297 pBuf.append(resolveDestUri2DestUrl(pPage.getDestUri())); 298 298 } … … 301 301 * 302 302 */ 303 public void loadUrl(StringBu ffer pBuf, String pUrl) throws Exception {303 public void loadUrl(StringBuilder pBuf, String pUrl) throws Exception { 304 304 pBuf.append(pUrl); 305 305 } … … 309 309 * 310 310 * @param pBuf 311 * java.lang.StringBu ffer311 * java.lang.StringBuilder 312 312 * @exception java.lang.Exception 313 313 * The exception description. 314 314 */ 315 public void quit(StringBu ffer pBuf) throws Exception {315 public void quit(StringBuilder pBuf) throws Exception { 316 316 } 317 317 … … 320 320 * 321 321 * @param pBuf 322 * java.lang.StringBu ffer322 * java.lang.StringBuilder 323 323 * @exception java.lang.Exception 324 324 * The exception description. 325 325 */ 326 public void goHome(StringBu ffer pBuf) throws Exception {326 public void goHome(StringBuilder pBuf) throws Exception { 327 327 } 328 328 … … 895 895 String vExt = pModelePage != null ? pModelePage.hGetExtension(pDialog) : ""; 896 896 String vNameFile = vRoot.hNewRandomFile("a", vExt); 897 vPathFile = new StringBu ffer(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(); 898 898 } 899 899 vResult.fDocument = vRoot.hFindSource(vPathFile); … … 918 918 String vExt = pModelePage != null ? pModelePage.hGetExtension(pDialog) : ""; 919 919 String vNameFile = vRoot.hNewRandomFile("a", vExt); 920 vPathFile = new StringBu ffer(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(); 921 921 } 922 922 vResult.fDocument = vRoot.hFindSource(vPathFile); -
trunk/Jav_Builder/com/scenari/m/builder/gen/XhtmlXslTemplatePage.java
r10346 r10372 61 61 import com.scenari.s.co.source.IHSource; 62 62 import com.scenari.s.co.source.IHSourceElem; 63 import com.scenari.s.fw.util.xml.HEncodingXml; 63 64 import com.scenari.s.fw.utils.stream.HBufferStreamChar; 64 65 import com.scenari.xpath.XStringHelper; … … 234 235 pWriter.write("<style type=\"text/css\">\n"); 235 236 for (int i = 0; i < vList.size(); i++) { 236 pWriter.write((String) vList.get(i));237 HEncodingXml.hWriteTextValue(pWriter, (String) vList.get(i)); 237 238 pWriter.write('\n'); 238 239 } -
trunk/Jav_Builder/com/scenari/m/builder/xpath/dom/ZXPathBuildGUID.java
r2435 r10372 116 116 public XObject xExecute(XPathContext pCtx) throws Exception { 117 117 String vString = wGetAsString(pCtx, fArg.execute(pCtx)); 118 StringBu ffer vBuf = new StringBuffer(36);118 StringBuilder vBuf = new StringBuilder(36); 119 119 BigInteger vVal = BigInteger.ZERO; 120 120 //On construit le BigInt sur une Base 30 -
trunk/Jav_Builder/com/scenari/m/builder/xpath/dom/ZXPathEncodeNameOd.java
r2563 r10372 130 130 boolean wroteUnencodedChar = false; 131 131 int maxBytesPerChar = 10; // rather arbitrary limit, but safe for now 132 StringBu ffer out = new StringBuffer(vString.length());132 StringBuilder out = new StringBuilder(vString.length()); 133 133 ByteArrayOutputStream buf = new ByteArrayOutputStream(maxBytesPerChar); 134 134 -
trunk/Jav_Builder/com/scenari/m/builder/xpath/dom/ZXPathListXmlFromBuffer.java
r4833 r10372 89 89 90 90 String vCdBuffer = wGetAsString(pCtx, fArg.execute(pCtx)); 91 StringBu ffer vBuf = new StringBuffer(256);91 StringBuilder vBuf = new StringBuilder(256); 92 92 IHDialog vDialog = wGetDialogFromCtx(pCtx); 93 93 IHContextBuffers vContext = ((IHContextBuffers) vDialog.hGetContext()); -
trunk/Jav_CO/Description fonctions XPath.xml
r10347 r10372 782 782 <morphologie format="initBuffer(pKeyBuffer, [pBuffer])"> 783 783 <parametre numero="1" type="String" resume="Clé du buffer."/> 784 <parametre numero="2" type="Object" resume="buffer (objet java) : StringBu ffer, 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é."/> 785 785 </morphologie> 786 786 </fonction> -
trunk/Jav_CO/com/scenari/m/co/agent/HADialog.java
r10037 r10372 549 549 */ 550 550 public String toString() { 551 StringBu ffer vBuf = new StringBuffer(256);551 StringBuilder vBuf = new StringBuilder(256); 552 552 vBuf.append("<dialogue cdAction=\""); 553 553 vBuf.append(hGetCdAction()); -
trunk/Jav_CO/com/scenari/m/co/composant/HComposantTypeLoader.java
r7458 r10372 222 222 if (fCurrentDonnee != null) { 223 223 // On est revenu à la cloture de l'élément donnée. 224 if (fSaxHandlerToText.hGetStringBu ffer().length() > 0) {224 if (fSaxHandlerToText.hGetStringBuilder().length() > 0) { 225 225 try { 226 fCurrentDonnee.wSetValue(fCurrentCompType, fSaxHandlerToText.hGetStringBu ffer().substring(0), fContextDonnee);226 fCurrentDonnee.wSetValue(fCurrentCompType, fSaxHandlerToText.hGetStringBuilder().substring(0), fContextDonnee); 227 227 } catch (Exception e) { 228 228 throw (Exception) HLogMgr.hAddMessage(e, "Echec lors de l'affectation du contenu d'une donnée de type " + fCurrentDonnee.getClass().getName()); … … 281 281 if (fSaxHandlerToText == null) { 282 282 fSaxHandlerToText = new HExtraitSaxHandlerToText(); 283 fSaxHandlerToText.hSetStringBu ffer(new StringBuffer(256));283 fSaxHandlerToText.hSetStringBuilder(new StringBuilder(256)); 284 284 } 285 fSaxHandlerToText.hGetStringBu ffer().setLength(0);285 fSaxHandlerToText.hGetStringBuilder().setLength(0); 286 286 fSaxHandlerToText.hSetXmlReader(fXMLReader); 287 287 } -
trunk/Jav_CO/com/scenari/m/co/composant/WComposant.java
r7523 r10372 490 490 fCompPere = pComposantPere; 491 491 String vPathPere = fCompPere.hGetComposantPath(); 492 StringBu ffer vBuf = new StringBuffer(vPathPere.length() + pCode.length() + 1);492 StringBuilder vBuf = new StringBuilder(vPathPere.length() + pCode.length() + 1); 493 493 vBuf.append(vPathPere); 494 494 vBuf.append("/"); -
trunk/Jav_CO/com/scenari/m/co/context/HContextInteractif.java
r7252 r10372 54 54 /** 55 55 * 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 StringBu ffer sont gérés spécifiquement et56 * d'objet java peut être un buffer. Les objets de type Collection, Map et StringBuilder sont gérés spécifiquement et 57 57 * les méthodes utilitaires sont proposées. 58 58 */ … … 113 113 * Si pEntry est null, retourne le buffer pKeyBuffer. Si pEntry non null : Retourne la valeur d'une entrée de buffer 114 114 * 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 StringBu ffer dans un buffer de type StringBuffer.115 * représentant le StringBuilder dans un buffer de type StringBuilder. 116 116 */ 117 117 public Object getEntryBuffer(String pKeyBuffer, Object pEntry) { … … 123 123 } else if (vBuf instanceof Map) { 124 124 return ((Map) vBuf).get(pEntry); 125 } else if (vBuf instanceof StringBu ffer) {125 } else if (vBuf instanceof StringBuilder) { 126 126 return vBuf.toString(); 127 127 } … … 133 133 * Ajout d'une entrée dans un buffer. 134 134 * 135 * @param pEntry Objet ajouté à un buffer de type Collexction ou StringBu ffer, Key de l'entry pour un buffer de type135 * @param pEntry Objet ajouté à un buffer de type Collexction ou StringBuilder, Key de l'entry pour un buffer de type 136 136 * Map. 137 137 * @param pEntryValue Utile que pour les buffers de type Map … … 144 144 } else if (vBuf instanceof Map) { 145 145 return (((Map) vBuf).put(pEntry, pEntryValue) == null); 146 } else if (vBuf instanceof StringBu ffer) {147 ((StringBu ffer) vBuf).append(pEntry);146 } else if (vBuf instanceof StringBuilder) { 147 ((StringBuilder) vBuf).append(pEntry); 148 148 return true; 149 149 } -
trunk/Jav_CO/com/scenari/m/co/context/IHContextBuffers.java
r4831 r10372 19 19 * Si pEntry est null, retourne le buffer pKeyBuffer. Si pEntry non null : Retourne la valeur d'une entrée de buffer 20 20 * 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 StringBu ffer dans un buffer de type StringBuffer.21 * représentant le StringBuilder dans un buffer de type StringBuilder. 22 22 */ 23 23 public Object getEntryBuffer(String pKeyBuffer, Object pEntry); … … 26 26 * Ajout d'une entrée dans un buffer. 27 27 * 28 * @param pEntry Objet ajouté à un buffer de type Collexction ou StringBu ffer, Key de l'entry pour un buffer de type28 * @param pEntry Objet ajouté à un buffer de type Collexction ou StringBuilder, Key de l'entry pour un buffer de type 29 29 * Map. 30 30 * @param pValueEntry Utile que pour les buffers de type Map -
trunk/Jav_CO/com/scenari/m/co/dialog/webdav/WResultatOptions.java
r4311 r10372 140 140 */ 141 141 protected void xBuildAllow() { 142 StringBu ffer vBuf = new StringBuffer(100);142 StringBuilder vBuf = new StringBuilder(100); 143 143 if(fOPTIONS) vBuf.append("OPTIONS,"); 144 144 if(fGET) vBuf.append("GET,"); -
trunk/Jav_CO/com/scenari/m/co/donnee/WDonneeFixeSystemProps.java
r7747 r10372 92 92 /** Remplace les propriétés systèmes. Utilisable de l'extérieur. */ 93 93 public static String hReplace(String pSrc){ 94 StringBu ffer vRes = null;94 StringBuilder vRes = null; 95 95 if(pSrc != null) { 96 96 int vIdx = pSrc.indexOf('{'); 97 97 if(vIdx >= 0) { 98 vRes = new StringBu ffer(pSrc.length()+128);98 vRes = new StringBuilder(pSrc.length()+128); 99 99 if(vIdx>0) vRes.append(pSrc.substring(0, vIdx)); 100 100 int vIdxEnd = vIdx; -
trunk/Jav_CO/com/scenari/m/co/donnee/WDonneeXPath.java
r7458 r10372 124 124 public String toString() { 125 125 126 StringBu ffer vBuf = HPoolBuffer.get().hGetStringBuffer();126 StringBuilder vBuf = HPoolBuffer.get().hGetStringBuilder(); 127 127 128 128 vBuf.append("<donnee type=\""); … … 142 142 143 143 String vResult = vBuf.substring(0); 144 HPoolBuffer.get().hFreeStringBu ffer(vBuf);144 HPoolBuffer.get().hFreeStringBuilder(vBuf); 145 145 146 146 return vResult; -
trunk/Jav_CO/com/scenari/m/co/donnee/WDonneeXslMonoTemplate.java
r7519 r10372 109 109 if (vXslDyn != null && !vXslDyn.equals("")) { 110 110 // Construction du XSL complet 111 StringBu ffer vBuf = new StringBuffer(vXslDyn.length() + 512);111 StringBuilder vBuf = new StringBuilder(vXslDyn.length() + 512); 112 112 vBuf.append("<?xml version=\"1.0\"?>"); // encoding=\"iso-8859-1\" 113 113 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 98 98 if (fCurrentDonnee != null) { 99 99 //On est revenu à la cloture de l'élément donnée. 100 StringBu ffer vBuf = fCurrentSubSaxHandlerIsXml ? fSaxHandlerToXml.hGetStringBuffer() : fSaxHandlerToText.hGetStringBuffer();100 StringBuilder vBuf = fCurrentSubSaxHandlerIsXml ? fSaxHandlerToXml.hGetStringBuilder() : fSaxHandlerToText.hGetStringBuilder(); 101 101 if (vBuf.length() > 0) { 102 102 try { … … 148 148 if (fSaxHandlerToXml == null) { 149 149 fSaxHandlerToXml = new HExtraitSaxHandlerToXml(); 150 fSaxHandlerToXml.hSetStringBu ffer(new StringBuffer(256));150 fSaxHandlerToXml.hSetStringBuilder(new StringBuilder(256)); 151 151 } else { 152 fSaxHandlerToXml.hGetStringBu ffer().setLength(0);152 fSaxHandlerToXml.hGetStringBuilder().setLength(0); 153 153 } 154 154 fSaxHandlerToXml.hSetXmlReader(fXMLReader); … … 157 157 if (fSaxHandlerToText == null) { 158 158 fSaxHandlerToText = new HExtraitSaxHandlerToText(); 159 fSaxHandlerToText.hSetStringBu ffer(new StringBuffer(256));159 fSaxHandlerToText.hSetStringBuilder(new StringBuilder(256)); 160 160 } else { 161 fSaxHandlerToText.hGetStringBu ffer().setLength(0);161 fSaxHandlerToText.hGetStringBuilder().setLength(0); 162 162 } 163 163 fSaxHandlerToText.hSetXmlReader(fXMLReader); -
trunk/Jav_CO/com/scenari/m/co/donnee/XSaxHandlerToDom.java
r7479 r10372 57 57 /** 58 58 * Permet de reconstruire une chaine texte représentant le document XML en cours de parsing. 59 * Attention le reset du StringBu ffer doit être assuré avant la transmission à ce SaxHandler.59 * Attention le reset du StringBuilder doit être assuré avant la transmission à ce SaxHandler. 60 60 * Cette implémentation nécessite une réfrence au XmlReader générant les évènements Sax pour réaffecter 61 61 * 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 63 63 fCompType = pCompType; 64 64 fContextDonnee = pContextDonnee; 65 fStringBu ffer = HPoolBuffer.get().hGetStringBuffer();65 fStringBuilder = HPoolBuffer.get().hGetStringBuilder(); 66 66 } 67 67 /** … … 73 73 //Fini 74 74 try { 75 fDonnee.wSetValue(fCompType, fStringBu ffer.substring(0).trim(), fContextDonnee);75 fDonnee.wSetValue(fCompType, fStringBuilder.substring(0).trim(), fContextDonnee); 76 76 } catch (Exception e) { 77 77 throw (SAXException) HLogMgr.hAddMessage(new SAXException("Erreur au cours de l'affectation de la valeur à la donnee " + fDonnee), HLogMgr.hGetMessage(e)); 78 78 } finally { 79 HPoolBuffer.get().hFreeStringBu ffer(fStringBuffer);80 fStringBu ffer = null;79 HPoolBuffer.get().hFreeStringBuilder(fStringBuilder); 80 fStringBuilder = null; 81 81 } 82 82 … … 87 87 * 88 88 * 89 * @param pBuffer java.lang.StringBu ffer89 * @param pBuffer java.lang.StringBuilder 90 90 */ 91 public void hSetStringBu ffer(StringBuffer pBuffer) {92 //Gestion interne du StringBu ffer91 public void hSetStringBuilder(StringBuilder pBuffer) { 92 //Gestion interne du StringBuilder 93 93 } 94 94 } -
trunk/Jav_CO/com/scenari/m/co/donnee/composition/XCompositionSaxHandler.java
r7458 r10372 117 117 118 118 /** Chaine statique en cours de création. */ 119 protected StringBu ffer fStringBuffer = new StringBuffer();119 protected StringBuilder fStringBuilder = new StringBuilder(); 120 120 121 121 /** Offset du car '>' du dernier startElement lu. */ … … 139 139 */ 140 140 public void characters(char[] pCh, int pStart, int pLength) throws org.xml.sax.SAXException { 141 fStringBu ffer.append(pCh, pStart, pLength);141 fStringBuilder.append(pCh, pStart, pLength); 142 142 } 143 143 … … 146 146 */ 147 147 public void xAddStringFix(boolean pExcludeWhiteSpace, boolean pTrim) throws Exception { 148 if (fStringBu ffer.length() > 0) {148 if (fStringBuilder.length() > 0) { 149 149 String vVal = null; 150 150 if (pExcludeWhiteSpace) { 151 if (!XMLCharacterRecognizer.isWhiteSpace(fStringBu ffer)) {152 vVal = fStringBu ffer.substring(0);151 if (!XMLCharacterRecognizer.isWhiteSpace(fStringBuilder)) { 152 vVal = fStringBuilder.substring(0); 153 153 if (pTrim) vVal = vVal.trim(); 154 154 } 155 } else if (fStringBu ffer.length() > 0) {156 vVal = fStringBu ffer.substring(0);155 } else if (fStringBuilder.length() > 0) { 156 vVal = fStringBuilder.substring(0); 157 157 if (pTrim) vVal = vVal.trim(); 158 158 } … … 162 162 } 163 163 //On reset le buffer 164 fStringBu ffer.setLength(0);164 fStringBuilder.setLength(0); 165 165 fOffsetLastElementInDonnee = -1; 166 166 } … … 189 189 } 190 190 } else { //Ce n'est pas un élément de l'espace composition, on le recopie à l'identique 191 if (fOffsetLastElementInDonnee == fStringBu ffer.length()) {192 if (fStringBu ffer.length() > 0) { //Pas de contenu au tag.193 fStringBu ffer.setCharAt(fStringBuffer.length() - 1, '/');194 fStringBu ffer.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('>'); 195 195 } 196 196 } else { //Il y a eu un contenu au tag. 197 fStringBu ffer.append("</");198 fStringBu ffer.append(pQName);199 fStringBu ffer.append('>');197 fStringBuilder.append("</"); 198 fStringBuilder.append(pQName); 199 fStringBuilder.append('>'); 200 200 } 201 201 } … … 312 312 } else { 313 313 //Ce n'est pas un élément de l'espace composition, on le recopie à l'identique 314 fStringBu ffer.append('<');315 fStringBu ffer.append(pQName);314 fStringBuilder.append('<'); 315 fStringBuilder.append(pQName); 316 316 //Traitement de chaque attribut 317 317 for (int i = 0; i < pAttributes.getLength(); i++) { 318 fStringBu ffer.append(' ');319 fStringBu ffer.append(pAttributes.getQName(i));320 fStringBu ffer.append("=\"");318 fStringBuilder.append(' '); 319 fStringBuilder.append(pAttributes.getQName(i)); 320 fStringBuilder.append("=\""); 321 321 322 322 //Traitement des éléments dynamiques dans l'attribut … … 351 351 if (vOffsLastAppend < vOffsBegin) { 352 352 //On écrit ce qui précède l'acolode ouvrante. 353 HEncodingXml.hWriteAttributHtmlValue(fStringBu ffer, vValAtt.substring(vOffsLastAppend, vOffsBegin));353 HEncodingXml.hWriteAttributHtmlValue(fStringBuilder, vValAtt.substring(vOffsLastAppend, vOffsBegin)); 354 354 } 355 355 vOffsLastAppend = vOffsLast + 1; … … 407 407 if (vOffsLastAppend < vOffsBegin) { 408 408 //On écrit ce qui précède l'acolode ouvrante. 409 HEncodingXml.hWriteAttributHtmlValue(fStringBu ffer, vValAtt.substring(vOffsLastAppend, vOffsBegin));409 HEncodingXml.hWriteAttributHtmlValue(fStringBuilder, vValAtt.substring(vOffsLastAppend, vOffsBegin)); 410 410 } 411 411 vOffsBegin++; … … 417 417 //Ecriture du dernier morceau 'statique' 418 418 if (vOffsLastAppend < vValAtt.length()) { 419 HEncodingXml.hWriteAttributHtmlValue(fStringBu ffer, vValAtt.substring(vOffsLastAppend));419 HEncodingXml.hWriteAttributHtmlValue(fStringBuilder, vValAtt.substring(vOffsLastAppend)); 420 420 xAddStringFix(false, false); 421 421 } 422 422 423 fStringBu ffer.append('"');423 fStringBuilder.append('"'); 424 424 } 425 425 if(fNsDeclStack != null && fNsDeclStack.size() > 0) { … … 428 428 String vNs = (String) fNsDeclStack.get(i+1); 429 429 if(vPrefix.length() > 0) { 430 fStringBu ffer.append(" xmlns:");431 fStringBu ffer.append(vPrefix);432 fStringBu ffer.append("=\"");430 fStringBuilder.append(" xmlns:"); 431 fStringBuilder.append(vPrefix); 432 fStringBuilder.append("=\""); 433 433 } else { 434 fStringBu ffer.append(" xmlns=\"");434 fStringBuilder.append(" xmlns=\""); 435 435 } 436 fStringBu ffer.append(vNs);437 fStringBu ffer.append('"');438 } 439 } 440 fStringBu ffer.append('>');441 fOffsetLastElementInDonnee = fStringBu ffer.length();436 fStringBuilder.append(vNs); 437 fStringBuilder.append('"'); 438 } 439 } 440 fStringBuilder.append('>'); 441 fOffsetLastElementInDonnee = fStringBuilder.length(); 442 442 } 443 443 if(fNsDeclStack != null && fNsDeclStack.size() > 0) fNsDeclStack.clear(); -
trunk/Jav_CO/com/scenari/m/co/donnee/externe/XSInitDonneeSaxHandler.java
r7458 r10372 106 106 if (fCurrentDonnee != null) { 107 107 //On est revenu à la cloture de l'élément donnée. 108 if (fSaxHandlerToText.hGetStringBu ffer().length() > 0) {108 if (fSaxHandlerToText.hGetStringBuilder().length() > 0) { 109 109 try { 110 fCurrentDonnee.wSetValue(fService, fSaxHandlerToText.hGetStringBu ffer().substring(0), fCurrentDocSource);110 fCurrentDonnee.wSetValue(fService, fSaxHandlerToText.hGetStringBuilder().substring(0), fCurrentDocSource); 111 111 } catch (Exception e) { 112 112 HLogMgr.hPublishException(e, "Echec lors de l'affectation du contenu d'une donnée de type " + fCurrentDonnee.getClass().getName()); … … 122 122 } else if(fCurrentTransform) { 123 123 //On est revenu d'une lecture d'un template de transformation. 124 if (fSaxHandlerToXml.hGetStringBu ffer().length() > 0) {125 fDonnee.xAddTransformXsl(fSaxHandlerToXml.hGetStringBu ffer().substring(0), false, fCurrentDocSource);124 if (fSaxHandlerToXml.hGetStringBuilder().length() > 0) { 125 fDonnee.xAddTransformXsl(fSaxHandlerToXml.hGetStringBuilder().substring(0), false, fCurrentDocSource); 126 126 } 127 127 fCurrentTransform = false; … … 161 161 if (fSaxHandlerToText == null) { 162 162 fSaxHandlerToText = new HExtraitSaxHandlerToText(); 163 fSaxHandlerToText.hSetStringBu ffer(new StringBuffer(256));163 fSaxHandlerToText.hSetStringBuilder(new StringBuilder(256)); 164 164 } 165 fSaxHandlerToText.hGetStringBu ffer().setLength(0);165 fSaxHandlerToText.hGetStringBuilder().setLength(0); 166 166 fSaxHandlerToText.hSetXmlReader(fXMLReader); 167 167 } … … 201 201 if (fSaxHandlerToXml == null) { 202 202 fSaxHandlerToXml = new HExtraitSaxHandlerToXml(); 203 fSaxHandlerToXml.hSetStringBu ffer(new StringBuffer(256));204 } 205 fSaxHandlerToXml.hGetStringBu ffer().setLength(0);203 fSaxHandlerToXml.hSetStringBuilder(new StringBuilder(256)); 204 } 205 fSaxHandlerToXml.hGetStringBuilder().setLength(0); 206 206 fSaxHandlerToXml.hSetXmlReader(fXMLReader); 207 207 fCurrentTransform = true; -
trunk/Jav_CO/com/scenari/m/co/donnee/inclusion/WDonneeInclusionDynamique.java
r7458 r10372 179 179 */ 180 180 public final String toString() { 181 StringBu ffer vBuf = com.scenari.s.fw.utils.HPoolBuffer.get().hGetStringBuffer();181 StringBuilder vBuf = com.scenari.s.fw.utils.HPoolBuffer.get().hGetStringBuilder(); 182 182 183 183 vBuf.append("<donnee type=\""); … … 195 195 196 196 String vRes = vBuf.substring(0); 197 com.scenari.s.fw.utils.HPoolBuffer.get().hFreeStringBu ffer(vBuf);197 com.scenari.s.fw.utils.HPoolBuffer.get().hFreeStringBuilder(vBuf); 198 198 199 199 return vRes; -
trunk/Jav_CO/com/scenari/m/co/donnee/inclusion/XWriter.java
r7466 r10372 113 113 114 114 /** Buffer de l'inclusion.*/ 115 protected StringBu ffer fBuff = null;115 protected StringBuilder fBuff = null; 116 116 117 117 /** Flag si le flux doit être envoyé dans la dest. */ … … 197 197 //On a trouvé un tag d'ouverture 198 198 if (fBuff == null) { 199 fBuff = new StringBu ffer(64);199 fBuff = new StringBuilder(64); 200 200 } 201 201 fStatut = STATUT_TAGIN; … … 216 216 //On a trouvé un tag d'ouverture 217 217 if (fBuff == null) { 218 fBuff = new StringBu ffer(64);218 fBuff = new StringBuilder(64); 219 219 } 220 220 fStatut = STATUT_TAGIN; … … 297 297 if (fSrcIsXml) { 298 298 int vLen = fBuff.length(); 299 StringBu ffer vBuf = new StringBuffer(vLen);299 StringBuilder vBuf = new StringBuilder(vLen); 300 300 for (int i = 0; i < vLen; i++) { 301 301 char vCh = fBuff.charAt(i); -
trunk/Jav_CO/com/scenari/m/co/service/HServiceLoader.java
r7458 r10372 190 190 if (fCurrentDonnee != null) { 191 191 // On est revenu à la cloture de l'élément donnée. 192 if (fSaxHandlerToText.hGetStringBu ffer().length() > 0) {192 if (fSaxHandlerToText.hGetStringBuilder().length() > 0) { 193 193 try { 194 fCurrentDonnee.wSetValue(fCurrentService, fSaxHandlerToText.hGetStringBu ffer().substring(0), fCurrentDocSource);194 fCurrentDonnee.wSetValue(fCurrentService, fSaxHandlerToText.hGetStringBuilder().substring(0), fCurrentDocSource); 195 195 } catch (Exception e) { 196 196 HLogMgr.hPublishException(e, "Echec lors de l'affectation du contenu d'une donnée de type " + fCurrentDonnee.getClass().getName()); … … 237 237 if (fSaxHandlerToText == null) { 238 238 fSaxHandlerToText = new HExtraitSaxHandlerToText(); 239 fSaxHandlerToText.hSetStringBu ffer(new StringBuffer(256));239 fSaxHandlerToText.hSetStringBuilder(new StringBuilder(256)); 240 240 } 241 fSaxHandlerToText.hGetStringBu ffer().setLength(0);241 fSaxHandlerToText.hGetStringBuilder().setLength(0); 242 242 fSaxHandlerToText.hSetXmlReader(fXMLReader); 243 243 } -
trunk/Jav_CO/com/scenari/m/co/service/WService.java
r7458 r10372 168 168 public final String hGetUrn() { 169 169 if (fUrn == null) { 170 StringBu ffer vBuf = new StringBuffer(64);170 StringBuilder vBuf = new StringBuilder(64); 171 171 vBuf.append(hGetAncre()); 172 172 vBuf.append("/"); -
trunk/Jav_CO/com/scenari/m/co/univers/HContextExecHttpServlet.java
r1710 r10372 99 99 public final String hBuildUrlAbsAgent(IWAgent pAgent, IWADialog pDialog) throws Exception { 100 100 101 StringBu ffer vBuf = new StringBuffer();101 StringBuilder vBuf = new StringBuilder(); 102 102 103 103 List vHier = pDialog.hGetHier(); … … 125 125 public final String hBuildUrlAbsRessource(String pUri, IWUnivers pUnivers) throws Exception { 126 126 127 StringBu ffer vBuf = new StringBuffer(pUri.length() + 64);127 StringBuilder vBuf = new StringBuilder(pUri.length() + 64); 128 128 vBuf.append(fUrlDomaine); 129 129 vBuf.append(fUrlPublications); … … 138 138 public final String hBuildUrlAbsService(com.scenari.m.co.service.IWService pService) throws Exception { 139 139 140 StringBu ffer vBuf = new StringBuffer(128);140 StringBuilder vBuf = new StringBuilder(128); 141 141 vBuf.append(fUrlDomaine); 142 142 vBuf.append(fUrlWebApp); … … 154 154 public final String hBuildUrlInDomainAgent(IWAgent pAgent, IWADialog pDialog) throws Exception { 155 155 156 StringBu ffer vBuf = new StringBuffer();156 StringBuilder vBuf = new StringBuilder(); 157 157 158 158 List vHier = pDialog.hGetHier(); … … 181 181 public final String hBuildUrlInDomainRessource(String pUri, IWUnivers pUnivers) throws Exception { 182 182 183 StringBu ffer vBuf = new StringBuffer(pUri.length() + 64);183 StringBuilder vBuf = new StringBuilder(pUri.length() + 64); 184 184 //vBuf.append(fUrlDomaine); 185 185 vBuf.append(fUrlPublications); … … 194 194 public final String hBuildUrlInDomainService(com.scenari.m.co.service.IWService pService) throws Exception { 195 195 196 StringBu ffer vBuf = new StringBuffer(128);196 StringBuilder vBuf = new StringBuilder(128); 197 197 //vBuf.append(fUrlDomaine); 198 198 vBuf.append(fUrlWebApp); … … 210 210 public final String hBuildUrlInWebappAgent(IWAgent pAgent, IWADialog pDialog) throws Exception { 211 211 212 StringBu ffer vBuf = new StringBuffer();212 StringBuilder vBuf = new StringBuilder(); 213 213 214 214 List vHier = pDialog.hGetHier(); … … 236 236 public final String hBuildUrlInWebappService(com.scenari.m.co.service.IWService pService) throws Exception { 237 237 238 StringBu ffer vBuf = new StringBuffer(128);238 StringBuilder vBuf = new StringBuilder(128); 239 239 //vBuf.append(fUrlDomaine); 240 240 //vBuf.append(fUrlWebApp); -
trunk/Jav_CO/com/scenari/m/co/univers/HInstanceDef.java
r7412 r10372 256 256 */ 257 257 public String toString() { 258 StringBu ffer vBuf = new StringBuffer(256);258 StringBuilder vBuf = new StringBuilder(256); 259 259 vBuf.append("<"); 260 260 vBuf.append(hGetTagRoot()); -
trunk/Jav_CO/com/scenari/m/co/univers/XParamUniversSaxHandler.java
r10155 r10372 140 140 141 141 /** Buffer pour les zones de texte. */ 142 protected StringBu ffer fBuf = new StringBuffer(64);142 protected StringBuilder fBuf = new StringBuilder(64); 143 143 144 144 /** -
trunk/Jav_CO/com/scenari/m/co/univers/wsp/WContenuMgrWsp.java
r10268 r10372 366 366 public final void hInitServicePrecsription(IWPrescription pPrecsription, IWService pService) throws Exception { 367 367 //Les services de prescriptions ne sont pas utilisés dan sce ContenuMgr 368 //pService.wSetUrlPublication(new StringBu ffer(pService.hGetCode().length() +368 //pService.wSetUrlPublication(new StringBuilder(pService.hGetCode().length() + 369 369 // 5).append("/se/").append(pService.hGetCode()).append('/').toString()); 370 370 throw HLogMgr.hNewException("Fonction non implémentée dans le ContenuMgr Dynamique."); … … 375 375 */ 376 376 public final void hInitServiceUnivers(IWService pService) throws Exception { 377 pService.wSetUrlPublication(new StringBu ffer(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()); 378 378 } 379 379 … … 527 527 528 528 if (vLen > 0 && pUrl.length() > vLen) { 529 StringBu ffer vBuf = new StringBuffer(vResult.length() - vLen + vBase.length() + 1);529 StringBuilder vBuf = new StringBuilder(vResult.length() - vLen + vBase.length() + 1); 530 530 vBuf.append(vBase); 531 531 if (vResult.charAt(vLen) != '/') { -
trunk/Jav_CO/com/scenari/m/co/univers/wsp/XFcSaxHandler.java
r7366 r10372 133 133 fCompType.wInit(vUnivers, vClasseComp, vCode); 134 134 135 StringBu ffer vBuf = new StringBuffer(64);135 StringBuilder vBuf = new StringBuilder(64); 136 136 137 137 // -
trunk/Jav_CO/com/scenari/m/co/user/fs/XUserSaxHandler.java
r1710 r10372 80 80 protected WUserFs fActeur = null; 81 81 82 /** StringBu ffer pour les caractères. */83 protected StringBu ffer fBuf = new StringBuffer(128);82 /** StringBuilder pour les caractères. */ 83 protected StringBuilder fBuf = new StringBuilder(128); 84 84 85 85 /** Liste des roles. */ -
trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPath.java
r9752 r10372 127 127 case Node.DOCUMENT_NODE: 128 128 case Node.ELEMENT_NODE: { 129 StringBu ffer vBuf = com.scenari.s.fw.utils.HPoolBuffer.get().hGetStringBuffer();129 StringBuilder vBuf = com.scenari.s.fw.utils.HPoolBuffer.get().hGetStringBuilder(); 130 130 for (Node vChild = pNode.getFirstChild(); vChild != null; vChild = vChild.getNextSibling()) { 131 131 xGetNodeToString(vChild, vBuf); 132 132 } 133 133 vResult = (vBuf.length() > 0) ? vBuf.substring(0) : ""; 134 com.scenari.s.fw.utils.HPoolBuffer.get().hFreeStringBu ffer(vBuf);134 com.scenari.s.fw.utils.HPoolBuffer.get().hFreeStringBuilder(vBuf); 135 135 } 136 136 break; … … 449 449 * 450 450 */ 451 private static final String xGetNodeToString(Node pNode, StringBu ffer pBuf) {451 private static final String xGetNodeToString(Node pNode, StringBuilder pBuf) { 452 452 453 453 String vResult = null; -
trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPathChaineProtegeAttHtml.java
r9559 r10372 85 85 String vString = wGetAsString(pCtx, fArg.execute(pCtx)); 86 86 87 StringBu ffer vBuf = new StringBuffer((int) (vString.length() * 1.1 + 5));87 StringBuilder vBuf = new StringBuilder((int) (vString.length() * 1.1 + 5)); 88 88 HEncodingXml.hWriteAttributHtmlValue(vBuf, vString); 89 89 -
trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPathChaineProtegeJs.java
r9746 r10372 79 79 String vString = wGetAsString(pCtx, fArg.execute(pCtx)); 80 80 81 StringBu ffer vBuf = new StringBuffer((int) (vString.length() * 1.1 + 5));81 StringBuilder vBuf = new StringBuilder((int) (vString.length() * 1.1 + 5)); 82 82 for (int i = 0; i < vString.length(); i++) { 83 83 char vCar = vString.charAt(i); -
trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPathConcatExpr.java
r9559 r10372 93 93 94 94 XString vResult = null; 95 StringBu ffer vBuf = new StringBuffer();95 StringBuilder vBuf = new StringBuilder(); 96 96 97 97 XObject vList = fArgList.execute(pXPathCtx); -
trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPathEscapeXslAtt.java
r9583 r10372 82 82 String vString = wGetAsString(pCtx, fArg.execute(pCtx)); 83 83 if (vString.indexOf('{') >= 0 || vString.indexOf('}') >= 0) { 84 StringBu ffer vBuf = new StringBuffer(vString.length() + 24);84 StringBuilder vBuf = new StringBuilder(vString.length() + 24); 85 85 for (int i = 0; i < vString.length(); i++) { 86 86 char vChar = vString.charAt(i); -
trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPathIdNode.java
r9589 r10372 129 129 vId = ((Element)pNode).getAttribute("id"); 130 130 if(vId != null) { 131 StringBu ffer vBuf = new StringBuffer(vResult.length() + vId.length() + 2);131 StringBuilder vBuf = new StringBuilder(vResult.length() + vId.length() + 2); 132 132 //On préfixe d'un 'N' l'id pour le différenier avec certitude des _meta, _A+axis, etc. 133 133 vBuf.append(vResult).append(IWContenuMgr.SEPARATOR_IDFROMURI).append('N').append(vId); … … 152 152 } 153 153 if (vCount != 0) { 154 StringBu ffer vBuf = new StringBuffer(vResult.length() + 10);154 StringBuilder vBuf = new StringBuilder(vResult.length() + 10); 155 155 vBuf.append(vResult).append(IWContenuMgr.SEPARATOR_IDFROMURI).append(HCharSeqUtil.hGetIntToString(vCount)); 156 156 vResult = vBuf.toString(); -
trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPathListXml.java
r9559 r10372 122 122 XString vResult = null; 123 123 String vContentNode = null; 124 StringBu ffer vBuf = com.scenari.s.fw.utils.HPoolBuffer.get().hGetStringBuffer();124 StringBuilder vBuf = com.scenari.s.fw.utils.HPoolBuffer.get().hGetStringBuilder(); 125 125 vBuf.append("<liste>"); 126 126 … … 160 160 } 161 161 162 com.scenari.s.fw.utils.HPoolBuffer.get().hFreeStringBu ffer(vBuf);162 com.scenari.s.fw.utils.HPoolBuffer.get().hFreeStringBuilder(vBuf); 163 163 164 164 return vResult; -
trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPathListXmlExpr.java
r9559 r10372 97 97 98 98 XString vResult = null; 99 StringBu ffer vBuf = com.scenari.s.fw.utils.HPoolBuffer.get().hGetStringBuffer();99 StringBuilder vBuf = com.scenari.s.fw.utils.HPoolBuffer.get().hGetStringBuilder(); 100 100 vBuf.append("<liste>"); 101 101 … … 122 122 } 123 123 124 com.scenari.s.fw.utils.HPoolBuffer.get().hFreeStringBu ffer(vBuf);124 com.scenari.s.fw.utils.HPoolBuffer.get().hFreeStringBuilder(vBuf); 125 125 126 126 return vResult; -
trunk/Jav_CO/com/scenari/m/co/xpath/dtm/ZXPathChaineProtegeAttHtml.java
r10215 r10372 108 108 String vString = wGetAsString(pCtx, fArg.execute(pCtx)); 109 109 110 StringBu ffer vBuf = new StringBuffer((int) (vString.length() * 1.1 + 5));110 StringBuilder vBuf = new StringBuilder((int) (vString.length() * 1.1 + 5)); 111 111 HEncodingXml.hWriteAttributHtmlValue(vBuf, vString); 112 112 -
trunk/Jav_CO/com/scenari/m/co/xpath/dtm/ZXPathChaineProtegeJs.java
r10215 r10372 109 109 String vString = wGetAsString(pCtx, fArg.execute(pCtx)); 110 110 111 StringBu ffer vBuf = new StringBuffer((int) (vString.length() * 1.1 + 5));111 StringBuilder vBuf = new StringBuilder((int) (vString.length() * 1.1 + 5)); 112 112 for (int i = 0; i < vString.length(); i++) { 113 113 char vCar = vString.charAt(i); -
trunk/Jav_CO/com/scenari/m/co/xpath/dtm/ZXPathConcatExpr.java
r10215 r10372 107 107 XObject vList = fArgList.execute(pCtx); 108 108 if (vList.getType() == XObject.CLASS_NODESET) { 109 StringBu ffer vBuf = new StringBuffer();109 StringBuilder vBuf = new StringBuilder(); 110 110 XNodeSet vNodeSet = (XNodeSet) vList; 111 111 boolean vIsFirst = true; -
trunk/Jav_CO/com/scenari/m/co/xpath/dtm/ZXPathListXml.java
r10215 r10372 136 136 137 137 XString vResult = null; 138 StringBu ffer vBuf = HPoolBuffer.get().hGetStringBuffer();138 StringBuilder vBuf = HPoolBuffer.get().hGetStringBuilder(); 139 139 vBuf.append("<liste>"); 140 140 … … 174 174 } 175 175 176 HPoolBuffer.get().hFreeStringBu ffer(vBuf);176 HPoolBuffer.get().hFreeStringBuilder(vBuf); 177 177 178 178 return vResult; -
trunk/Jav_CO/com/scenari/m/co/xpath/dtm/ZXPathListXmlExpr.java
r10215 r10372 119 119 120 120 XString vResult = null; 121 StringBu ffer vBuf = HPoolBuffer.get().hGetStringBuffer();121 StringBuilder vBuf = HPoolBuffer.get().hGetStringBuilder(); 122 122 vBuf.append("<liste>"); 123 123 … … 144 144 } 145 145 146 HPoolBuffer.get().hFreeStringBu ffer(vBuf);146 HPoolBuffer.get().hFreeStringBuilder(vBuf); 147 147 148 148 return vResult; -
trunk/Jav_CO/com/scenari/s/co/source/HRootSourceLoader.java
r1710 r10372 59 59 60 60 /** Buffer de caractères. */ 61 protected StringBu ffer fBuf = new StringBuffer(64);61 protected StringBuilder fBuf = new StringBuilder(64); 62 62 63 63 /** -
trunk/Jav_CO/com/scenari/s/co/source/HSource.java
r10196 r10372 117 117 while (!vOk) { 118 118 vID = Long.toString(Math.round(Math.random() * 100000)); 119 IHSource vChild = vParent.hFindSource(new StringBu ffer(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()); 120 120 if (vChild != null) { 121 121 vOk = vChild.hNewFile(); -
trunk/Jav_CO/com/scenari/s/co/source/HZipper.java
r3509 r10372 113 113 //On n'est pas le dossier racine 114 114 String vName = pSource.hGetName(); 115 vPath = new StringBu ffer(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(); 116 116 ZipEntry vEntry = new ZipEntry(vPath); 117 117 vEntry.setTime(pSource.hGetLastModif()); -
trunk/Jav_CO/com/scenari/s/co/source/fs/HSourceFs.java
r4675 r10372 148 148 } 149 149 } 150 StringBu ffer vBuf = null;150 StringBuilder vBuf = null; 151 151 int vOffset = 0; 152 152 if(pPath.charAt(0) == '/') { 153 153 //Url absolue 154 vBuf = new StringBu ffer(pPath.length());154 vBuf = new StringBuilder(pPath.length()); 155 155 vOffset = 1; 156 156 } else { … … 160 160 int vLastSlash = fUri.lastIndexOf('/'); 161 161 if(vLastSlash>0) { 162 vBuf = new StringBu ffer(vLastSlash + pPath.length());162 vBuf = new StringBuilder(vLastSlash + pPath.length()); 163 163 vBuf.append(fUri.substring(0, vLastSlash)); 164 164 } else { 165 vBuf = new StringBu ffer(pPath.length());165 vBuf = new StringBuilder(pPath.length()); 166 166 } 167 167 } else { 168 168 //Url relative par rapport à un dossier 169 vBuf = new StringBu ffer(fUri.length() + pPath.length());169 vBuf = new StringBuilder(fUri.length() + pPath.length()); 170 170 vBuf.append(fUri); 171 171 } … … 304 304 String vName = vChildsNames[i]; 305 305 WSourceElemFs vSrcChild = new WSourceElemFs(fElem, vName); 306 String vUri = new StringBu ffer(vLenPrefix+vName.length()).append(fUri).append('/').append(vName).toString();306 String vUri = new StringBuilder(vLenPrefix+vName.length()).append(fUri).append('/').append(vName).toString(); 307 307 pListToAppend.add(new HSourceFs(fStockSpace, fRoot, vSrcChild, vUri)); 308 308 } -
trunk/Jav_CO/com/scenari/s/co/sourcerel/WSourceRel.java
r4675 r10372 190 190 String vParent = pParent.hGetUri(); 191 191 String vName = wGetName(); 192 fUri = new StringBu ffer(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(); 193 193 } else { 194 194 //On est sur un nouveau Root. -
trunk/Jav_CO/com/scenari/s/co/sourcerel/WSourceRelFrontEnd.java
r4675 r10372 87 87 */ 88 88 protected IWSourceRel wGetChild(String pName) throws Exception { 89 return new WSourceRelFrontEnd(fBackEnd, new StringBu ffer(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); 90 90 } 91 91 -
trunk/Jav_CO/com/scenari/s/co/sourcerel/WSourceRelFrontEndWithRights.java
r4675 r10372 70 70 */ 71 71 protected IWSourceRel wGetChild(String pName) throws Exception { 72 return new WSourceRelFrontEndWithRights(fBackEnd, new StringBu ffer(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); 73 73 } 74 74 -
trunk/Jav_CO/com/scenari/s/co/transform/HTransformParams.java
r10028 r10372 135 135 try { 136 136 String vVal = URLEncoder.encode(fValue, "UTF-8"); 137 fQueryString = new StringBu ffer(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(); 138 138 } catch (Exception e) { 139 139 HLogMgr.hPublishException(e); … … 448 448 */ 449 449 public final String hGetQueryStringFromTop() { 450 StringBu ffer vBuf = new StringBuffer(256);451 hGetQueryStringBu fferFromTop(vBuf);450 StringBuilder vBuf = new StringBuilder(256); 451 hGetQueryStringBuilderFromTop(vBuf); 452 452 return vBuf.toString(); 453 453 } … … 465 465 */ 466 466 public final String hGetQueryStringFromThis() { 467 StringBu ffer vBuf = new StringBuffer(256);468 hGetQueryStringBu fferFromThis(vBuf);467 StringBuilder vBuf = new StringBuilder(256); 468 hGetQueryStringBuilderFromThis(vBuf); 469 469 return vBuf.toString(); 470 470 } … … 479 479 * Les HTransformParams de la racine jusqu'a celui-ci sont retournés. 480 480 */ 481 public final void hGetQueryStringBu fferFromTop(StringBuffer pBuf) {481 public final void hGetQueryStringBuilderFromTop(StringBuilder pBuf) { 482 482 if (fPrevTransform != null) { 483 fPrevTransform.hGetQueryStringBu fferFromTop(pBuf);483 fPrevTransform.hGetQueryStringBuilderFromTop(pBuf); 484 484 pBuf.append('&'); 485 485 } … … 505 505 * Sont retournés ce HTransformParams et ses descendants. 506 506 */ 507 public final void hGetQueryStringBu fferFromThis(StringBuffer pBuf) {507 public final void hGetQueryStringBuilderFromThis(StringBuilder pBuf) { 508 508 pBuf.append(PARAM_TRANSFORM_EQ); 509 509 pBuf.append(fTransformType); … … 517 517 if (fNextTransform != null) { 518 518 pBuf.append('&'); 519 fNextTransform.hGetQueryStringBu fferFromThis(pBuf);519 fNextTransform.hGetQueryStringBuilderFromThis(pBuf); 520 520 } 521 521 } -
trunk/Jav_CO/com/scenari/s/co/transform/xml/HTransformerPonctuation.java
r5250 r10372 83 83 } 84 84 85 StringBu ffer vS = new StringBuffer((int) (vTexte.length() * 1.3));85 StringBuilder vS = new StringBuilder((int) (vTexte.length() * 1.3)); 86 86 for (int i = 0; i < vTexte.length(); i++) { 87 87 switch (vTexte.charAt(i)) { … … 179 179 } 180 180 181 // static private void xRemoveSpaceBefore(StringBu ffer pSB) {181 // static private void xRemoveSpaceBefore(StringBuilder pSB) { 182 182 // int i = pSB.length() - 1; 183 183 // if (i > 0) { -
trunk/Jav_FW/com/scenari/c/fw/main/EServletModelXml.java
r6882 r10372 286 286 */ 287 287 protected String wLogRequeteClient(HttpServletRequest pRequest) { 288 StringBu ffer vBuf = new StringBuffer(256);288 StringBuilder vBuf = new StringBuilder(256); 289 289 vBuf.append("Encoding : "); 290 290 vBuf.append(pRequest.getCharacterEncoding()); -
trunk/Jav_FW/com/scenari/s/fw/enumeration/WView.java
r1702 r10372 74 74 public final String xSaveToBundle() { 75 75 76 StringBu ffer vResult = new StringBuffer();76 StringBuilder vResult = new StringBuilder(); 77 77 78 78 Enumeration vEnum = fViewValues.elements(); -
trunk/Jav_FW/com/scenari/s/fw/log/HLogMessage.java
r2232 r10372 166 166 public String hGetHtml() { 167 167 168 StringBu ffer vResult = new StringBuffer(256);168 StringBuilder vResult = new StringBuilder(256); 169 169 170 170 IHLogMessage vLogMessage = this; … … 232 232 */ 233 233 public String hGetString() { 234 StringBu ffer vResult = new StringBuffer(256);234 StringBuilder vResult = new StringBuilder(256); 235 235 236 236 IHLogMessage vLogMessage = this; … … 296 296 297 297 /** 298 * Ajoute au StringBu ffer passé en paramètre une forme HTML des attributs298 * Ajoute au StringBuilder passé en paramètre une forme HTML des attributs 299 299 * de ce message. Les messages parents ne sont pas décrits. 300 300 * 301 * @param pBuf java.lang.StringBu ffer : Buffer vers lequel envoyer la description Html du message.302 */ 303 public void hWriteHtml(StringBu ffer pBuf) {301 * @param pBuf java.lang.StringBuilder : Buffer vers lequel envoyer la description Html du message. 302 */ 303 public void hWriteHtml(StringBuilder pBuf) { 304 304 305 305 pBuf.append("<div>"); … … 321 321 322 322 /** 323 * Ajoute au StringBu ffer passé en paramètre une forme texte lisible des attributs323 * Ajoute au StringBuilder passé en paramètre une forme texte lisible des attributs 324 324 * de ce message. Les messages parents ne sont pas décrits. 325 325 * 326 * @param pBuf java.lang.StringBu ffer : Buffer vers lequel envoyer la description du message.327 */ 328 public void hWriteString(StringBu ffer pBuf) {326 * @param pBuf java.lang.StringBuilder : Buffer vers lequel envoyer la description du message. 327 */ 328 public void hWriteString(StringBuilder pBuf) { 329 329 330 330 pBuf.append("--- "); … … 348 348 * 349 349 */ 350 private void xFormatHtml(String pValue, StringBu ffer pBuf) {350 private void xFormatHtml(String pValue, StringBuilder pBuf) { 351 351 char vChar = 0; 352 352 for (int i = 0; i < pValue.length(); i++) { -
trunk/Jav_FW/com/scenari/s/fw/log/IHLogMessage.java
r2232 r10372 146 146 147 147 /** 148 * Ajoute au StringBu ffer passé en paramètre une forme HTML des attributs148 * Ajoute au StringBuilder passé en paramètre une forme HTML des attributs 149 149 * de ce message. Les messages parents ne sont pas décrits. 150 150 * 151 151 * @param pBuf Buffer vers lequel envoyer la description Html du message. 152 152 */ 153 public void hWriteHtml(StringBu ffer pBuf);153 public void hWriteHtml(StringBuilder pBuf); 154 154 155 155 /** … … 161 161 162 162 /** 163 * Ajoute au StringBu ffer passé en paramètre une forme texte lisible des attributs163 * Ajoute au StringBuilder passé en paramètre une forme texte lisible des attributs 164 164 * de ce message. Les messages parents ne sont pas décrits. 165 165 * 166 166 * @param pBuf Buffer vers lequel envoyer la description du message. 167 167 */ 168 public void hWriteString(StringBu ffer pBuf);168 public void hWriteString(StringBuilder pBuf); 169 169 } -
trunk/Jav_FW/com/scenari/s/fw/mem/HMemoryMgr.java
r8755 r10372 138 138 if (vTs > 0) { 139 139 vTs = System.currentTimeMillis() - vTs; 140 StringBu ffer vBuf = new StringBuffer(255);140 StringBuilder vBuf = new StringBuilder(255); 141 141 vBuf.append("Purge mémoire"); 142 142 vBuf.append("\nMémoire libre initiale : "); -
trunk/Jav_FW/com/scenari/s/fw/pooljdbc/HPoolMySql.java
r1702 r10372 152 152 public Connection hGetConnection() throws Exception { 153 153 if (fUrl == null) { 154 StringBu ffer vBuf = new StringBuffer();154 StringBuilder vBuf = new StringBuilder(); 155 155 vBuf.append("jdbc:mysql://"); 156 156 vBuf.append(fUrlServer); -
trunk/Jav_FW/com/scenari/s/fw/properties/HTextFileWriter.java
r1862 r10372 92 92 93 93 /** 94 * @param pLine java.lang.StringBu ffer94 * @param pLine java.lang.StringBuilder 95 95 */ 96 96 public void hWrite(String pLine) throws Exception { … … 99 99 100 100 /** 101 * @param pLine java.lang.StringBu ffer101 * @param pLine java.lang.StringBuilder 102 102 */ 103 103 public void hWriteCommentLine(String pLine) throws Exception { 104 104 105 StringBu ffer vLine = new StringBuffer();105 StringBuilder vLine = new StringBuilder(); 106 106 vLine.append('#').append(pLine).append('\n'); 107 107 fBufferedWriter.write(vLine.toString()); … … 110 110 111 111 /** 112 * @param pLine java.lang.StringBu ffer112 * @param pLine java.lang.StringBuilder 113 113 */ 114 public void hWriteCommentLine(StringBu ffer pLine) throws Exception {114 public void hWriteCommentLine(StringBuilder pLine) throws Exception { 115 115 fBufferedWriter.write(pLine.insert(0, '#').append('\n').toString()); 116 116 } 117 117 118 118 /** 119 * @param pLine java.lang.StringBu ffer119 * @param pLine java.lang.StringBuilder 120 120 */ 121 public void hWriteLine(StringBu ffer pLine) throws Exception {121 public void hWriteLine(StringBuilder pLine) throws Exception { 122 122 fBufferedWriter.write(pLine.append('\n').toString()); 123 123 } -
trunk/Jav_FW/com/scenari/s/fw/properties/loaders/xml/XAloneSaxHandler.java
r1702 r10372 73 73 fValue = new String(pChar, pStart, pLength); 74 74 } else { 75 fValue = new StringBu ffer(fValue.length() + pLength).append(fValue).append(pChar, pStart, pLength).toString();75 fValue = new StringBuilder(fValue.length() + pLength).append(fValue).append(pChar, pStart, pLength).toString(); 76 76 } 77 77 } -
trunk/Jav_FW/com/scenari/s/fw/properties/loaders/xml/XLogParamSaxHandler.java
r1702 r10372 121 121 122 122 protected String xReplace(String pSrc){ 123 StringBu ffer vRes = null;123 StringBuilder vRes = null; 124 124 if(pSrc != null) { 125 125 int vIdx = pSrc.indexOf('{'); 126 126 if(vIdx >= 0) { 127 vRes = new StringBu ffer(pSrc.length()+128);127 vRes = new StringBuilder(pSrc.length()+128); 128 128 if(vIdx>0) vRes.append(pSrc.substring(0, vIdx)); 129 129 int vIdxEnd = vIdx; -
trunk/Jav_FW/com/scenari/s/fw/properties/stringlist/HStringListLoaderFromTextFile.java
r1702 r10372 76 76 int vIndex = -1; 77 77 78 StringBu ffer vTrace = null;78 StringBuilder vTrace = null; 79 79 if (sTrace.hIsActive()) { 80 vTrace = new StringBu ffer();80 vTrace = new StringBuilder(); 81 81 vTrace.append("Read proerties : "); 82 82 vTrace.append(vProp.hGetCode()); … … 116 116 HStringListProperties vProp = (HStringListProperties)pProperties; 117 117 118 StringBu ffer vStringBuffer = new StringBuffer();118 StringBuilder vStringBuilder = new StringBuilder(); 119 119 120 120 Enumeration vEnumKey = vProp.hScanPropertyList().keys(); … … 122 122 123 123 while(vEnumKey.hasMoreElements()) { 124 vStringBu ffer.setLength(0);124 vStringBuilder.setLength(0); 125 125 try { 126 vStringBu ffer.append((String)vEnumKey.nextElement());127 vStringBu ffer.append('\t');128 vStringBu ffer.append(HStringProperty.hGetValue((HStringProperty)vEnumValue.nextElement(), pLevel));129 vWriter.hWriteLine(vStringBu ffer);126 vStringBuilder.append((String)vEnumKey.nextElement()); 127 vStringBuilder.append('\t'); 128 vStringBuilder.append(HStringProperty.hGetValue((HStringProperty)vEnumValue.nextElement(), pLevel)); 129 vWriter.hWriteLine(vStringBuilder); 130 130 } 131 131 catch (XPropertyNotFoundException e){ -
trunk/Jav_FW/com/scenari/s/fw/properties/stringlist/HStringListProperties.java
r1862 r10372 121 121 String vParam[] = new String[pParam.length]; 122 122 int vIndex[] = new int[pParam.length]; 123 StringBu ffer vResult = null;123 StringBuilder vResult = null; 124 124 String vValue = null; 125 125 int vLength = 0; … … 155 155 } 156 156 157 vResult = new StringBu ffer(vLength);157 vResult = new StringBuilder(vLength); 158 158 159 159 int vLastIndex = 0; -
trunk/Jav_FW/com/scenari/s/fw/util/xml/HEncodingXml.java
r9001 r10372 40 40 41 41 import java.io.IOException; 42 import java.io.Writer;43 42 44 43 /** … … 46 45 */ 47 46 public 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("""); 67 break; 68 } 69 case '<': { 70 pBuf.append("<"); 71 break; 72 } 73 case '>': { 74 pBuf.append(">"); 75 break; 76 } 77 case '&': { 78 pBuf.append("&"); 79 break; 80 } 81 case '\'': { 82 pBuf.append('\''); 83 //pBuf.append("'"); 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("""); 162 break; 163 } 164 case '<': { 165 pBuf.append("<"); 166 break; 167 } 168 case '>': { 169 pBuf.append(">"); 170 break; 171 } 172 case '&': { 173 pBuf.append("&"); 174 break; 175 } 176 case '\'': { 177 pBuf.append("'"); 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("""); 211 break; 212 } 213 case '<': { 214 pBuf.write("<"); 215 break; 216 } 217 case '>': { 218 pBuf.write(">"); 219 break; 220 } 221 case '&': { 222 pBuf.write("&"); 223 break; 224 } 225 case '\'': { 226 pBuf.write("'"); 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("""); 258 break; 259 } 260 case '<': { 261 pBuf.append("<"); 262 break; 263 } 264 case '>': { 265 pBuf.append(">"); 266 break; 267 } 268 case '&': { 269 pBuf.append("&"); 270 break; 271 } 272 case '\'': { 273 //pBuf.append("'"); 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("""); 295 break; 296 } 297 case '<': { 298 pBuf.append("<"); 299 break; 300 } 301 case '>': { 302 pBuf.append(">"); 303 break; 304 } 305 case '&': { 306 pBuf.append("&"); 307 break; 308 } 309 case '\'': { 310 pBuf.append("'"); 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("""); 333 break; 334 } 335 case '<': { 336 pBuf.append("<"); 337 break; 338 } 339 case '>': { 340 pBuf.append(">"); 341 break; 342 } 343 case '&': { 344 pBuf.append("&"); 345 break; 346 } 347 case '\'': { 348 pBuf.append("'"); 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("""); 66 break; 67 } 68 case '<': { 69 pBuf.append("<"); 70 break; 71 } 72 case '>': { 73 pBuf.append(">"); 74 break; 75 } 76 case '&': { 77 pBuf.append("&"); 78 break; 79 } 80 case '\'': { 81 pBuf.append('\''); 82 //pBuf.append("'"); 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("""); 154 break; 155 } 156 case '<': { 157 pBuf.append("<"); 158 break; 159 } 160 case '>': { 161 pBuf.append(">"); 162 break; 163 } 164 case '&': { 165 pBuf.append("&"); 166 break; 167 } 168 case '\'': { 169 pBuf.append("'"); 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("""); 201 break; 202 } 203 case '<': { 204 pBuf.append("<"); 205 break; 206 } 207 case '>': { 208 pBuf.append(">"); 209 break; 210 } 211 case '&': { 212 pBuf.append("&"); 213 break; 214 } 215 case '\'': { 216 //pBuf.append("'"); 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("""); 238 break; 239 } 240 case '<': { 241 pBuf.append("<"); 242 break; 243 } 244 case '>': { 245 pBuf.append(">"); 246 break; 247 } 248 case '&': { 249 pBuf.append("&"); 250 break; 251 } 252 case '\'': { 253 pBuf.append("'"); 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("""); 276 break; 277 } 278 case '<': { 279 pBuf.append("<"); 280 break; 281 } 282 case '>': { 283 pBuf.append(">"); 284 break; 285 } 286 case '&': { 287 pBuf.append("&"); 288 break; 289 } 290 case '\'': { 291 pBuf.append("'"); 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 } 369 316 } -
trunk/Jav_FW/com/scenari/s/fw/util/xml/HExtraitSaxHandlerToText.java
r1702 r10372 52 52 /** 53 53 * Permet de construire une chaine texte à partir d'évenements Sax. 54 * Attention le reset du StringBu ffer doit être assuré avant la transmission à ce SaxHandler.54 * Attention le reset du StringBuilder doit être assuré avant la transmission à ce SaxHandler. 55 55 * Les tag CDATA , les comments, les déclarations d'entités et de DTD ne sont pas recopiés. 56 56 * Les caractères ", '<', '>'ne sont pas escapés. … … 69 69 protected XMLReader fXMLReader = null; 70 70 71 /** StringBu ffer à remplir. */72 protected StringBu ffer fStringBuffer = null;71 /** StringBuilder à remplir. */ 72 protected StringBuilder fStringBuilder = null; 73 73 74 74 /** Compteur de la profondeur du tag en cours. */ … … 87 87 } 88 88 public final void characters(char[] pChar, int pStart, int pLength) throws SAXException { 89 fStringBu ffer.append(pChar, pStart, pLength);89 fStringBuilder.append(pChar, pStart, pLength); 90 90 } 91 91 /** … … 111 111 */ 112 112 public void endCDATA() throws org.xml.sax.SAXException { 113 //fStringBu ffer.append("]]>");113 //fStringBuilder.append("]]>"); 114 114 } 115 115 /** … … 157 157 158 158 //On ajoute ce fin de tag dans le buffer 159 if (fOffsetLastElementInDonnee == fStringBu ffer.length()) {160 if (fStringBu ffer.length() > 0) {159 if (fOffsetLastElementInDonnee == fStringBuilder.length()) { 160 if (fStringBuilder.length() > 0) { 161 161 //Pas de contenu au tag. 162 fStringBu ffer.setCharAt(fStringBuffer.length() - 1, '/');163 fStringBu ffer.append('>');162 fStringBuilder.setCharAt(fStringBuilder.length() - 1, '/'); 163 fStringBuilder.append('>'); 164 164 } 165 165 } else { 166 166 //Il y a eu un contenu au tag. 167 fStringBu ffer.append("</");168 fStringBu ffer.append(pQName);169 fStringBu ffer.append('>');167 fStringBuilder.append("</"); 168 fStringBuilder.append(pQName); 169 fStringBuilder.append('>'); 170 170 } 171 171 … … 205 205 * 206 206 * 207 * @return java.lang.StringBu ffer208 */ 209 public final StringBu ffer hGetStringBuffer() {210 return fStringBu ffer;207 * @return java.lang.StringBuilder 208 */ 209 public final StringBuilder hGetStringBuilder() { 210 return fStringBuilder; 211 211 } 212 212 /** … … 221 221 * 222 222 * 223 * @param pBuffer java.lang.StringBu ffer224 */ 225 public void hSetStringBu ffer(StringBuffer pBuffer) {226 fStringBu ffer = pBuffer;223 * @param pBuffer java.lang.StringBuilder 224 */ 225 public void hSetStringBuilder(StringBuilder pBuffer) { 226 fStringBuilder = pBuffer; 227 227 } 228 228 /** … … 345 345 */ 346 346 public void startCDATA() throws org.xml.sax.SAXException { 347 //fStringBu ffer.append("<![CDATA[");347 //fStringBuilder.append("<![CDATA["); 348 348 } 349 349 /** … … 397 397 398 398 //On ajoute ce tag dans le buffer 399 fStringBu ffer.append('<');400 fStringBu ffer.append(pQName);399 fStringBuilder.append('<'); 400 fStringBuilder.append(pQName); 401 401 402 402 //Prefixes … … 405 405 for (int i = 0; i < fPrefixMappingList.size(); i++) { 406 406 vPrefix = (String[])fPrefixMappingList.get(i); 407 fStringBu ffer.append(" xmlns:");408 fStringBu ffer.append(vPrefix[0]);409 fStringBu ffer.append("=\"");410 fStringBu ffer.append(vPrefix[1]);411 fStringBu ffer.append('\"');407 fStringBuilder.append(" xmlns:"); 408 fStringBuilder.append(vPrefix[0]); 409 fStringBuilder.append("=\""); 410 fStringBuilder.append(vPrefix[1]); 411 fStringBuilder.append('\"'); 412 412 } 413 413 fPrefixMappingList.clear(); … … 416 416 //Attributs 417 417 for (int i = 0; i < pAttributes.getLength(); i++) { 418 fStringBu ffer.append(' ');419 fStringBu ffer.append(pAttributes.getQName(i));420 fStringBu ffer.append("=\"");421 HEncodingXml.hWriteAttributValue(fStringBu ffer, pAttributes.getValue(i));422 fStringBu ffer.append('\"');418 fStringBuilder.append(' '); 419 fStringBuilder.append(pAttributes.getQName(i)); 420 fStringBuilder.append("=\""); 421 HEncodingXml.hWriteAttributValue(fStringBuilder, pAttributes.getValue(i)); 422 fStringBuilder.append('\"'); 423 423 } 424 fStringBu ffer.append('>');425 426 fOffsetLastElementInDonnee = fStringBu ffer.length();424 fStringBuilder.append('>'); 425 426 fOffsetLastElementInDonnee = fStringBuilder.length(); 427 427 428 428 //On incrémente la pile. -
trunk/Jav_FW/com/scenari/s/fw/util/xml/HExtraitSaxHandlerToXml.java
r1871 r10372 39 39 package com.scenari.s.fw.util.xml; 40 40 41 import java.io.IOException; 41 42 import java.util.ArrayList; 42 43 import java.util.List; … … 52 53 /** 53 54 * Permet de reconstruire une chaine texte représentant le document XML en cours de parsing. 54 * Attention le reset du StringBu ffer doit être assuré avant la transmission à ce SaxHandler.55 * Attention le reset du StringBuilder doit être assuré avant la transmission à ce SaxHandler. 55 56 * Cette implémentation nécessite une réfrence au XmlReader générant les évènements Sax pour réaffecter 56 57 * le content handler père lorsque le parsing sort du noeud racine où ce content handler a comencé. … … 58 59 public class HExtraitSaxHandlerToXml implements ContentHandler, LexicalHandler { 59 60 60 61 61 /** Handler père. */ 62 62 protected ContentHandler fParent = null; … … 64 64 /** Lexical Handler père. */ 65 65 protected LexicalHandler fLexParent = null; 66 66 67 67 /** Driver du parsing. */ 68 68 protected XMLReader fXMLReader = null; 69 70 /** StringBu ffer à remplir. */71 protected StringBu ffer fStringBuffer = null;72 69 70 /** StringBuilder à remplir. */ 71 protected StringBuilder fStringBuilder = null; 72 73 73 /** Compteur de la profondeur du tag en cours. */ 74 74 protected int fDepthTag = 0; 75 75 76 76 /** CDATA en cours. */ 77 77 protected boolean fInCdata = false; 78 78 79 79 /** Offset du car '>' du dernier startElement lu. */ 80 80 protected int fOffsetLastElementInDonnee = 0; … … 82 82 /** Liste de prefixMapping. */ 83 83 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 // 162 100 } 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); 171 177 } 172 178 } 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--; 177 196 } 178 197 179 //On décrémente la pile180 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)); 181 200 } 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 195 213 /** 196 214 * End the scope of a prefix-URI mapping. … … 208 226 * @see #endElement 209 227 */ 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 249 273 /** 250 274 * Receive notification of ignorable whitespace in element content. … … 271 295 * @see #characters 272 296 */ 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 276 301 /** 277 302 * Receive notification of a processing instruction. … … 292 317 * wrapping another exception. 293 318 */ 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 295 322 /** 296 323 * Receive an object for locating the origin of SAX document events. … … 318 345 * @see org.xml.sax.Locator 319 346 */ 320 public void setDocumentLocator(org.xml.sax.Locator locator) {} 347 public void setDocumentLocator(org.xml.sax.Locator locator) { 348 } 349 321 350 /** 322 351 * Receive notification of a skipped entity. … … 339 368 * wrapping another exception. 340 369 */ 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(); 424 461 } 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 497 535 /** 498 536 * Begin the scope of a prefix-URI Namespace mapping. … … 530 568 * @see #startElement 531 569 */ 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 } 538 577 } 539 } -
trunk/Jav_FW/com/scenari/s/fw/util/xml/HSaxHandlerToXml.java
r1702 r10372 39 39 package com.scenari.s.fw.util.xml; 40 40 41 import java.io.IOException; 41 42 import java.util.ArrayList; 42 43 import java.util.List; … … 51 52 /** 52 53 * Permet de reconstruire une chaine texte représentant le document XML en cours de parsing. 53 * Attention le reset du StringBu ffer doit être assuré avant la transmission à ce SaxHandler.54 * Attention le reset du StringBuilder doit être assuré avant la transmission à ce SaxHandler. 54 55 * Cette implémentation ne nécessite pas de référence au XmlReader ni au contentHandler père mais 55 56 * c'est à ce dernier de "reprendre la main". … … 57 58 public class HSaxHandlerToXml implements ContentHandler, LexicalHandler { 58 59 59 /** StringBu ffer à remplir. */60 protected StringBu ffer fStringBuffer = null;60 /** StringBuilder à remplir. */ 61 protected StringBuilder fStringBuilder = null; 61 62 62 63 /** CDATA en cours. */ … … 79 80 * 80 81 */ 81 public HSaxHandlerToXml(StringBu ffer pBuffer) {82 fStringBu ffer = pBuffer;82 public HSaxHandlerToXml(StringBuilder pBuffer) { 83 fStringBuilder = pBuffer; 83 84 } 84 85 … … 88 89 public final void characters(char[] pChar, int pStart, int pLength) throws SAXException { 89 90 if (fInCdata) { 90 fStringBu ffer.append(pChar, pStart, pLength);91 fStringBuilder.append(pChar, pStart, pLength); 91 92 } else { 92 HEncodingXml.hWriteTextValue(fStringBuffer, pChar, pStart, pLength); 93 try { 94 HEncodingXml.hWriteTextValue(fStringBuilder, pChar, pStart, pLength); 95 }catch (IOException e) { 96 // 97 } 93 98 } 94 99 } … … 104 109 */ 105 110 public void endCDATA() throws org.xml.sax.SAXException { 106 fStringBu ffer.append("]]>");111 fStringBuilder.append("]]>"); 107 112 fInCdata = false; 108 113 } … … 124 129 try { 125 130 //On ajoute ce fin de tag dans le buffer 126 if (fOffsetLastElementInDonnee == fStringBu ffer.length()) {127 if (fStringBu ffer.length() > 0) {131 if (fOffsetLastElementInDonnee == fStringBuilder.length()) { 132 if (fStringBuilder.length() > 0) { 128 133 //Pas de contenu au tag. 129 fStringBu ffer.setCharAt(fStringBuffer.length() - 1, '/');130 fStringBu ffer.append('>');134 fStringBuilder.setCharAt(fStringBuilder.length() - 1, '/'); 135 fStringBuilder.append('>'); 131 136 } 132 137 } else { 133 138 //Il y a eu un contenu au tag. 134 fStringBu ffer.append("</");135 fStringBu ffer.append(pQName);136 fStringBu ffer.append('>');139 fStringBuilder.append("</"); 140 fStringBuilder.append(pQName); 141 fStringBuilder.append('>'); 137 142 } 138 143 } catch (Exception e) { … … 153 158 /** 154 159 * 155 * @return StringBu ffer156 */ 157 public final StringBu ffer hGetStringBuffer() {158 return fStringBu ffer;159 } 160 161 /** 162 * 163 * @param pBuffer java.lang.StringBu ffer164 */ 165 public void hSetStringBu ffer(StringBuffer pBuffer) {166 fStringBu ffer = 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; 167 172 } 168 173 … … 193 198 */ 194 199 public void startCDATA() throws org.xml.sax.SAXException { 195 fStringBu ffer.append("<![CDATA[");200 fStringBuilder.append("<![CDATA["); 196 201 fInCdata = true; 197 202 } … … 215 220 216 221 //On ajoute ce tag dans le buffer 217 fStringBu ffer.append('<');218 fStringBu ffer.append(pQName);222 fStringBuilder.append('<'); 223 fStringBuilder.append(pQName); 219 224 220 225 //Prefixes … … 223 228 for (int i = 0; i < fPrefixMappingList.size(); i++) { 224 229 vPrefix = (String[]) fPrefixMappingList.get(i); 225 fStringBu ffer.append(" xmlns:");226 fStringBu ffer.append(vPrefix[0]);227 fStringBu ffer.append("=\"");228 fStringBu ffer.append(vPrefix[1]);229 fStringBu ffer.append('\"');230 fStringBuilder.append(" xmlns:"); 231 fStringBuilder.append(vPrefix[0]); 232 fStringBuilder.append("=\""); 233 fStringBuilder.append(vPrefix[1]); 234 fStringBuilder.append('\"'); 230 235 } 231 236 fPrefixMappingList.clear(); … … 234 239 //Attributs 235 240 for (int i = 0; i < pAttributes.getLength(); i++) { 236 fStringBu ffer.append(' ');237 fStringBu ffer.append(pAttributes.getQName(i));238 fStringBu ffer.append("=\"");239 HEncodingXml.hWriteAttributValue(fStringBu ffer, pAttributes.getValue(i));240 fStringBu ffer.append('\"');241 } 242 fStringBu ffer.append('>');243 244 fOffsetLastElementInDonnee = fStringBu ffer.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(); 245 250 246 251 } catch (Exception e) { -
trunk/Jav_FW/com/scenari/s/fw/util/xml/HXmlWriterSB.java
r1702 r10372 41 41 42 42 /** 43 * Sérialisation XML dans un StringBu ffer.43 * Sérialisation XML dans un StringBuilder. 44 44 */ 45 45 public class HXmlWriterSB implements IHXmlWriter { 46 46 47 StringBufferfBuf = null;48 49 /** 50 * 51 */ 52 public HXmlWriterSB( StringBufferpBuf) {47 Appendable fBuf = null; 48 49 /** 50 * 51 */ 52 public HXmlWriterSB(Appendable pBuf) { 53 53 super(); 54 54 fBuf = pBuf; -
trunk/Jav_FW/com/scenari/s/fw/utils/HCharSeqUtil.java
r9796 r10372 83 83 } 84 84 if (i < vLen) { 85 StringBu ffer vBuf = new StringBuffer(pCharSeq.length());85 StringBuilder vBuf = new StringBuilder(pCharSeq.length()); 86 86 for (int j = 0; j < i; j++) 87 87 vBuf.append(pCharSeq.charAt(j)); -
trunk/Jav_FW/com/scenari/s/fw/utils/HParamsQueryString.java
r9772 r10372 68 68 throw new IllegalArgumentException(); 69 69 } 70 StringBu ffer vBuf = new StringBuffer();70 StringBuilder vBuf = new StringBuilder(); 71 71 String vKey; 72 72 for (StringTokenizer vTok = new StringTokenizer(pParams, "&"); vTok.hasMoreTokens();) { … … 102 102 Map vMap = new HashMap(); 103 103 if (pParams == null) { throw new IllegalArgumentException(); } 104 StringBu ffer vBuf = new StringBuffer();104 StringBuilder vBuf = new StringBuilder(); 105 105 String vKey; 106 106 for (StringTokenizer vTok = new StringTokenizer(pParams, "&"); vTok.hasMoreTokens();) { … … 139 139 public static final void hParseQueryStringAsList(String pParams, List pList) { 140 140 if (pParams == null) throw new IllegalArgumentException(); 141 StringBu ffer vBuf = new StringBuffer();141 StringBuilder vBuf = new StringBuilder(); 142 142 for (StringTokenizer vTok = new StringTokenizer(pParams, "&"); vTok.hasMoreTokens();) { 143 143 String vPair = vTok.nextToken(); … … 265 265 public String toString() { 266 266 if(fLastModCount != modCount) { 267 StringBu ffer vBuf = new StringBuffer(16*size());267 StringBuilder vBuf = new StringBuilder(16*size()); 268 268 try { 269 269 for (int i = 0; i < this.size(); i=i+2) { … … 282 282 } 283 283 284 private static String parseName(String pName, StringBu ffer pBuf) {284 private static String parseName(String pName, StringBuilder pBuf) { 285 285 pBuf.setLength(0); 286 286 for (int i = 0; i < pName.length(); i++) { -
trunk/Jav_FW/com/scenari/s/fw/utils/HPoolBuffer.java
r2873 r10372 60 60 private ArrayList fBytes4096 = new ArrayList(); 61 61 62 private ArrayList fStringBu ffers = new ArrayList();62 private ArrayList fStringBuilders = new ArrayList(); 63 63 64 64 private ArrayList fStringWriters = new ArrayList(); … … 145 145 * 146 146 * 147 * @param pStringBu ffer StringBuffer148 */ 149 public final void hFreeStringBu ffer(StringBuffer pStringBuffer) {150 if (pStringBu ffer == null) {147 * @param pStringBuilder StringBuilder 148 */ 149 public final void hFreeStringBuilder(StringBuilder pStringBuilder) { 150 if (pStringBuilder == null) { 151 151 return; 152 152 } 153 pStringBu ffer.setLength(0);154 synchronized (fStringBu ffers) {155 fStringBu ffers.add(pStringBuffer);153 pStringBuilder.setLength(0); 154 synchronized (fStringBuilders) { 155 fStringBuilders.add(pStringBuilder); 156 156 } 157 157 } … … 276 276 277 277 /** 278 * Récupère un StringBu ffer avec une capacité initiale de 4096 caracteres.279 * ATTENTION : ne pas utiliser la méthode <code>vMonStringBu ffer.toString()</code> sur le280 * StringBu ffer récupéré car le buffer de caracteres est alors perdu car utilisé par l'objet String281 * résultant. Utiliser à la place la méthode <code>vMonStringBu ffer.substring(0);</code>.282 * 283 * 284 * @return StringBu ffer285 */ 286 public final StringBu ffer hGetStringBuffer() {287 StringBu ffer vResult;288 synchronized (fStringBu ffers) {289 if (fStringBu ffers.size() > 0) {290 vResult = (StringBu ffer) 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); 291 291 vResult.setLength(0); 292 292 } else { 293 vResult = new StringBu ffer(4096);293 vResult = new StringBuilder(4096); 294 294 } 295 295 } … … 304 304 * 305 305 * 306 * @return StringBu ffer306 * @return StringBuilder 307 307 */ 308 308 public final java.io.StringWriter hGetStringWriter() { -
trunk/Jav_FW/com/scenari/s/fw/utils/HUrl.java
r9772 r10372 363 363 boolean wroteUnencodedChar = false; 364 364 int maxBytesPerChar = 10; // rather arbitrary limit, but safe for now 365 StringBu ffer out = new StringBuffer(s.length());365 StringBuilder out = new StringBuilder(s.length()); 366 366 ByteArrayOutputStream buf = new ByteArrayOutputStream(maxBytesPerChar); 367 367 … … 502 502 } 503 503 } 504 StringBu ffer vBuf = new StringBuffer(pOffsetEnd - pOffset);504 StringBuilder vBuf = new StringBuilder(pOffsetEnd - pOffset); 505 505 for (int i = pOffset; i < pOffsetEnd;) { 506 506 char vChar = pUri.charAt(i); -
trunk/Jav_FW/com/scenari/s/fw/utils/stream/HBufferStreamChar.java
r9541 r10372 321 321 */ 322 322 public String toString() { 323 StringBu ffer vBuf = new StringBuffer(hGetLenght());323 StringBuilder vBuf = new StringBuilder(hGetLenght()); 324 324 for (int i = 0; i < fCountBuf; i++) { 325 325 vBuf.append(fBuf[i], 0, sLengthBuf); -
trunk/Jav_FW/com/scenari/s/fw/utils/stream/HStream.java
r1839 r10372 68 68 String vResult; 69 69 70 StringBu ffer vBuf = HPoolBuffer.get().hGetStringBuffer();70 StringBuilder vBuf = HPoolBuffer.get().hGetStringBuilder(); 71 71 char[] vChars = HPoolBuffer.get().hGetChars4096(); 72 72 … … 83 83 pReader.close(); 84 84 HPoolBuffer.get().hFreeChars(vChars); 85 HPoolBuffer.get().hFreeStringBu ffer(vBuf);85 HPoolBuffer.get().hFreeStringBuilder(vBuf); 86 86 87 87 } … … 101 101 String vResult; 102 102 103 StringBu ffer vBuf = new StringBuffer(pNbChars);103 StringBuilder vBuf = new StringBuilder(pNbChars); 104 104 char[] vChars = HPoolBuffer.get().hGetChars4096(); 105 105 -
trunk/Jav_GE/com/scenari/m/ge/agent/HADialogExport.java
r8541 r10372 198 198 * Ecrit le script correspondant à l'entrée dans ce dialogue. 199 199 */ 200 public final void hWriteScriptEntree(StringBu ffer pBuf) throws Exception {200 public final void hWriteScriptEntree(StringBuilder pBuf) throws Exception { 201 201 wWriteScriptEntree(pBuf); 202 202 } … … 205 205 * Ecrit le script correspondant à la sortie de ce dialogue. 206 206 */ 207 public final void hWriteScriptSortie(StringBu ffer pBuf, IHDialog pDialogSuivant) throws Exception {207 public final void hWriteScriptSortie(StringBuilder pBuf, IHDialog pDialogSuivant) throws Exception { 208 208 wWriteScriptSortie(pBuf, pDialogSuivant); 209 209 } … … 299 299 * Ecrit le script correspondant à l'entrée dans ce dialogue avec le code action 'GetNext'. 300 300 */ 301 protected void wScriptGetNext(StringBu ffer pBuf) throws Exception {301 protected void wScriptGetNext(StringBuilder pBuf) throws Exception { 302 302 303 303 IComputedData vActif = fAgent.hGetComposant().hGetActif().compute(this, fAgent, null, false); … … 315 315 //Attribut Actif de niveau interactif. 316 316 //Cas de l'agent actif 317 StringBu ffer vBufTrue = new StringBuffer(64);317 StringBuilder vBufTrue = new StringBuilder(64); 318 318 IWADialogExport vNewDialog = (IWADialogExport) fAgent.hNewDialog(this); 319 319 vNewDialog.hWriteScriptEntree(vBufTrue); 320 StringBu ffer vBufFalse = new StringBuffer(64);320 StringBuilder vBufFalse = new StringBuilder(64); 321 321 //Cas de l'agent inactif 322 322 wScriptGoToNext(vBufFalse); … … 330 330 * Ecrit le script correspondant à l'entrée dans ce dialogue avec le code action 'GetPrec'. 331 331 */ 332 protected void wScriptGetPrec(StringBu ffer pBuf) throws Exception {332 protected void wScriptGetPrec(StringBuilder pBuf) throws Exception { 333 333 334 334 IComputedData vActif = fAgent.hGetComposant().hGetActif().compute(this, fAgent, null, false); … … 346 346 //Attribut Actif de niveau interactif. 347 347 //Cas de l'agent actif 348 StringBu ffer vBufTrue = new StringBuffer(64);348 StringBuilder vBufTrue = new StringBuilder(64); 349 349 IWADialogExport vNewDialog = (IWADialogExport) fAgent.hNewDialog(this); 350 350 vNewDialog.hWriteScriptEntree(vBufTrue); 351 StringBu ffer vBufFalse = new StringBuffer(64);351 StringBuilder vBufFalse = new StringBuilder(64); 352 352 //Cas de l'agent inactif 353 353 wScriptGoToPrec(vBufFalse); … … 360 360 * Ecrit le script correspondant à l'entrée dans ce dialogue avec le code action 'GoTo'. 361 361 */ 362 protected void wScriptGoTo(StringBu ffer pBuf) throws Exception {362 protected void wScriptGoTo(StringBuilder pBuf) throws Exception { 363 363 364 364 IHDialog vDialog = hGoTo(fParam1); … … 377 377 * Ecrit le script correspondant à l'entrée dans ce dialogue avec le code action 'GoToNext'. 378 378 */ 379 protected void wScriptGoToNext(StringBu ffer pBuf) throws Exception {379 protected void wScriptGoToNext(StringBuilder pBuf) throws Exception { 380 380 381 381 //if (fAgent.hIsAgentPrinc()) { … … 404 404 * Ecrit le script correspondant à l'entrée dans ce dialogue avec le code action 'GoToPrec'. 405 405 */ 406 protected void wScriptGoToPrec(StringBu ffer pBuf) throws Exception {406 protected void wScriptGoToPrec(StringBuilder pBuf) throws Exception { 407 407 408 408 //if (fAgent.hIsAgentPrinc()) { … … 432 432 * Ecrit le script correspondant à l'entrée dans ce dialogue avec le code action 'Quit'. 433 433 */ 434 protected void wScriptQuit(StringBu ffer pBuf) throws Exception {434 protected void wScriptQuit(StringBuilder pBuf) throws Exception { 435 435 if (SCRIPT_MODE_EXE.equals(fScriptMode)) { 436 436 hGetGenerateur().wGetScripter().quit(pBuf); … … 446 446 * 447 447 */ 448 protected void wScriptRetourAccueil(StringBu ffer pBuf) throws Exception {448 protected void wScriptRetourAccueil(StringBuilder pBuf) throws Exception { 449 449 if (SCRIPT_MODE_EXE.equals(fScriptMode)) { 450 450 hGetGenerateur().wGetScripter().goHome(pBuf); … … 483 483 * 484 484 */ 485 protected void wWriteScriptEntree(StringBu ffer pBuf) throws Exception {485 protected void wWriteScriptEntree(StringBuilder pBuf) throws Exception { 486 486 487 487 String vCdAction = hGetCdAction(); … … 509 509 * 510 510 */ 511 protected void wWriteScriptSortie(StringBu ffer pBuf, IHDialog pDialogSuivant) throws Exception {511 protected void wWriteScriptSortie(StringBuilder pBuf, IHDialog pDialogSuivant) throws Exception { 512 512 } 513 513 -
trunk/Jav_GE/com/scenari/m/ge/agent/HAgentExport.java
r9965 r10372 280 280 281 281 // Ecriture du script 282 StringBu ffer vBuf = HPoolBuffer.get().hGetStringBuffer();282 StringBuilder vBuf = HPoolBuffer.get().hGetStringBuilder(); 283 283 // Calcul du script de sortie sur le dialogue précédent 284 284 if (pDialog instanceof IWADialogExport) { … … 288 288 vNewDialog.hWriteScriptEntree(vBuf); 289 289 String vResult = vBuf.substring(0); 290 HPoolBuffer.get().hFreeStringBu ffer(vBuf);290 HPoolBuffer.get().hFreeStringBuilder(vBuf); 291 291 292 292 return new DataVolatileString(vResult); … … 387 387 IWADialog vCurrentDialog = pDialog; 388 388 if (vFrom != null && vFrom.length() > 0) vCurrentDialog = (IWADialog) vCurrentDialog.hGoTo(vFrom); 389 StringBu ffer vDialogPath = new StringBuffer();389 StringBuilder vDialogPath = new StringBuilder(); 390 390 for (int i = 0; i < vDirs.length; i++) { 391 391 vDialogPath.setLength(0); … … 446 446 * 447 447 */ 448 protected String xLookForChildren(IWAgent pAgent, IWADialog pDialog, StringBu ffer pDialogPath, HParamsQueryString pParams, boolean pBackward) throws Exception {448 protected String xLookForChildren(IWAgent pAgent, IWADialog pDialog, StringBuilder pDialogPath, HParamsQueryString pParams, boolean pBackward) throws Exception { 449 449 if (pAgent != null && (pAgent instanceof IWAgentLinker)) { 450 450 IWAgent[] vChildren = ((IWAgentLinker) pAgent).hGetAgentsLies(pDialog, null); … … 533 533 534 534 // Serializer 535 StringBu ffer vBuf = HPoolBuffer.get().hGetStringBuffer();535 StringBuilder vBuf = HPoolBuffer.get().hGetStringBuilder(); 536 536 IHXmlWriter vWriter = new HXmlWriterSB(vBuf); 537 537 vWriter.hWriteOpenTag("outline"); … … 547 547 vWriter.hWriteCloseTag("outline"); 548 548 String vResult = vBuf.substring(0); 549 HPoolBuffer.get().hFreeStringBu ffer(vBuf);549 HPoolBuffer.get().hFreeStringBuilder(vBuf); 550 550 return new DataVolatileString(vResult); 551 551 } -
trunk/Jav_GE/com/scenari/m/ge/agent/IWADialogExport.java
r8541 r10372 105 105 * 106 106 */ 107 public void hWriteScriptEntree(StringBu ffer pBuf) throws Exception;107 public void hWriteScriptEntree(StringBuilder pBuf) throws Exception; 108 108 109 109 /** … … 111 111 * 112 112 */ 113 public void hWriteScriptSortie(StringBu ffer pBuf, IHDialog pDialogSuivant) throws Exception;113 public void hWriteScriptSortie(StringBuilder pBuf, IHDialog pDialogSuivant) throws Exception; 114 114 115 115 -
trunk/Jav_GE/com/scenari/m/ge/agent/OutlineWalker.java
r9420 r10372 150 150 151 151 /** Cursor : noeud de l'outline pointé par le walker */ 152 protected StringBu ffer fXCursorUrl = new StringBuffer(128);152 protected StringBuilder fXCursorUrl = new StringBuilder(128); 153 153 154 154 protected int fXCursorIdx = -1; -
trunk/Jav_GE/com/scenari/m/ge/agent/callgen/HDialogCallGen.java
r10138 r10372 102 102 fCurrentValue = new String(pChars, pStart, pLen); 103 103 } else { 104 fCurrentValue = new StringBu ffer(fCurrentValue.length() + pLen).append(fCurrentValue).append(pChars, pStart, pLen).toString();104 fCurrentValue = new StringBuilder(fCurrentValue.length() + pLen).append(fCurrentValue).append(pChars, pStart, pLen).toString(); 105 105 } 106 106 } … … 159 159 * Ecrit le script correspondant à l'entrée dans ce dialogue. 160 160 */ 161 protected void wWriteScriptEntree(StringBu ffer pBuf) throws Exception {161 protected void wWriteScriptEntree(StringBuilder pBuf) throws Exception { 162 162 if (CDACTION_GENERATE.equals(hGetCdAction())) { 163 163 ((HAgentCallGen) fAgent).setPageResOnDialog(this); … … 209 209 if (hGetCdAction().equals(CDACTION_GENERATE)) { 210 210 // Cette page est directement appelée 211 this.hWriteScriptEntree(new StringBu ffer());211 this.hWriteScriptEntree(new StringBuilder()); 212 212 } else { 213 213 return super.xExecute(); -
trunk/Jav_GE/com/scenari/m/ge/agent/grouppages/HDialogGroupPages.java
r7460 r10372 95 95 * Ecrit le script correspondant à l'entrée dans ce dialogue. 96 96 */ 97 protected void wWriteScriptEntree(StringBu ffer pBuf) throws Exception {97 protected void wWriteScriptEntree(StringBuilder pBuf) throws Exception { 98 98 //On parcours tous les agents affichages fils 99 99 Element vParent = hGetAgent().hGetElementRoot(); … … 146 146 if (hGetCdAction().equals(CDACTION_AFFICHER)) { 147 147 //Cette page est directement appelée 148 this.hWriteScriptEntree(new StringBu ffer());148 this.hWriteScriptEntree(new StringBuilder()); 149 149 } else { 150 150 return super.xExecute(); -
trunk/Jav_GE/com/scenari/m/ge/agent/pages/HDialogPages.java
r10215 r10372 259 259 * Ecrit le script correspondant à l'entrée dans ce dialogue. 260 260 */ 261 protected void wWriteScriptEntree(StringBu ffer pBuf) throws Exception {261 protected void wWriteScriptEntree(StringBuilder pBuf) throws Exception { 262 262 263 263 WComposantPages vComp = (WComposantPages) fAgent.hGetComposant(); … … 326 326 * Ecrit le script correspondant à la sortie de ce dialogue. 327 327 */ 328 protected void wWriteScriptSortie(StringBu ffer pBuf, IHDialog pDialogSuivant) throws Exception {328 protected void wWriteScriptSortie(StringBuilder pBuf, IHDialog pDialogSuivant) throws Exception { 329 329 if (fPageCourante != null) { 330 330 pBuf.append(fPageCourante.hGetScriptAvantSortie().getString(this, fAgent, fParam1)); … … 335 335 * 336 336 */ 337 public void xScriptGoToFirstActivePage(StringBu ffer pBuf, int pOffset) throws java.lang.Exception {337 public void xScriptGoToFirstActivePage(StringBuilder pBuf, int pOffset) throws java.lang.Exception { 338 338 XPage[] vPages = ((WComposantPages) fAgent.hGetComposant()).hGetPages(); 339 339 if (vPages.length == 0) { … … 376 376 } else if (hGetCdAction().equals(CDACTION_AFFICHER)) { 377 377 // Cette page est directement appelée 378 this.hWriteScriptEntree(new StringBu ffer());378 this.hWriteScriptEntree(new StringBuilder()); 379 379 } else { 380 380 return super.xExecute(); -
trunk/Jav_GE/com/scenari/m/ge/agent/scenario/HDialogScenario.java
r3325 r10372 104 104 * 105 105 */ 106 protected void wScriptGetNext(StringBu ffer pBuf) throws Exception {106 protected void wScriptGetNext(StringBuilder pBuf) throws Exception { 107 107 108 108 wScriptGoToNext(pBuf); … … 114 114 * 115 115 */ 116 protected void wScriptGetPrec(StringBu ffer pBuf) throws Exception {116 protected void wScriptGetPrec(StringBuilder pBuf) throws Exception { 117 117 118 118 wScriptGoToPrec(pBuf); … … 126 126 * 127 127 */ 128 public void wScriptGoToFin(StringBu ffer pBuf, boolean pForward) throws Exception {128 public void wScriptGoToFin(StringBuilder pBuf, boolean pForward) throws Exception { 129 129 130 130 if (pForward) { … … 140 140 * 141 141 */ 142 protected void wScriptGoToNext(StringBu ffer pBuf) throws Exception {142 protected void wScriptGoToNext(StringBuilder pBuf) throws Exception { 143 143 144 144 WComposantScenario vComp = (WComposantScenario) hGetAgent().hGetComposant(); … … 181 181 * 182 182 */ 183 protected void wScriptGoToPrec(StringBu ffer pBuf) throws Exception {183 protected void wScriptGoToPrec(StringBuilder pBuf) throws Exception { 184 184 185 185 WComposantScenario vComp = (WComposantScenario) hGetAgent().hGetComposant(); … … 222 222 * 223 223 */ 224 protected void wWriteScriptEntree(StringBu ffer pBuf) throws Exception {224 protected void wWriteScriptEntree(StringBuilder pBuf) throws Exception { 225 225 226 226 String vCdAction = hGetCdAction(); -
trunk/Jav_GE/com/scenari/m/ge/composant/scenario/WComposantScenario.java
r7364 r10372 89 89 90 90 if (sTrace.hIsActive()) { 91 StringBu ffer vBuf = new StringBuffer();91 StringBuilder vBuf = new StringBuilder(); 92 92 vBuf.append("Agents liés de " + pDialog.hGetAgent() + " :\n"); 93 93 for (int i = 0; i < vArray.length; i++) { -
trunk/Jav_GE/com/scenari/m/ge/composant/scenario/XNoeud.java
r7460 r10372 208 208 * 209 209 */ 210 public void wScriptGetNext(StringBu ffer pBuf, HDialogScenario pDialog) throws java.lang.Exception {210 public void wScriptGetNext(StringBuilder pBuf, HDialogScenario pDialog) throws java.lang.Exception { 211 211 212 212 WComposantScenario vComp = (WComposantScenario) pDialog.hGetAgent().hGetComposant(); … … 240 240 * 241 241 */ 242 public void wScriptGetPrec(StringBu ffer pBuf, HDialogScenario pDialog) throws java.lang.Exception {242 public void wScriptGetPrec(StringBuilder pBuf, HDialogScenario pDialog) throws java.lang.Exception { 243 243 244 244 WComposantScenario vComp = (WComposantScenario) pDialog.hGetAgent().hGetComposant(); … … 274 274 * 275 275 */ 276 public abstract boolean wScriptGoToNext(StringBu ffer pBuf, HDialogScenario pDialog) throws Exception;276 public abstract boolean wScriptGoToNext(StringBuilder pBuf, HDialogScenario pDialog) throws Exception; 277 277 278 278 /** … … 284 284 * 285 285 */ 286 public abstract boolean wScriptGoToNoeud(StringBu ffer pBuf, HDialogScenario pDialog, boolean pForward) throws Exception;286 public abstract boolean wScriptGoToNoeud(StringBuilder pBuf, HDialogScenario pDialog, boolean pForward) throws Exception; 287 287 288 288 /** … … 293 293 * 294 294 */ 295 public abstract boolean wScriptGoToPrec(StringBu ffer pBuf, HDialogScenario pDialog) throws Exception;295 public abstract boolean wScriptGoToPrec(StringBuilder pBuf, HDialogScenario pDialog) throws Exception; 296 296 297 297 /** -
trunk/Jav_GE/com/scenari/m/ge/composant/scenario/XNoeudFinal.java
r7460 r10372 80 80 * constituer un noeud de départ. 81 81 */ 82 public boolean wScriptGoToNext(StringBu ffer pBuf, HDialogScenario pDialog) throws Exception {82 public boolean wScriptGoToNext(StringBuilder pBuf, HDialogScenario pDialog) throws Exception { 83 83 return false; 84 84 } … … 92 92 * 93 93 */ 94 public boolean wScriptGoToNoeud(StringBu ffer pBuf, HDialogScenario pDialog, boolean pForward) throws java.lang.Exception {94 public boolean wScriptGoToNoeud(StringBuilder pBuf, HDialogScenario pDialog, boolean pForward) throws java.lang.Exception { 95 95 96 96 boolean vResult = true; … … 139 139 * constituer un noeud de départ. 140 140 */ 141 public boolean wScriptGoToPrec(StringBu ffer pBuf, HDialogScenario pDialog) throws Exception {141 public boolean wScriptGoToPrec(StringBuilder pBuf, HDialogScenario pDialog) throws Exception { 142 142 return false; 143 143 } -
trunk/Jav_GE/com/scenari/m/ge/composant/scenario/XNoeudInit.java
r7460 r10372 78 78 * contrainte n'est définie sur les noeuds initiaux. 79 79 */ 80 public boolean wScriptGoToNext(StringBu ffer pBuf, HDialogScenario pDialog) throws Exception {80 public boolean wScriptGoToNext(StringBuilder pBuf, HDialogScenario pDialog) throws Exception { 81 81 82 82 // On sort de ce noeud, on écrit le script de sortie. … … 99 99 * 100 100 */ 101 public boolean wScriptGoToNoeud(StringBu ffer pBuf, HDialogScenario pDialog, boolean pForward) throws java.lang.Exception {101 public boolean wScriptGoToNoeud(StringBuilder pBuf, HDialogScenario pDialog, boolean pForward) throws java.lang.Exception { 102 102 return false; 103 103 } … … 113 113 * contrainte n'est définie sur les noeuds initiaux. 114 114 */ 115 public boolean wScriptGoToPrec(StringBu ffer pBuf, HDialogScenario pDialog) throws Exception {115 public boolean wScriptGoToPrec(StringBuilder pBuf, HDialogScenario pDialog) throws Exception { 116 116 117 117 // On sort de ce noeud, on écrit le script de sortie. -
trunk/Jav_GE/com/scenari/m/ge/composant/scenario/XNoeudInteractif.java
r7460 r10372 145 145 * 146 146 */ 147 public boolean wScriptGoToNext(StringBu ffer pBuf, HDialogScenario pDialog) throws java.lang.Exception {147 public boolean wScriptGoToNext(StringBuilder pBuf, HDialogScenario pDialog) throws java.lang.Exception { 148 148 149 149 boolean vResult = false; … … 202 202 * 203 203 */ 204 public boolean wScriptGoToNoeud(StringBu ffer pBuf, HDialogScenario pDialog, boolean pForward) throws Exception {204 public boolean wScriptGoToNoeud(StringBuilder pBuf, HDialogScenario pDialog, boolean pForward) throws Exception { 205 205 206 206 //On cherche ce noeud … … 320 320 * 321 321 */ 322 public boolean wScriptGoToPrec(StringBu ffer pBuf, HDialogScenario pDialog) throws java.lang.Exception {322 public boolean wScriptGoToPrec(StringBuilder pBuf, HDialogScenario pDialog) throws java.lang.Exception { 323 323 324 324 boolean vResult = false; -
trunk/Jav_GE/com/scenari/m/ge/composant/scenario/XNoeudListe.java
r7460 r10372 88 88 * 89 89 */ 90 public boolean wScriptGoToNext(StringBu ffer pBuf, HDialogScenario pDialog) throws java.lang.Exception {90 public boolean wScriptGoToNext(StringBuilder pBuf, HDialogScenario pDialog) throws java.lang.Exception { 91 91 92 92 boolean vResult = false; … … 158 158 * 159 159 */ 160 public boolean wScriptGoToNoeud(StringBu ffer pBuf, HDialogScenario pDialog, boolean pForward) throws Exception {160 public boolean wScriptGoToNoeud(StringBuilder pBuf, HDialogScenario pDialog, boolean pForward) throws Exception { 161 161 162 162 //On cherche ce noeud … … 212 212 * 213 213 */ 214 public boolean wScriptGoToPrec(StringBu ffer pBuf, HDialogScenario pDialog) throws java.lang.Exception {214 public boolean wScriptGoToPrec(StringBuilder pBuf, HDialogScenario pDialog) throws java.lang.Exception { 215 215 216 216 boolean vResult = false; -
trunk/Jav_GE/com/scenari/m/ge/composant/scenario/XNoeudSingleton.java
r7460 r10372 88 88 * 89 89 */ 90 public boolean wScriptGoToNext(StringBu ffer pBuf, HDialogScenario pDialog) throws java.lang.Exception {90 public boolean wScriptGoToNext(StringBuilder pBuf, HDialogScenario pDialog) throws java.lang.Exception { 91 91 92 92 boolean vResult = false; … … 128 128 * 129 129 */ 130 public boolean wScriptGoToNoeud(StringBu ffer pBuf, HDialogScenario pDialog, boolean pForward) throws Exception {130 public boolean wScriptGoToNoeud(StringBuilder pBuf, HDialogScenario pDialog, boolean pForward) throws Exception { 131 131 132 132 // On chercher ce noeud … … 164 164 * 165 165 */ 166 public boolean wScriptGoToPrec(StringBu ffer pBuf, HDialogScenario pDialog) throws java.lang.Exception {166 public boolean wScriptGoToPrec(StringBuilder pBuf, HDialogScenario pDialog) throws java.lang.Exception { 167 167 168 168 boolean vResult = false; -
trunk/Jav_GE/com/scenari/m/ge/composant/scenario/XTransition.java
r7460 r10372 119 119 * 120 120 */ 121 public boolean wScript(StringBu ffer pBuf, XNoeud pNoeudFrom, HDialogScenario pDialog, boolean pForward) throws Exception {121 public boolean wScript(StringBuilder pBuf, XNoeud pNoeudFrom, HDialogScenario pDialog, boolean pForward) throws Exception { 122 122 123 123 boolean vResult = false; … … 137 137 if (HDonneeUtils.hIsLevelInteractif(vCondition.getMime())) { // Niveau 138 138 // interactif 139 StringBu ffer vBufTrue = new StringBuffer();139 StringBuilder vBufTrue = new StringBuilder(); 140 140 // On écrit le script de passage dans cette condition 141 141 vBufTrue.append(fScriptPassage.getString(pDialog, pDialog.hGetAgent(), null)); -
trunk/Jav_GE/com/scenari/m/ge/context/HContextGenerator.java
r4832 r10372 201 201 } else if (pBuffer instanceof Map) { 202 202 ((Map) pBuffer).clear(); 203 } else if (pBuffer instanceof StringBu ffer) {204 ((StringBu ffer) pBuffer).setLength(0);203 } else if (pBuffer instanceof StringBuilder) { 204 ((StringBuilder) pBuffer).setLength(0); 205 205 } 206 206 } -
trunk/Jav_GE/com/scenari/m/ge/generateur/GeneratorBase.java
r10215 r10372 265 265 266 266 /** Buffer temporaire des traces avant l'init de la destination. */ 267 protected StringBu ffer fTraceTemp = null;267 protected StringBuilder fTraceTemp = null; 268 268 269 269 /** Writer xml pour les traces. */ … … 677 677 */ 678 678 public String getIdAgentHier() throws Exception { 679 StringBu ffer vBuf = new StringBuffer();679 StringBuilder vBuf = new StringBuilder(); 680 680 IWAgent vAgent = null; 681 681 Iterator vHierIt = ((IWADialog) fCurrentDialog).hGetHier().iterator(); … … 758 758 int vEnd = pCdAgent.indexOf(ZXPathSwitchAxis.PREFIX); 759 759 if (pAxis != null && pAxis.length() > 0) { 760 StringBu ffer vBuf = new StringBuffer(pCdAgent.length() + pAxis.length() + ZXPathSwitchAxis.PREFIX.length());760 StringBuilder vBuf = new StringBuilder(pCdAgent.length() + pAxis.length() + ZXPathSwitchAxis.PREFIX.length()); 761 761 vBuf.append((vEnd < 0) ? pCdAgent : pCdAgent.substring(0, vEnd)); 762 762 vBuf.append(ZXPathSwitchAxis.PREFIX); … … 969 969 } 970 970 } else { 971 fTraceWriter = new HXmlWriterSB(new StringBu ffer());971 fTraceWriter = new HXmlWriterSB(new StringBuilder()); 972 972 } 973 973 … … 1336 1336 fDialogStack.addLast(pDialog); 1337 1337 if (sTraceLink.hIsActive()) { 1338 StringBu ffer vBuf = new StringBuffer(500);1338 StringBuilder vBuf = new StringBuilder(500); 1339 1339 vBuf.append("<lienpage>"); 1340 1340 vBuf.append("<dest>"); … … 1459 1459 } 1460 1460 if (fTraceWriter == null) { 1461 fTraceTemp = new StringBu ffer(256);1461 fTraceTemp = new StringBuilder(256); 1462 1462 fTraceWriter = new HXmlWriterSB(fTraceTemp); 1463 1463 fTraceWriter.hWriteHeaderXml("UTF-8"); … … 1489 1489 } 1490 1490 if (fTraceWriter == null) { 1491 fTraceTemp = new StringBu ffer(256);1491 fTraceTemp = new StringBuilder(256); 1492 1492 fTraceWriter = new HXmlWriterSB(fTraceTemp); 1493 1493 fTraceWriter.hWriteHeaderXml("UTF-8"); … … 1518 1518 } 1519 1519 if (fTraceWriter == null) { 1520 fTraceTemp = new StringBu ffer(256);1520 fTraceTemp = new StringBuilder(256); 1521 1521 fTraceWriter = new HXmlWriterSB(fTraceTemp); 1522 1522 fTraceWriter.hWriteHeaderXml("UTF-8"); … … 1710 1710 int vVal = pId; 1711 1711 1712 StringBu ffer vBuf = new StringBuffer(5);1712 StringBuilder vBuf = new StringBuilder(5); 1713 1713 do { 1714 1714 vBuf.append(ID_ENCODER[vVal % 26]); … … 2051 2051 } 2052 2052 2053 StringBu ffer vBuf = new StringBuffer(vUrlDst.length());2053 StringBuilder vBuf = new StringBuilder(vUrlDst.length()); 2054 2054 int vIdx = vSlashSrc; 2055 2055 while (vIdx > 0) { … … 2079 2079 int vLastPt = pString.lastIndexOf('.'); 2080 2080 if(vFirstPt != vLastPt) { 2081 StringBu ffer vBuf = new StringBuffer(pString.length());2081 StringBuilder vBuf = new StringBuilder(pString.length()); 2082 2082 for (int i = 0; i < vFirstPt; i++) { 2083 2083 vBuf.append(pString.charAt(i)); -
trunk/Jav_GE/com/scenari/m/ge/generateur/IScripter.java
r5442 r10372 50 50 * de publication : ordre javascript, spécification d'une url relative ou absolue, etc. 51 51 */ 52 public void loadPage(StringBu ffer pBuf, IDynamicFile pPage) throws Exception;52 public void loadPage(StringBuilder pBuf, IDynamicFile pPage) throws Exception; 53 53 54 54 /** … … 57 57 * de publication : ordre javascript, spécification d'une url relative ou absolue, etc. 58 58 */ 59 public void loadUrl(StringBu ffer pBuf, String pUrl) throws Exception;59 public void loadUrl(StringBuilder pBuf, String pUrl) throws Exception; 60 60 61 61 /** 62 62 * Quitte le système. 63 63 * 64 * @param pBuf java.lang.StringBu ffer64 * @param pBuf java.lang.StringBuilder 65 65 * @exception java.lang.Exception The exception description. 66 66 */ 67 public void quit(StringBu ffer pBuf) throws Exception;67 public void quit(StringBuilder pBuf) throws Exception; 68 68 69 69 /** 70 70 * Retourne à l'accueil du système : home page LMS, etc. 71 71 * 72 * @param pBuf java.lang.StringBu ffer72 * @param pBuf java.lang.StringBuilder 73 73 * @exception java.lang.Exception The exception description. 74 74 */ 75 public void goHome(StringBu ffer pBuf) throws Exception;75 public void goHome(StringBuilder pBuf) throws Exception; 76 76 77 77 /** -
trunk/Jav_GE/com/scenari/m/ge/generateur/ScripterDefault.java
r5442 r10372 52 52 * 53 53 */ 54 public void loadPage(StringBu ffer pBuf, IDynamicFile pPage) throws Exception {54 public void loadPage(StringBuilder pBuf, IDynamicFile pPage) throws Exception { 55 55 pBuf.append(pPage.getDestUrl()); 56 56 } … … 59 59 * 60 60 */ 61 public void loadUrl(StringBu ffer pBuf, String pUrl) throws Exception {61 public void loadUrl(StringBuilder pBuf, String pUrl) throws Exception { 62 62 pBuf.append(pUrl); 63 63 } … … 67 67 * Non géré par ce scripter. 68 68 * 69 * @param pBuf java.lang.StringBu ffer69 * @param pBuf java.lang.StringBuilder 70 70 * @exception java.lang.Exception The exception description. 71 71 */ 72 public void quit(StringBu ffer pBuf) throws Exception {72 public void quit(StringBuilder pBuf) throws Exception { 73 73 } 74 74 … … 76 76 * Non géré par ce scripter. 77 77 */ 78 public void goHome(StringBu ffer pBuf) throws Exception {78 public void goHome(StringBuilder pBuf) throws Exception { 79 79 } 80 80 -
trunk/Jav_GE/com/scenari/m/ge/generateur/ScripterJs.java
r5442 r10372 53 53 * 54 54 */ 55 public void loadPage(StringBu ffer pBuf, IDynamicFile pPage) throws Exception {55 public void loadPage(StringBuilder pBuf, IDynamicFile pPage) throws Exception { 56 56 57 57 String vUrl = pPage.getDestUrl(); … … 70 70 * 71 71 */ 72 public void loadUrl(StringBu ffer pBuf, String pUrl) throws Exception {72 public void loadUrl(StringBuilder pBuf, String pUrl) throws Exception { 73 73 pBuf.append("ih.load('"); 74 74 pBuf.append(pUrl); … … 79 79 * 80 80 */ 81 public void quit(StringBu ffer pBuf) throws Exception {81 public void quit(StringBuilder pBuf) throws Exception { 82 82 pBuf.append("ih.quit();"); 83 83 } … … 86 86 * 87 87 */ 88 public void goHome(StringBu ffer pBuf) throws Exception {88 public void goHome(StringBuilder pBuf) throws Exception { 89 89 pBuf.append("ih.retouraccueil();"); 90 90 } -
trunk/Jav_GE/com/scenari/m/ge/generator/web/ScripterUrl.java
r5442 r10372 18 18 * 19 19 */ 20 public void loadPage(StringBu ffer pBuf, IDynamicFile pPage) throws Exception {20 public void loadPage(StringBuilder pBuf, IDynamicFile pPage) throws Exception { 21 21 pBuf.append(fGenerator.resolveDestUri2DestUrl(pPage.getDestUri())); 22 22 } … … 25 25 * 26 26 */ 27 public void loadUrl(StringBu ffer pBuf, String pUrl) throws Exception {27 public void loadUrl(StringBuilder pBuf, String pUrl) throws Exception { 28 28 pBuf.append(pUrl); 29 29 } … … 32 32 * 33 33 */ 34 public void quit(StringBu ffer pBuf) throws Exception {34 public void quit(StringBuilder pBuf) throws Exception { 35 35 // 36 36 } … … 39 39 * 40 40 */ 41 public void goHome(StringBu ffer pBuf) throws Exception {41 public void goHome(StringBuilder pBuf) throws Exception { 42 42 // 43 43 } -
trunk/Jav_GE/com/scenari/m/ge/generator/web/WebGenerator.java
r10257 r10372 2 2 3 3 import java.io.File; 4 import java.io.IOException; 4 5 import java.io.OutputStream; 5 6 import java.io.Reader; … … 22 23 import com.scenari.m.co.agent.IWAgent; 23 24 import com.scenari.m.co.dialog.IHDialog; 25 import com.scenari.m.co.donnee.IAgentData; 24 26 import com.scenari.m.co.donnee.IData; 25 import com.scenari.m.co.donnee.IAgentData;26 27 import com.scenari.m.co.instance.IWInstFormation; 27 28 import com.scenari.m.co.user.IWUser; … … 54 55 public class WebGenerator extends GeneratorBase { 55 56 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 } 491 495 492 496 protected IHSource xLookForFreeDst(IHSource pDst) throws Exception { 493 497 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 } 509 513 return pDst; 510 514 } 511 515 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 path536 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 extension556 if(vIsFolder) {557 //La cible est un dossier, on vire l'extension558 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 extension562 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 de580 * 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écursivement594 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 fichier613 * à 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 destination627 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'export630 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'output639 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 sortie666 FastWriter vWriterEncours = fBroker.getFastWriter(fDestRoot.hFindElemByPath(fCurrentDestUri).hGetOutputStream(), xGetWmDstEncoding());667 //Exécution du template668 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és698 wAddFileExported(fCurrentPubFile.hGetUri(), vLastModifSrc, fCurrentDestUri);699 }700 }701 702 /**703 * En cas de translate du dossier site, l'url est transformée ; en cas704 * de translate en dehors, le fichier est recopié dans le dossier des705 * 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 DestUri720 //-> on le veut dans le site généré, donc on recopie cette ressource dans721 //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 source731 IHSource vPubFile = fPubRoot.hFindSource(pPubUri);732 if (vPubFile.hGetStatus() != IHSource.STATUS_NONE) {733 //On cherche un nom de destniation734 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éatoires745 } 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 correpondant757 * 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 dossiers763 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 } 832 836 } -
trunk/Jav_GE/com/scenari/m/ge/pages/DynamicInclWriter.java
r5731 r10372 83 83 84 84 /** Buffer de l'inclusion. */ 85 protected StringBu ffer fBuff = null;85 protected StringBuilder fBuff = null; 86 86 87 87 /** Liste des resolvers d'inclusion. */ … … 172 172 //On a trouvé un tag d'ouverture 173 173 if (fBuff == null) { 174 fBuff = new StringBu ffer(64);174 fBuff = new StringBuilder(64); 175 175 } 176 176 fStatus = STATUS_TAGIN; … … 191 191 //On a trouvé un tag d'ouverture 192 192 if (fBuff == null) { 193 fBuff = new StringBu ffer(64);193 fBuff = new StringBuilder(64); 194 194 } 195 195 fStatus = STATUS_TAGIN; -
trunk/Jav_GE/com/scenari/m/ge/pages/TplXslPage.java
r10350 r10372 120 120 //DTM fNextDtm = null; 121 121 122 protected StringWriter fStringBu ffer = null;122 protected StringWriter fStringBuilder = null; 123 123 124 124 protected class ParamsContentHandler extends DefaultHandler { … … 198 198 //Version OPTIMISEE en attente de suppr disable-output-escaping. 199 199 //fNextTransformer.transformNode(fNextDtm.getDocument(), xPrepareNextAndGetOutputTarget(i + 1, vStream, pDialogPage)); 200 fNextTransformer.transform(new StreamSource(new StringReader(fStringBu ffer.toString())), xPrepareNextAndGetOutputTarget(i + 1, vStream, pDialogPage));200 fNextTransformer.transform(new StreamSource(new StringReader(fStringBuilder.toString())), xPrepareNextAndGetOutputTarget(i + 1, vStream, pDialogPage)); 201 201 } 202 202 } … … 262 262 fNextTransformer = null; 263 263 //fNextDtm = null; 264 fStringBu ffer = null;264 fStringBuilder = null; 265 265 266 266 //On est à la fin on retourne le sérialisateur final … … 275 275 //return new SAXResult(fNextDtm.getContentHandler()); 276 276 277 fStringBu ffer = new StringWriter();278 ContentHandler vHandler = SerializerFactory.getSerializerFactory(Method.XML).makeSerializer(fStringBu ffer, sXmlDefaulFormat).asContentHandler();277 fStringBuilder = new StringWriter(); 278 ContentHandler vHandler = SerializerFactory.getSerializerFactory(Method.XML).makeSerializer(fStringBuilder, sXmlDefaulFormat).asContentHandler(); 279 279 return new SAXResult(vHandler); 280 280 } -
trunk/Jav_GE/com/scenari/m/ge/xpath/dom/ZXPathIdExportAgentHier.java
r9559 r10372 97 97 if (vDialog != null && vDialog instanceof IWADialog) { 98 98 try { 99 StringBu ffer vBuf = new StringBuffer();99 StringBuilder vBuf = new StringBuilder(); 100 100 IWAgent vAgent = null; 101 101 Iterator vHierIt = ((IWADialog)vDialog).hGetHier().iterator(); -
trunk/Jav_GE/com/scenari/m/ge/xpath/dom/builder/ZXPathGetContent.java
r7467 r10372 95 95 if (vCdModel != null) { 96 96 if (vAxis != null && vAxis.length() > 0) { 97 StringBu ffer vBuf = new StringBuffer(vCdModel.length() + vAxis.length() + ZXPathSwitchAxis.PREFIX.length());97 StringBuilder vBuf = new StringBuilder(vCdModel.length() + vAxis.length() + ZXPathSwitchAxis.PREFIX.length()); 98 98 vBuf.append(vCdModel); 99 99 vBuf.append(ZXPathSwitchAxis.PREFIX); -
trunk/Jav_GE/com/scenari/m/ge/xpath/dom/builder/ZXPathGetFullTitleText.java
r7467 r10372 96 96 if (vCdModel != null) { 97 97 if (vAxis != null && vAxis.length() > 0) { 98 StringBu ffer vBuf = new StringBuffer(vCdModel.length() + vAxis.length() + ZXPathSwitchAxis.PREFIX.length());98 StringBuilder vBuf = new StringBuilder(vCdModel.length() + vAxis.length() + ZXPathSwitchAxis.PREFIX.length()); 99 99 vBuf.append(vCdModel); 100 100 vBuf.append(ZXPathSwitchAxis.PREFIX); -
trunk/Jav_GE/com/scenari/m/ge/xpath/dom/builder/ZXPathGetShortTitleText.java
r7467 r10372 96 96 if (vCdModel != null) { 97 97 if (vAxis != null && vAxis.length() > 0) { 98 StringBu ffer vBuf = new StringBuffer(vCdModel.length() + vAxis.length() + ZXPathSwitchAxis.PREFIX.length());98 StringBuilder vBuf = new StringBuilder(vCdModel.length() + vAxis.length() + ZXPathSwitchAxis.PREFIX.length()); 99 99 vBuf.append(vCdModel); 100 100 vBuf.append(ZXPathSwitchAxis.PREFIX); -
trunk/Jav_GE/com/scenari/m/ge/xpath/dom/builder/ZXPathGetUrl.java
r7467 r10372 98 98 if (vCdModel != null) { 99 99 if (vAxis != null && vAxis.length() > 0) { 100 StringBu ffer vBuf = new StringBuffer(vCdModel.length() + vAxis.length() + ZXPathSwitchAxis.PREFIX.length());100 StringBuilder vBuf = new StringBuilder(vCdModel.length() + vAxis.length() + ZXPathSwitchAxis.PREFIX.length()); 101 101 vBuf.append(vCdModel); 102 102 vBuf.append(ZXPathSwitchAxis.PREFIX); -
trunk/Jav_GE/com/scenari/m/ge/xpath/dom/builder/ZXPathGetView.java
r8684 r10372 102 102 if (vCdModel != null) { 103 103 if (vAxis != null && vAxis.length() > 0) { 104 StringBu ffer vBuf = new StringBuffer(vCdModel.length() + vAxis.length() + ZXPathSwitchAxis.PREFIX.length());104 StringBuilder vBuf = new StringBuilder(vCdModel.length() + vAxis.length() + ZXPathSwitchAxis.PREFIX.length()); 105 105 vBuf.append(vCdModel); 106 106 vBuf.append(ZXPathSwitchAxis.PREFIX); -
trunk/Jav_GE/com/scenari/m/ge/xpath/dom/builder/ZXPathSwitchAxis.java
r5778 r10372 96 96 int vEnd = vCdAgent.indexOf(PREFIX); 97 97 if(vAxis != null && vAxis.length() > 0) { 98 StringBu ffer vBuf = new StringBuffer(vCdAgent.length() + vAxis.length() + PREFIX.length());98 StringBuilder vBuf = new StringBuilder(vCdAgent.length() + vAxis.length() + PREFIX.length()); 99 99 vBuf.append((vEnd < 0) ? vCdAgent : vCdAgent.substring(0, vEnd)); 100 100 vBuf.append(PREFIX); -
trunk/Jav_GE/com/scenari/m/ge/xpath/dtm/ZXPathIdExportAgentHier.java
r10215 r10372 123 123 if (vDialog != null && vDialog instanceof IWADialog) { 124 124 try { 125 StringBu ffer vBuf = new StringBuffer();125 StringBuilder vBuf = new StringBuilder(); 126 126 IWAgent vAgent = null; 127 127 Iterator vHierIt = ((IWADialog)vDialog).hGetHier().iterator(); -
trunk/Jav_GE/com/scenari/s/ge/javascript/HJavascriptUtil.java
r7460 r10372 39 39 package com.scenari.s.ge.javascript; 40 40 41 import java.io.IOException; 42 41 43 import com.scenari.m.co.donnee.IData; 42 44 import com.scenari.s.fw.log.HLogMgr; … … 47 49 */ 48 50 public 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(); 100 56 } 101 57 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) { 103 65 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(); 123 73 } 124 74 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 '\'': { 137 145 pBuf.append("\\\'"); 138 146 break; 139 147 } 140 case '\"' : {148 case '\"': { 141 149 pBuf.append("\\\""); 142 150 break; 143 151 } 144 case '\\' : {152 case '\\': { 145 153 pBuf.append("\\\\"); 146 154 break; 147 155 } 148 case '\n' : {156 case '\n': { 149 157 pBuf.append("\\n"); 150 158 break; 151 159 } 152 case '\r' : {160 case '\r': { 153 161 // 154 162 break; 155 163 } 156 case '\t' : {164 case '\t': { 157 165 pBuf.append("\\t"); 158 166 break; 159 } 167 } 160 168 default: { 161 169 pBuf.append(vCar); 162 170 } 171 } 172 } 173 } catch (IOException e) { 174 HLogMgr.hPublishException(e); 163 175 } 164 176 } 165 177 } 166 } -
trunk/Res_ScXmlParser/com/bluecast/xml/Piccolo.java
r10191 r10372 429 429 int attributeType = -1; 430 430 431 StringBu ffer modelBuffer = new StringBuffer(100);431 StringBuilder modelBuffer = new StringBuilder(100); 432 432 433 433 ElementDefinition elementDefinition = null; -
trunk/Res_ScXmlParser/com/bluecast/xml/Piccolo.y
r937 r10372 561 561 int saxVersion = 0; 562 562 int attributeType=-1; 563 StringBu ffer modelBuffer = new StringBuffer(100);563 StringBuilder modelBuffer = new StringBuilder(100); 564 564 ElementDefinition elementDefinition=null; 565 565 String pubID=null,sysID=null; -
trunk/Res_ScXmlParser/com/scenari/entitymap/GeneralEntitiesMap.java
r10191 r10372 132 132 Properties vProps = new Properties(); 133 133 vProps.load(pStream); 134 StringBu ffer vBuf = new StringBuffer(32);134 StringBuilder vBuf = new StringBuilder(32); 135 135 for (Iterator vIt = vProps.entrySet().iterator(); vIt.hasNext();) { 136 136 vBuf.setLength(0); -
trunk/Res_ScXmlSerializer/com/scenari/xerces/serialize/BaseMarkupSerializer.java
r10348 r10372 228 228 229 229 /** Temporary buffer to store character data */ 230 protected final StringBu ffer fStrBuffer = new StringBuffer(40);230 protected final StringBuilder fStrBuffer = new StringBuilder(40); 231 231 232 232 /** -
trunk/Res_ScXmlSerializer/com/scenari/xerces/serialize/IndentPrinter.java
r10214 r10372 81 81 * be reused by deleting its contents instead of reallocating it. 82 82 */ 83 private StringBu ffer _line;83 private StringBuilder _line; 84 84 85 85 … … 89 89 * or {@link #breakLine}, this part is added to the accumulated line. 90 90 */ 91 private StringBu ffer _text;91 private StringBuilder _text; 92 92 93 93 … … 118 118 super( writer, format ); 119 119 // Initialize everything for a first/second run. 120 _line = new StringBu ffer( 80 );121 _text = new StringBu ffer( 20 );120 _line = new StringBuilder( 80 ); 121 _text = new StringBuilder( 20 ); 122 122 _spaces = 0; 123 123 _thisIndent = _nextIndent = 0; … … 139 139 if ( _dtdWriter == null ) { 140 140 _line.append( _text ); 141 _text = new StringBu ffer( 20 );141 _text = new StringBuilder( 20 ); 142 142 flushLine( false ); 143 143 _dtdWriter = new StringWriter(); … … 158 158 if ( _writer == _dtdWriter ) { 159 159 _line.append( _text ); 160 _text = new StringBu ffer( 20 );160 _text = new StringBuilder( 20 ); 161 161 flushLine( false ); 162 162 _writer = _docWriter; … … 182 182 183 183 184 public void printText( StringBu ffer text )184 public void printText( StringBuilder text ) 185 185 { 186 186 _text.append( text.toString() ); … … 250 250 } 251 251 _line.append( _text ); 252 _text = new StringBu ffer( 20 );252 _text = new StringBuilder( 20 ); 253 253 } 254 254 // Starting a new word: accumulate the text between the line … … 280 280 } 281 281 _line.append( _text ); 282 _text = new StringBu ffer( 20 );282 _text = new StringBuilder( 20 ); 283 283 } 284 284 flushLine( preserveSpace ); … … 329 329 _writer.write( _line.toString() ); 330 330 331 _line = new StringBu ffer( 40 );331 _line = new StringBuilder( 40 ); 332 332 } catch ( IOException except ) { 333 333 // We don't throw an exception, but hold it -
trunk/Res_ScXmlSerializer/com/scenari/xerces/serialize/NamespaceSupport.java
r10214 r10372 307 307 308 308 public String toString() { 309 StringBu ffer buf = new StringBuffer();309 StringBuilder buf = new StringBuilder(); 310 310 for (int i = 0; i < size; i++) { 311 311 buf.append(prefixes[i]); -
trunk/Res_ScXmlSerializer/com/scenari/xerces/serialize/Printer.java
r10214 r10372 222 222 223 223 224 public void printText( StringBu ffer text )224 public void printText( StringBuilder text ) 225 225 throws IOException 226 226 { -
trunk/Res_ScXmlSerializer/com/scenari/xerces/serialize/XMLSerializer.java
r10214 r10372 517 517 518 518 if (!_format.getOmitXMLDeclaration()) { 519 StringBu ffer buffer;519 StringBuilder buffer; 520 520 521 521 // Serialize the document declaration appreaing at the head 522 522 // of very XML document (unless asked not to). 523 buffer = new StringBu ffer("<?xml version=\"");523 buffer = new StringBuilder("<?xml version=\""); 524 524 if (_format.getVersion() != null) 525 525 buffer.append(_format.getVersion()); -
trunk/Res_ScXslt/com/scenari/xsldom/xalan/extensions/MethodResolver.java
r9494 r10372 1019 1019 private static String errArgs(Object[] xsltArgs, int startingArg) 1020 1020 { 1021 StringBu ffer returnArgs = new StringBuffer();1021 StringBuilder returnArgs = new StringBuilder(); 1022 1022 for (int i = startingArg; i < xsltArgs.length; i++) 1023 1023 { -
trunk/Res_ScXslt/com/scenari/xsldom/xalan/processor/CompiledStylesheetBundle.java
r1711 r10372 352 352 { 353 353 int fnstart=baseLocation.lastIndexOf(separator); 354 StringBu ffer subdir=new StringBuffer(354 StringBuilder subdir=new StringBuilder( 355 355 (fnstart>=0) 356 356 ? baseLocation.substring(0,fnstart+1) -
trunk/Res_ScXslt/com/scenari/xsldom/xalan/processor/CompilingStylesheetHandler.java
r1711 r10372 377 377 // though I doubt that's significantly faster than SAX and it's 378 378 // definitely less convenient if further processing is desired. 379 StringBu ffer body=exec.getBody().append(379 StringBuilder body=exec.getBody().append( 380 380 "if(transformer.S_DEBUG)\n" 381 381 +" transformer.getTraceManager().fireTraceEvent(sourceNode, mode, this);\n" … … 459 459 } 460 460 461 int compileElemTemplateElement(ElemTemplateElement kid,StringBu ffer body,Vector interpretVector)461 int compileElemTemplateElement(ElemTemplateElement kid,StringBuilder body,Vector interpretVector) 462 462 { 463 463 int maythrow=0; … … 491 491 } 492 492 493 int compileElemLiteralResult(ElemLiteralResult ele,StringBu ffer body,Vector interpretVector)493 int compileElemLiteralResult(ElemLiteralResult ele,StringBuilder body,Vector interpretVector) 494 494 { 495 495 int maythrow=0; … … 570 570 "avtStringedValue=((com.scenari.xsldom.xalan.templates.AVT)" 571 571 +"(m_interpretArray["+offset+"])" 572 +").evaluate(xctxt,sourceNode,this,new StringBu ffer());\n"572 +").evaluate(xctxt,sourceNode,this,new StringBuilder());\n" 573 573 +"if(null!=avtStringedValue)\n{\n" 574 574 ); … … 612 612 Stack attrSetStack=new Stack(); 613 613 614 void compileUseAttrSet(ElemTemplateElement ete,StringBu ffer body,Vector interpretVector)614 void compileUseAttrSet(ElemTemplateElement ete,StringBuilder body,Vector interpretVector) 615 615 { 616 616 ++uniqueVarSuffix; // Maintain unique variable naming … … 665 665 } 666 666 667 String compileAVTvalue(com.scenari.xsldom.xalan.templates.AVT avt,StringBu ffer body,Vector interpretVector)667 String compileAVTvalue(com.scenari.xsldom.xalan.templates.AVT avt,StringBuilder body,Vector interpretVector) 668 668 { 669 669 // Literal string is easy -- except for potential of " within "". … … 690 690 "( ((com.scenari.xsldom.xalan.templates.AVT)m_interpretArray[" 691 691 +offset 692 +"]).evaluate(transformer.getXPathContext(),sourceNode,this,new StringBu ffer()) )"692 +"]).evaluate(transformer.getXPathContext(),sourceNode,this,new StringBuilder()) )" 693 693 ; 694 694 } … … 702 702 return "null"; 703 703 704 StringBu ffer out=new StringBuffer("\""); // don't use '"', it's taken as int704 StringBuilder out=new StringBuilder("\""); // don't use '"', it's taken as int 705 705 706 706 int startpos=0,quotepos; … … 718 718 // String val = transformer.transformToString(this, sourceNode, mode); 719 719 // Returns string econtaiing result expression 720 String compileTransformToString(ElemTemplateElement ea,StringBu ffer body,Vector interpretVector)720 String compileTransformToString(ElemTemplateElement ea,StringBuilder body,Vector interpretVector) 721 721 { 722 722 ++uniqueVarSuffix; // Maintain unique variable naming … … 760 760 761 761 762 void compileElemAttribute(ElemAttribute ea,StringBu ffer body,Vector interpretVector)762 void compileElemAttribute(ElemAttribute ea,StringBuilder body,Vector interpretVector) 763 763 { 764 764 ++uniqueVarSuffix; // Maintain unique variable naming … … 884 884 int uniqueVarSuffix=0; 885 885 886 void compileChildTemplates(ElemTemplateElement source,StringBu ffer body,Vector interpretVector)886 void compileChildTemplates(ElemTemplateElement source,StringBuilder body,Vector interpretVector) 887 887 { 888 888 int maythrow=0; … … 966 966 967 967 int fnstart=filename.lastIndexOf(File.separator); 968 StringBu ffer subdir=new StringBuffer(968 StringBuilder subdir=new StringBuilder( 969 969 (fnstart>=0) 970 970 ? filename.substring(0,fnstart) -
trunk/Res_ScXslt/com/scenari/xsldom/xalan/processor/ProcessorCharacters.java
r1711 r10372 226 226 * occured. 227 227 */ 228 private StringBu ffer m_accumulator = new StringBuffer();228 private StringBuilder m_accumulator = new StringBuilder(); 229 229 230 230 /** -
trunk/Res_ScXslt/com/scenari/xsldom/xalan/processor/XSLTAttributeDef.java
r3876 r10372 439 439 } 440 440 441 StringBu ffer outBuf = new StringBuffer();441 StringBuilder outBuf = new StringBuilder(); 442 442 443 443 outBuf.append("set"); -
trunk/Res_ScXslt/com/scenari/xsldom/xalan/stree/DocImpl.java
r2194 r10372 95 95 package com.scenari.xsldom.xalan.stree; 96 96 97 import com.scenari.xsldom.xml.utils.FastStringBu ffer;97 import com.scenari.xsldom.xml.utils.FastStringBuilder; 98 98 import com.scenari.xsldom.xpath.XPathContext; 99 99 … … 116 116 * characters events. This allows us to not have to allocate 117 117 * a million little arrays. */ 118 FastStringBu ffer m_chars;118 FastStringBuilder m_chars; 119 119 120 120 /** Contains exception thrown from transformation thread, … … 147 147 super(null); 148 148 // Just an initial guess at reasonable tuning parameters 149 m_chars = new FastStringBu ffer(13, 13);149 m_chars = new FastStringBuilder(13, 13); 150 150 // m_id = m_idCount++; 151 151 } … … 159 159 /* 160 160 * (Note that this takes an initial text buffer size, in characters, 161 * as its input parameter. FastStringBu ffer's constructor expects the161 * as its input parameter. FastStringBuilder's constructor expects the 162 162 * number of bits (power of two) needed to span that size. We need to 163 163 * convert.) … … 174 174 if ((charBufSize & mask) != 0) ++bitCount; 175 175 176 m_chars = new FastStringBu ffer(bitCount);176 m_chars = new FastStringBuilder(bitCount); 177 177 178 178 // m_id = m_idCount++; -
trunk/Res_ScXslt/com/scenari/xsldom/xalan/stree/TextImpl.java
r7476 r10372 100 100 import org.xml.sax.ContentHandler; 101 101 102 import com.scenari.xsldom.xml.utils.FastStringBu ffer;102 import com.scenari.xsldom.xml.utils.FastStringBuilder; 103 103 import com.scenari.xsldom.xml.utils.XMLCharacterRecognizer; 104 104 … … 169 169 170 170 // m_data = new String(ch, start, start+length); 171 FastStringBu ffer fsb = doc.m_chars;171 FastStringBuilder fsb = doc.m_chars; 172 172 173 173 synchronized (fsb) { … … 182 182 /** 183 183 * 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 FastStringBu ffer pool.184 * its data as a local string and that in which the data has been placed in a FastStringBuilder pool. 185 185 * 186 186 * @param ch … … 292 292 m_start = -1; 293 293 } 294 m_data = new StringBu ffer(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(); 295 295 } 296 296 -
trunk/Res_ScXslt/com/scenari/xsldom/xalan/templates/AVT.java
r9560 r10372 105 105 import com.scenari.xsldom.xalan.res.XSLMessages; 106 106 import com.scenari.xsldom.xalan.res.XSLTErrorResources; 107 import com.scenari.xsldom.xml.utils.FastStringBu ffer;108 import com.scenari.xsldom.xml.utils.StringBu fferPool;107 import com.scenari.xsldom.xml.utils.FastStringBuilder; 108 import com.scenari.xsldom.xml.utils.StringBuilderPool; 109 109 import com.scenari.xsldom.xpath.XPath; 110 110 import com.scenari.xsldom.xpath.XPathContext; … … 226 226 int nTokens = tokenizer.countTokens(); 227 227 228 FastStringBu ffer buffer = StringBufferPool.get();229 FastStringBu ffer exprBuffer = StringBufferPool.get();228 FastStringBuilder buffer = StringBuilderPool.get(); 229 FastStringBuilder exprBuffer = StringBuilderPool.get(); 230 230 231 231 try { … … 409 409 } 410 410 } finally { 411 StringBu fferPool.free(buffer);412 StringBu fferPool.free(exprBuffer);411 StringBuilderPool.free(buffer); 412 StringBuilderPool.free(exprBuffer); 413 413 } 414 414 } // end else nTokens > 1 … … 431 431 return m_simpleString; 432 432 } else if (null != m_parts) { 433 FastStringBu ffer buf = StringBufferPool.get();433 FastStringBuilder buf = StringBuilderPool.get(); 434 434 String s; 435 435 … … 447 447 s = buf.toString(); 448 448 } finally { 449 StringBu fferPool.free(buf);449 StringBuilderPool.free(buf); 450 450 } 451 451 … … 470 470 public String evaluate(XPathContext xctxt, Node context, com.scenari.xsldom.xml.utils.PrefixResolver nsNode) throws javax.xml.transform.TransformerException { 471 471 472 FastStringBu ffer buf = StringBufferPool.get();472 FastStringBuilder buf = StringBuilderPool.get(); 473 473 474 474 try { … … 491 491 } 492 492 } finally { 493 StringBu fferPool.free(buf);493 StringBuilderPool.free(buf); 494 494 } 495 495 } -
trunk/Res_ScXslt/com/scenari/xsldom/xalan/templates/AVTPart.java
r9560 r10372 97 97 import org.w3c.dom.Node; 98 98 99 import com.scenari.xsldom.xml.utils.FastStringBu ffer;99 import com.scenari.xsldom.xml.utils.FastStringBuilder; 100 100 import com.scenari.xsldom.xpath.XPathContext; 101 101 … … 133 133 */ 134 134 public abstract void evaluate( 135 XPathContext xctxt, FastStringBu ffer buf, Node context,135 XPathContext xctxt, FastStringBuilder buf, Node context, 136 136 com.scenari.xsldom.xml.utils.PrefixResolver nsNode) 137 137 throws javax.xml.transform.TransformerException; -
trunk/Res_ScXslt/com/scenari/xsldom/xalan/templates/AVTPartSimple.java
r1711 r10372 97 97 import org.w3c.dom.Node; 98 98 99 import com.scenari.xsldom.xml.utils.FastStringBu ffer;99 import com.scenari.xsldom.xml.utils.FastStringBuilder; 100 100 import com.scenari.xsldom.xpath.XPathContext; 101 101 … … 144 144 * @param NodeList The current Context Node List. 145 145 */ 146 public void evaluate(XPathContext xctxt, FastStringBu ffer buf,146 public void evaluate(XPathContext xctxt, FastStringBuilder buf, 147 147 Node context, 148 148 com.scenari.xsldom.xml.utils.PrefixResolver nsNode) -
trunk/Res_ScXslt/com/scenari/xsldom/xalan/templates/AVTPartXPath.java
r9559 r10372 97 97 import org.w3c.dom.Node; 98 98 99 import com.scenari.xsldom.xml.utils.FastStringBu ffer;99 import com.scenari.xsldom.xml.utils.FastStringBuilder; 100 100 import com.scenari.xsldom.xpath.XPath; 101 101 import com.scenari.xsldom.xpath.XPathContext; … … 179 179 */ 180 180 public void evaluate( 181 XPathContext xctxt, FastStringBu ffer buf, Node context, com.scenari.xsldom.xml.utils.PrefixResolver nsNode)181 XPathContext xctxt, FastStringBuilder buf, Node context, com.scenari.xsldom.xml.utils.PrefixResolver nsNode) 182 182 throws javax.xml.transform.TransformerException 183 183 { -
trunk/Res_ScXslt/com/scenari/xsldom/xalan/templates/ElemNumber.java
r7307 r10372 111 111 import com.scenari.xsldom.xalan.transformer.DecimalToRoman; 112 112 import com.scenari.xsldom.xalan.transformer.TransformerImpl; 113 import com.scenari.xsldom.xml.utils.FastStringBu ffer;113 import com.scenari.xsldom.xml.utils.FastStringBuilder; 114 114 import com.scenari.xsldom.xml.utils.NodeVector; 115 115 import com.scenari.xsldom.xml.utils.QName; 116 import com.scenari.xsldom.xml.utils.StringBu fferPool;116 import com.scenari.xsldom.xml.utils.StringBuilderPool; 117 117 import com.scenari.xsldom.xml.utils.res.XResourceBundle; 118 118 import com.scenari.xsldom.xpath.NodeSet; … … 1120 1120 1121 1121 String numStr; 1122 FastStringBu ffer formattedNumber = StringBufferPool.get();1122 FastStringBuilder formattedNumber = StringBuilderPool.get(); 1123 1123 1124 1124 try … … 1248 1248 finally 1249 1249 { 1250 StringBu fferPool.free(formattedNumber);1250 StringBuilderPool.free(formattedNumber); 1251 1251 } 1252 1252 … … 1274 1274 TransformerImpl transformer, Node contextNode, 1275 1275 char numberType, int numberWidth, int listElement, 1276 FastStringBu ffer formattedNumber)1276 FastStringBuilder formattedNumber) 1277 1277 throws javax.xml.transform.TransformerException 1278 1278 { … … 1319 1319 } 1320 1320 1321 FastStringBu ffer stringBuf = StringBufferPool.get();1321 FastStringBuilder stringBuf = StringBuilderPool.get(); 1322 1322 1323 1323 try … … 1330 1330 finally 1331 1331 { 1332 StringBu fferPool.free(stringBuf);1332 StringBuilderPool.free(stringBuf); 1333 1333 } 1334 1334 break; … … 1597 1597 */ 1598 1598 protected void int2alphaCount(int val, char[] aTable, 1599 FastStringBu ffer stringBuf)1599 FastStringBuilder stringBuf) 1600 1600 { 1601 1601 -
trunk/Res_ScXslt/com/scenari/xsldom/xalan/templates/OutputProperties.java
r7456 r10372 107 107 108 108 import com.scenari.xsldom.xalan.serialize.Method; 109 import com.scenari.xsldom.xml.utils.FastStringBu ffer;109 import com.scenari.xsldom.xml.utils.FastStringBuilder; 110 110 import com.scenari.xsldom.xml.utils.QName; 111 111 import com.scenari.xsldom.xml.utils.WrappedRuntimeException; … … 678 678 679 679 // Just an initial guess at reasonable tuning parameters 680 FastStringBu ffer fsb = new FastStringBuffer(9, 9);680 FastStringBuilder fsb = new FastStringBuilder(9, 9); 681 681 682 682 for (int i = 0; i < s; i++) { … … 741 741 int l = s.length(); 742 742 boolean inCurly = false; 743 FastStringBu ffer buf = new FastStringBuffer();743 FastStringBuilder buf = new FastStringBuilder(); 744 744 745 745 // parse through string, breaking on whitespaces. I do this instead -
trunk/Res_ScXslt/com/scenari/xsldom/xalan/xslt/EnvironmentCheck.java
r3877 r10372 797 797 798 798 // Found Xalan-J 1.x, grab it's version fields 799 StringBu ffer buf = new StringBuffer();799 StringBuilder buf = new StringBuilder(); 800 800 Field f = clazz.getField("PRODUCT"); 801 801 … … 826 826 827 827 // Found Xalan-J 2.x, grab it's version fields 828 StringBu ffer buf = new StringBuffer();828 StringBuilder buf = new StringBuilder(); 829 829 Field f = clazz.getField("PRODUCT"); 830 830 -
trunk/Res_ScXslt/com/scenari/xsldom/xml/utils/FastStringBuilder.java
r1711 r10372 98 98 * Bare-bones, unsafe, fast string buffer. No thread-safety, no 99 99 * parameter range checking, exposed fields. Note that in typical 100 * applications, thread-safety of a StringBu ffer is a somewhat100 * applications, thread-safety of a StringBuilder is a somewhat 101 101 * dubious concept in any case. 102 102 * <p> 103 * Note that Stree is using a single FastStringBu ffer as a string pool,103 * Note that Stree is using a single FastStringBuilder as a string pool, 104 104 * by recording start and length indices within a single buffer. This 105 105 * minimizes heap overhead, but of course requires more work when retrieving … … 119 119 * <p> 120 120 * */ 121 public class FastStringBu ffer121 public class FastStringBuilder 122 122 { 123 123 /** Field m_chunkBits sets our chunking strategy, by saying how many … … 128 128 129 129 /** Field m_maxChunkBits affects our chunk-growth strategy, by saying what 130 * the largest permissible chunk size is in this particular FastStringBu ffer130 * the largest permissible chunk size is in this particular FastStringBuilder 131 131 * hierarchy. */ 132 132 int m_maxChunkBits=15; … … 136 136 * into the first chunk of the next size up. For example, if m_rechunkBits 137 137 * is set to 3, then after 8 chunks at a given size we will rebundle 138 * them as the first element of a FastStringBu ffer using a chunk size138 * them as the first element of a FastStringBuilder using a chunk size 139 139 * 8 times larger (chunkBits shifted left three bits). 140 140 */ … … 162 162 /** Field m_lastChunk is an index into m_array[], pointing to the last 163 163 * chunk of the Chunked Array currently in use. Note that additional 164 * chunks may actually be allocated, eg if the FastStringBu ffer had164 * chunks may actually be allocated, eg if the FastStringBuilder had 165 165 * previously been truncated or if someone issued an ensureSpace request. 166 166 * <p> … … 172 172 /** Field m_firstFree is an index into m_array[m_lastChunk][], pointing to 173 173 * the first character in the Chunked Array which is not part of the 174 * FastStringBu ffer's current content. Since m_array[][] is zero-based,174 * FastStringBuilder's current content. Since m_array[][] is zero-based, 175 175 * the length of that content can be calculated as 176 176 * (m_lastChunk<<m_chunkBits) + m_firstFree */ 177 177 int m_firstFree = 0; 178 178 179 /** Field m_innerFSB, when non-null, is a FastStringBu ffer whose total179 /** Field m_innerFSB, when non-null, is a FastStringBuilder whose total 180 180 * length equals m_chunkSize, and which replaces m_array[0]. This allows 181 * building a hierarchy of FastStringBu ffers, where early appends use181 * building a hierarchy of FastStringBuilders, where early appends use 182 182 * a smaller chunkSize (for less wasted memory overhead) but later 183 183 * ones use a larger chunkSize (for less heap activity overhead). 184 184 */ 185 FastStringBu ffer m_innerFSB=null;186 187 /** 188 * Construct a FastStringBu ffer, with allocation policy as per parameters.185 FastStringBuilder m_innerFSB=null; 186 187 /** 188 * Construct a FastStringBuilder, with allocation policy as per parameters. 189 189 * <p> 190 190 * For coding convenience, I've expressed both allocation sizes in terms of … … 207 207 * advance before we attempt to take a step from initChunkBits to maxChunkBits 208 208 */ 209 public FastStringBu ffer(int initChunkBits,int maxChunkBits, int rebundleBits)209 public FastStringBuilder(int initChunkBits,int maxChunkBits, int rebundleBits) 210 210 { 211 211 m_array = new char[16][]; … … 225 225 226 226 /** 227 * Construct a FastStringBu ffer, using a default rebundleBits value.228 */ 229 public FastStringBu ffer(int initChunkBits,int maxChunkBits)227 * Construct a FastStringBuilder, using a default rebundleBits value. 228 */ 229 public FastStringBuilder(int initChunkBits,int maxChunkBits) 230 230 { 231 231 this(initChunkBits,maxChunkBits,2); … … 233 233 234 234 /** 235 * Construct a FastStringBu ffer, using default maxChunkBits and235 * Construct a FastStringBuilder, using default maxChunkBits and 236 236 * rebundleBits values. 237 237 * <p> … … 241 241 * @param 242 242 */ 243 public FastStringBu ffer(int initChunkBits)243 public FastStringBuilder(int initChunkBits) 244 244 { 245 245 this(initChunkBits,15,2); 246 246 } 247 247 /** 248 * Construct a FastStringBu ffer, using a default allocation policy.249 */ 250 public FastStringBu ffer()248 * Construct a FastStringBuilder, using a default allocation policy. 249 */ 250 public FastStringBuilder() 251 251 { 252 252 // 10 bits is 1K. 15 bits is 32K. Remember that these are character 253 253 // counts, so actual memory allocation unit is doubled for UTF-16 chars. 254 254 // 255 // For reference: In the original FastStringBu ffer, we simply255 // For reference: In the original FastStringBuilder, we simply 256 256 // overallocated by blocksize (default 1KB) on each buffer-growth. 257 257 this(10,15,2); … … 262 262 * Get the length of the list. Synonym for length(). 263 263 * 264 * @return the number of characters in the FastStringBu ffer's content.264 * @return the number of characters in the FastStringBuilder's content. 265 265 */ 266 266 public final int size() … … 272 272 * Get the length of the list. Synonym for size(). 273 273 * 274 * @return the number of characters in the FastStringBu ffer's content.274 * @return the number of characters in the FastStringBuilder's content. 275 275 */ 276 276 public final int length() … … 280 280 281 281 /** 282 * Discard the content of the FastStringBu ffer, and most of the memory282 * Discard the content of the FastStringBuilder, and most of the memory 283 283 * that was allocated by it, restoring the initial state. Note that this 284 284 * may eventually be different from setLength(0), which see. … … 290 290 291 291 // Recover the original chunk size 292 FastStringBu ffer innermost=this;292 FastStringBuilder innermost=this; 293 293 while(innermost.m_innerFSB!=null) 294 294 innermost=innermost.m_innerFSB; … … 305 305 306 306 /** 307 * Directly set how much of the FastStringBu ffer's storage is to be307 * Directly set how much of the FastStringBuilder's storage is to be 308 308 * considered part of its content. This is a fast but hazardous 309 309 * operation. It is not protected against negative values, or values 310 310 * greater than the amount of storage currently available... and even 311 311 * if additional storage does exist, its contents are unpredictable. 312 * The only safe use for our setLength() is to truncate the FastStringBu ffer312 * The only safe use for our setLength() is to truncate the FastStringBuilder 313 313 * to a shorter string. 314 314 * <p> … … 340 340 * that truncation may require restoring one of the innerFSBs 341 341 */ 342 final void setLength(int l, FastStringBu ffer rootFSB)342 final void setLength(int l, FastStringBuilder rootFSB) 343 343 { 344 344 m_lastChunk = l >>> m_chunkBits; … … 369 369 * directly from an array of arrays and hence a double copy is needed. 370 370 * By using ensureCapacity we hope to minimize the heap overhead of building 371 * the intermediate StringBu ffer.371 * the intermediate StringBuilder. 372 372 * <p> 373 373 * (It really is a pity that Java didn't design String as a final subclass 374 * of MutableString, rather than having StringBu ffer be a separate hierarchy.374 * of MutableString, rather than having StringBuilder be a separate hierarchy. 375 375 * We'd avoid a <strong>lot</strong> of double-buffering.) 376 376 * 377 * @return the contents of the FastStringBu ffer as a standard Java string.377 * @return the contents of the FastStringBuilder as a standard Java string. 378 378 */ 379 379 public final String toString() 380 380 { 381 381 int length=(m_lastChunk<<m_chunkBits)+m_firstFree; 382 return getString(new StringBu ffer(length),0,0,length).toString();383 } 384 385 /** 386 * Append a single character onto the FastStringBu ffer, growing the382 return getString(new StringBuilder(length),0,0,length).toString(); 383 } 384 385 /** 386 * Append a single character onto the FastStringBuilder, growing the 387 387 * storage if necessary. 388 388 * <p> … … 424 424 // Should do all the work of both encapsulating 425 425 // existing data and establishing new sizes/offsets 426 m_innerFSB=new FastStringBu ffer(this);426 m_innerFSB=new FastStringBuilder(this); 427 427 } 428 428 … … 439 439 440 440 /** 441 * Append the contents of a String onto the FastStringBu ffer,441 * Append the contents of a String onto the FastStringBuilder, 442 442 * growing the storage if necessary. 443 443 * <p> … … 486 486 // Should do all the work of both encapsulating 487 487 // existing data and establishing new sizes/offsets 488 m_innerFSB=new FastStringBu ffer(this);488 m_innerFSB=new FastStringBuilder(this); 489 489 } 490 490 … … 503 503 504 504 /** 505 * Append the contents of a StringBu ffer onto the FastStringBuffer,505 * Append the contents of a StringBuilder onto the FastStringBuilder, 506 506 * growing the storage if necessary. 507 507 * <p> … … 509 509 * references to m_array[] may no longer be valid. 510 510 * 511 * @param value StringBu ffer whose contents are to be appended.512 */ 513 public final void append(StringBu ffer value)511 * @param value StringBuilder whose contents are to be appended. 512 */ 513 public final void append(StringBuilder value) 514 514 { 515 515 int strlen=value.length(); … … 550 550 // Should do all the work of both encapsulating 551 551 // existing data and establishing new sizes/offsets 552 m_innerFSB=new FastStringBu ffer(this);552 m_innerFSB=new FastStringBuilder(this); 553 553 } 554 554 // Add a chunk. … … 567 567 /** 568 568 * Append part of the contents of a Character Array onto the 569 * FastStringBu ffer, growing the storage if necessary.569 * FastStringBuilder, growing the storage if necessary. 570 570 * <p> 571 571 * NOTE THAT after calling append(), previously obtained … … 616 616 // Should do all the work of both encapsulating 617 617 // existing data and establishing new sizes/offsets 618 m_innerFSB=new FastStringBu ffer(this);618 m_innerFSB=new FastStringBuilder(this); 619 619 } 620 620 // Add a chunk. … … 632 632 633 633 /** 634 * Append the contents of another FastStringBu ffer onto635 * this FastStringBu ffer, growing the storage if necessary.634 * Append the contents of another FastStringBuilder onto 635 * this FastStringBuilder, growing the storage if necessary. 636 636 * <p> 637 637 * NOTE THAT after calling append(), previously obtained 638 638 * references to m_array[] may no longer be valid. 639 639 * 640 * @param value FastStringBu ffer whose contents are640 * @param value FastStringBuilder whose contents are 641 641 * to be appended. 642 642 */ 643 public final void append(FastStringBu ffer value)643 public final void append(FastStringBuilder value) 644 644 { 645 645 // Complicating factor here is that the two buffers may use … … 694 694 // Should do all the work of both encapsulating 695 695 // existing data and establishing new sizes/offsets 696 m_innerFSB=new FastStringBu ffer(this);696 m_innerFSB=new FastStringBuilder(this); 697 697 } 698 698 // Add a chunk. … … 753 753 public String getString(int start, int length) 754 754 { 755 return getString(new StringBu ffer(length),start>>>m_chunkBits,start&m_chunkMask,length).toString();755 return getString(new StringBuilder(length),start>>>m_chunkBits,start&m_chunkMask,length).toString(); 756 756 } 757 757 758 758 /** 759 * @param sb StringBu ffer to be appended to759 * @param sb StringBuilder to be appended to 760 760 * @param start Offset of first character in the range. 761 761 * @param length Number of characters to send. 762 762 * @return sb with the requested text appended to it 763 763 */ 764 StringBu ffer getString(StringBuffer sb, int start, int length)764 StringBuilder getString(StringBuilder sb, int start, int length) 765 765 { 766 766 return getString(sb,start>>>m_chunkBits,start&m_chunkMask,length); … … 769 769 /** Internal support for toString() and getString(). 770 770 * PLEASE NOTE SIGNATURE CHANGE from earlier versions; it now appends into 771 * and returns a StringBu ffer supplied by the caller. This simplifies771 * and returns a StringBuilder supplied by the caller. This simplifies 772 772 * m_innerFSB support. 773 773 * <p> … … 776 776 * directly from an array of arrays and hence a double copy is needed. 777 777 * By presetting length we hope to minimize the heap overhead of building 778 * the intermediate StringBu ffer.778 * the intermediate StringBuilder. 779 779 * <p> 780 780 * (It really is a pity that Java didn't design String as a final subclass 781 * of MutableString, rather than having StringBu ffer be a separate hierarchy.781 * of MutableString, rather than having StringBuilder be a separate hierarchy. 782 782 * We'd avoid a <strong>lot</strong> of double-buffering.) 783 783 * 784 * @return the contents of the FastStringBu ffer as a standard Java string.785 */ 786 StringBu ffer 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) 787 787 { 788 788 int stop=(startChunk<<m_chunkBits)+startColumn+length; … … 791 791 792 792 // Factored out 793 //StringBu ffer sb=new StringBuffer(length);793 //StringBuilder sb=new StringBuilder(length); 794 794 795 795 for(int i=startChunk;i<stopChunk;++i) … … 813 813 * events. 814 814 * Note that the buffer reference passed to the ContentHandler may be 815 * invalidated if the FastStringBu ffer is edited; it's the user's816 * responsibility to manage access to the FastStringBu ffer to prevent this815 * invalidated if the FastStringBuilder is edited; it's the user's 816 * responsibility to manage access to the FastStringBuilder to prevent this 817 817 * problem from arising. 818 818 * <p> … … 853 853 } 854 854 855 /** Encapsulation c'tor. After this is called, the source FastStringBu ffer855 /** Encapsulation c'tor. After this is called, the source FastStringBuilder 856 856 * will be reset to use the new object as its m_innerFSB, and will have 857 857 * had its chunk size reset appropriately. IT SHOULD NEVER BE CALLED 858 858 * EXCEPT WHEN source.length()==1<<(source.m_chunkBits+source.m_rebundleBits) 859 859 */ 860 private FastStringBu ffer(FastStringBuffer source)860 private FastStringBuilder(FastStringBuilder source) 861 861 { 862 862 // Copy existing information into new encapsulation -
trunk/Res_ScXslt/com/scenari/xsldom/xml/utils/StringBuilderPool.java
r1711 r10372 101 101 * their supporting character arrays. 102 102 */ 103 public class StringBu fferPool103 public class StringBuilderPool 104 104 { 105 105 106 106 /** The global pool of string buffers. */ 107 107 private static ObjectPool m_stringBufPool = 108 new ObjectPool(com.scenari.xsldom.xml.utils.FastStringBu ffer.class);108 new ObjectPool(com.scenari.xsldom.xml.utils.FastStringBuilder.class); 109 109 110 110 /** … … 114 114 * @return A string buffer ready for use. 115 115 */ 116 public static FastStringBu ffer get()116 public static FastStringBuilder get() 117 117 { 118 return (FastStringBu ffer) m_stringBufPool.getInstance();118 return (FastStringBuilder) m_stringBufPool.getInstance(); 119 119 } 120 120 … … 124 124 * @param sb Must be a non-null reference to a string buffer. 125 125 */ 126 public static void free(FastStringBu ffer sb)126 public static void free(FastStringBuilder sb) 127 127 { 128 128 // Since this isn't synchronized, setLength must be -
trunk/Res_ScXslt/com/scenari/xsldom/xml/utils/URI.java
r1711 r10372 933 933 { 934 934 935 StringBu ffer schemespec = new StringBuffer();935 StringBuilder schemespec = new StringBuilder(); 936 936 937 937 if (m_userinfo != null || m_host != null || m_port != -1) … … 1025 1025 { 1026 1026 1027 StringBu ffer pathString = new StringBuffer(m_path);1027 StringBuilder pathString = new StringBuilder(m_path); 1028 1028 1029 1029 if (p_includeQueryString && m_queryString != null) … … 1421 1421 { 1422 1422 1423 StringBu ffer uriSpecString = new StringBuffer();1423 StringBuilder uriSpecString = new StringBuilder(); 1424 1424 1425 1425 if (m_scheme != null) -
trunk/Res_ScXslt/com/scenari/xsldom/xml/utils/XMLCharacterRecognizer.java
r1711 r10372 141 141 * Tell if the string is whitespace. 142 142 * 143 * @param buf StringBu ffer to check as XML whitespace.143 * @param buf StringBuilder to check as XML whitespace. 144 144 * @return True if characters in buffer are XML whitespace, false otherwise 145 145 */ 146 public static boolean isWhiteSpace(StringBu ffer buf)146 public static boolean isWhiteSpace(StringBuilder buf) 147 147 { 148 148 … … 161 161 * Tell if the string is whitespace. 162 162 * 163 * @param buf StringBu ffer to check as XML whitespace.163 * @param buf StringBuilder to check as XML whitespace. 164 164 * @return True if characters in buffer are XML whitespace, false otherwise 165 165 */ -
trunk/Res_ScXslt/com/scenari/xsldom/xml/utils/synthetic/Class.java
r1711 r10372 391 391 if (className.endsWith("]")) 392 392 { 393 StringBu ffer arrayname = new StringBuffer();393 StringBuilder arrayname = new StringBuilder(); 394 394 395 395 for (int i = className.indexOf('['); i != -1; … … 1496 1496 // add another [ for each level of array 1497 1497 int count = name.lastIndexOf('['); 1498 StringBu ffer jname = new StringBuffer(name.substring(count + 2));1498 StringBuilder jname = new StringBuilder(name.substring(count + 2)); 1499 1499 1500 1500 // Trim the trailing ';' … … 1555 1555 // add another [ for each level of array 1556 1556 int count = shortname.lastIndexOf('['); 1557 StringBu ffer jname = new StringBuffer(shortname.substring(count + 2));1557 StringBuilder jname = new StringBuilder(shortname.substring(count + 2)); 1558 1558 1559 1559 // Trim the trailing ';' … … 2148 2148 { 2149 2149 2150 StringBu ffer t = new StringBuffer();2150 StringBuilder t = new StringBuilder(); 2151 2151 2152 2152 while (depth-- > 0) -
trunk/Res_ScXslt/com/scenari/xsldom/xml/utils/synthetic/reflection/EntryPoint.java
r1711 r10372 143 143 144 144 /** Field body */ 145 private StringBu ffer body = null;145 private StringBuilder body = null; 146 146 147 147 /** Field language */ … … 521 521 { 522 522 523 StringBu ffer sb =524 new StringBu ffer(java.lang.reflect.Modifier.toString(getModifiers()));523 StringBuilder sb = 524 new StringBuilder(java.lang.reflect.Modifier.toString(getModifiers())); 525 525 526 526 if (this instanceof com.scenari.xsldom.xml.utils.synthetic.reflection.Method) … … 573 573 * @throws SynthesisException 574 574 */ 575 public void setBody(String language, StringBu ffer body)575 public void setBody(String language, StringBuilder body) 576 576 throws SynthesisException 577 577 { … … 590 590 * 591 591 */ 592 public StringBu ffer getBody()592 public StringBuilder getBody() 593 593 { 594 594 595 595 if (body == null) 596 body = new StringBu ffer();596 body = new StringBuilder(); 597 597 598 598 return body; … … 618 618 { 619 619 620 StringBu ffer sb = new StringBuffer();620 StringBuilder sb = new StringBuilder(); 621 621 622 622 sb.append(basetab).append( -
trunk/Res_ScXslt/com/scenari/xsldom/xml/utils/synthetic/reflection/Field.java
r1711 r10372 858 858 { 859 859 860 StringBu ffer sb = new StringBuffer(860 StringBuilder sb = new StringBuilder( 861 861 java.lang.reflect.Modifier.toString(getModifiers())).append(' ').append( 862 862 getType().getJavaName()).append(' ').append(getName()); -
trunk/Res_ScXslt/com/scenari/xsldom/xpath/DOMHelper.java
r1711 r10372 113 113 114 114 import com.scenari.xsldom.xalan.res.XSLMessages; 115 import com.scenari.xsldom.xml.utils.FastStringBu ffer;115 import com.scenari.xsldom.xml.utils.FastStringBuilder; 116 116 import com.scenari.xsldom.xml.utils.NSInfo; 117 117 import com.scenari.xsldom.xml.utils.QName; 118 import com.scenari.xsldom.xml.utils.StringBu fferPool;118 import com.scenari.xsldom.xml.utils.StringBuilderPool; 119 119 import com.scenari.xsldom.xpath.res.XPATHErrorResources; 120 120 … … 1291 1291 /** 1292 1292 * Get the textual contents of the node. See 1293 * getNodeData(Node,FastStringBu ffer) for discussion of how1293 * getNodeData(Node,FastStringBuilder) for discussion of how 1294 1294 * whitespace nodes are handled. 1295 1295 * … … 1297 1297 * @return String containing a concatenation of all the 1298 1298 * textual content within that node. 1299 * @see #getNodeData(Node,FastStringBu ffer)1299 * @see #getNodeData(Node,FastStringBuilder) 1300 1300 * 1301 1301 */ … … 1303 1303 { 1304 1304 1305 FastStringBu ffer buf = StringBufferPool.get();1305 FastStringBuilder buf = StringBuilderPool.get(); 1306 1306 String s; 1307 1307 … … 1314 1314 finally 1315 1315 { 1316 StringBu fferPool.free(buf);1316 StringBuilderPool.free(buf); 1317 1317 } 1318 1318 … … 1322 1322 /** 1323 1323 * Retrieve the text content of a DOM subtree, appending it into a 1324 * user-supplied FastStringBu ffer object. Note that attributes are1324 * user-supplied FastStringBuilder object. Note that attributes are 1325 1325 * not considered part of the content of an element. 1326 1326 * <p> … … 1334 1334 * @param node Node whose subtree is to be walked, gathering the 1335 1335 * contents of all Text or CDATASection nodes. 1336 * @param buf FastStringBu ffer into which the contents of the text1336 * @param buf FastStringBuilder into which the contents of the text 1337 1337 * nodes are to be concatenated. 1338 1338 */ 1339 public static void getNodeData(Node node, FastStringBu ffer buf)1339 public static void getNodeData(Node node, FastStringBuilder buf) 1340 1340 { 1341 1341 -
trunk/Res_ScXslt/com/scenari/xsldom/xpath/functions/FuncConcat.java
r1711 r10372 117 117 { 118 118 119 StringBu ffer sb = new StringBuffer();119 StringBuilder sb = new StringBuilder(); 120 120 121 121 // Compiler says we must have at least two arguments. -
trunk/Res_ScXslt/com/scenari/xsldom/xpath/functions/FuncTranslate.java
r1711 r10372 125 125 // A vector to contain the new characters. We'll use it to construct 126 126 // the result string. 127 StringBu ffer sbuffer = new StringBuffer();127 StringBuilder sbuffer = new StringBuilder(); 128 128 129 129 for (int i = 0; i < theFirstStringLength; i++) -
trunk/Res_ScXslt/com/scenari/xsldtm/xalan/extensions/MethodResolver.java
r10215 r10372 290 290 { 291 291 char dash = '-'; 292 StringBu ffer buff = new StringBuffer("");292 StringBuilder buff = new StringBuilder(""); 293 293 for (int i=0; i<name.length(); i++) 294 294 { … … 975 975 private static String errArgs(Object[] xsltArgs, int startingArg) 976 976 { 977 StringBu ffer returnArgs = new StringBuffer();977 StringBuilder returnArgs = new StringBuilder(); 978 978 for (int i = startingArg; i < xsltArgs.length; i++) 979 979 { -
trunk/Res_ScXslt/com/scenari/xsldtm/xalan/lib/ExsltBase.java
r10215 r10372 47 47 { 48 48 NodeList nodelist = n.getChildNodes(); 49 StringBu ffer buf = new StringBuffer();49 StringBuilder buf = new StringBuilder(); 50 50 for (int i = 0; i < nodelist.getLength(); i++) 51 51 { -
trunk/Res_ScXslt/com/scenari/xsldtm/xalan/lib/ExsltDatetime.java
r10215 r10372 78 78 SimpleDateFormat dateFormat = new SimpleDateFormat(dt); 79 79 80 StringBu ffer buff = new StringBuffer(dateFormat.format(datetime));80 StringBuilder buff = new StringBuilder(dateFormat.format(datetime)); 81 81 // Must also include offset from UTF. 82 82 // Get the offset (in milliseconds). … … 1078 1078 int quoteSemaphore = 0; 1079 1079 int i = 0; 1080 StringBu ffer result = new StringBuffer(pattern.length());1080 StringBuilder result = new StringBuilder(pattern.length()); 1081 1081 1082 1082 while (i < pattern.length()) -
trunk/Res_ScXslt/com/scenari/xsldtm/xalan/lib/ExsltStrings.java
r10215 r10372 118 118 public static String concat(NodeList nl) 119 119 { 120 StringBu ffer sb = new StringBuffer();120 StringBuilder sb = new StringBuilder(); 121 121 for (int i = 0; i < nl.getLength(); i++) 122 122 { … … 151 151 return ""; 152 152 153 StringBu ffer sb = new StringBuffer();153 StringBuilder sb = new StringBuilder(); 154 154 int len = (int)length; 155 155 int numAdded = 0; -
trunk/Res_ScXslt/com/scenari/xsldtm/xalan/processor/ProcessorCharacters.java
r10215 r10372 159 159 * occured. 160 160 */ 161 private StringBu ffer m_accumulator = new StringBuffer();161 private StringBuilder m_accumulator = new StringBuilder(); 162 162 163 163 /** -
trunk/Res_ScXslt/com/scenari/xsldtm/xalan/processor/XSLTAttributeDef.java
r10215 r10372 455 455 } 456 456 457 StringBu ffer outBuf = new StringBuffer();457 StringBuilder outBuf = new StringBuilder(); 458 458 459 459 outBuf.append("set"); … … 642 642 if (retVal == StringToIntTable.INVALID_KEY) 643 643 { 644 StringBu ffer enumNamesList = getListOfEnums();644 StringBuilder enumNamesList = getListOfEnums(); 645 645 handleError(handler, XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },null); 646 646 return null; … … 705 705 706 706 if (qname.getPrefix() == null) { 707 StringBu ffer enumNamesList = getListOfEnums();707 StringBuilder enumNamesList = getListOfEnums(); 708 708 709 709 enumNamesList.append(" <qname-but-not-ncname>"); … … 715 715 catch (IllegalArgumentException ie) 716 716 { 717 StringBu ffer enumNamesList = getListOfEnums();717 StringBuilder enumNamesList = getListOfEnums(); 718 718 enumNamesList.append(" <qname-but-not-ncname>"); 719 719 … … 724 724 catch (RuntimeException re) 725 725 { 726 StringBu ffer enumNamesList = getListOfEnums();726 StringBuilder enumNamesList = getListOfEnums(); 727 727 enumNamesList.append(" <qname-but-not-ncname>"); 728 728 … … 1532 1532 1533 1533 /** 1534 * StringBu ffer containing comma delimited list of valid values for ENUM type.1534 * StringBuilder containing comma delimited list of valid values for ENUM type. 1535 1535 * Used to build error message. 1536 1536 */ 1537 private StringBu ffer getListOfEnums()1538 { 1539 StringBu ffer enumNamesList = new StringBuffer();1537 private StringBuilder getListOfEnums() 1538 { 1539 StringBuilder enumNamesList = new StringBuilder(); 1540 1540 String [] enumValues = this.getEnumNames(); 1541 1541 -
trunk/Res_ScXslt/com/scenari/xsldtm/xalan/templates/AVT.java
r10215 r10372 27 27 import com.scenari.xsldtm.xalan.res.XSLMessages; 28 28 import com.scenari.xsldtm.xalan.res.XSLTErrorResources; 29 import com.scenari.xsldtm.xml.utils.FastStringBu ffer;30 import com.scenari.xsldtm.xml.utils.StringBu fferPool;29 import com.scenari.xsldtm.xml.utils.FastStringBuilder; 30 import com.scenari.xsldtm.xml.utils.StringBuilderPool; 31 31 import com.scenari.xsldtm.xpath.XPath; 32 32 import com.scenari.xsldtm.xpath.XPathContext; … … 148 148 int nTokens = tokenizer.countTokens(); 149 149 150 FastStringBu ffer buffer = StringBufferPool.get();151 FastStringBu ffer exprBuffer = StringBufferPool.get();150 FastStringBuilder buffer = StringBuilderPool.get(); 151 FastStringBuilder exprBuffer = StringBuilderPool.get(); 152 152 153 153 try { … … 338 338 } 339 339 } finally { 340 StringBu fferPool.free(buffer);341 StringBu fferPool.free(exprBuffer);340 StringBuilderPool.free(buffer); 341 StringBuilderPool.free(exprBuffer); 342 342 } 343 343 } // end else nTokens > 1 … … 360 360 return m_simpleString; 361 361 } else if (null != m_parts) { 362 FastStringBu ffer buf = StringBufferPool.get();362 FastStringBuilder buf = StringBuilderPool.get(); 363 363 String s; 364 364 … … 376 376 s = buf.toString(); 377 377 } finally { 378 StringBu fferPool.free(buf);378 StringBuilderPool.free(buf); 379 379 } 380 380 … … 399 399 public String evaluate(XPathContext xctxt, int context, com.scenari.xsldtm.xml.utils.PrefixResolver nsNode) throws javax.xml.transform.TransformerException { 400 400 401 FastStringBu ffer buf = StringBufferPool.get();401 FastStringBuilder buf = StringBuilderPool.get(); 402 402 403 403 try { … … 420 420 } 421 421 } finally { 422 StringBu fferPool.free(buf);422 StringBuilderPool.free(buf); 423 423 } 424 424 } -
trunk/Res_ScXslt/com/scenari/xsldtm/xalan/templates/AVTPart.java
r10215 r10372 19 19 package com.scenari.xsldtm.xalan.templates; 20 20 21 import com.scenari.xsldtm.xml.utils.FastStringBu ffer;21 import com.scenari.xsldtm.xml.utils.FastStringBuilder; 22 22 import com.scenari.xsldtm.xpath.XPathContext; 23 23 … … 55 55 */ 56 56 public abstract void evaluate( 57 XPathContext xctxt, FastStringBu ffer buf, int context,57 XPathContext xctxt, FastStringBuilder buf, int context, 58 58 com.scenari.xsldtm.xml.utils.PrefixResolver nsNode) 59 59 throws javax.xml.transform.TransformerException; -
trunk/Res_ScXslt/com/scenari/xsldtm/xalan/templates/AVTPartSimple.java
r10215 r10372 19 19 package com.scenari.xsldtm.xalan.templates; 20 20 21 import com.scenari.xsldtm.xml.utils.FastStringBu ffer;21 import com.scenari.xsldtm.xml.utils.FastStringBuilder; 22 22 import com.scenari.xsldtm.xpath.XPathContext; 23 23 … … 82 82 * @param NodeList The current Context Node List. 83 83 */ 84 public void evaluate(XPathContext xctxt, FastStringBu ffer buf,84 public void evaluate(XPathContext xctxt, FastStringBuilder buf, 85 85 int context, 86 86 com.scenari.xsldtm.xml.utils.PrefixResolver nsNode) -
trunk/Res_ScXslt/com/scenari/xsldtm/xalan/templates/AVTPartXPath.java
r10215 r10372 19 19 package com.scenari.xsldtm.xalan.templates; 20 20 21 import com.scenari.xsldtm.xml.utils.FastStringBu ffer;21 import com.scenari.xsldtm.xml.utils.FastStringBuilder; 22 22 import com.scenari.xsldtm.xpath.XPath; 23 23 import com.scenari.xsldtm.xpath.XPathContext; … … 127 127 */ 128 128 public void evaluate( 129 XPathContext xctxt, FastStringBu ffer buf, int context, com.scenari.xsldtm.xml.utils.PrefixResolver nsNode)129 XPathContext xctxt, FastStringBuilder buf, int context, com.scenari.xsldtm.xml.utils.PrefixResolver nsNode) 130 130 throws javax.xml.transform.TransformerException 131 131 { -
trunk/Res_ScXslt/com/scenari/xsldtm/xalan/templates/ElemNumber.java
r10215 r10372 37 37 import com.scenari.xsldtm.xalan.transformer.TransformerImpl; 38 38 import com.scenari.xsldtm.xml.dtm.DTM; 39 import com.scenari.xsldtm.xml.utils.FastStringBu ffer;39 import com.scenari.xsldtm.xml.utils.FastStringBuilder; 40 40 import com.scenari.xsldtm.xml.utils.NodeVector; 41 41 import com.scenari.xsldtm.xml.utils.PrefixResolver; 42 import com.scenari.xsldtm.xml.utils.StringBu fferPool;42 import com.scenari.xsldtm.xml.utils.StringBuilderPool; 43 43 import com.scenari.xsldtm.xml.utils.res.XResourceBundle; 44 44 import com.scenari.xsldtm.xpath.NodeSetDTM; … … 1161 1161 1162 1162 String numStr; 1163 FastStringBu ffer formattedNumber = StringBufferPool.get();1163 FastStringBuilder formattedNumber = StringBuilderPool.get(); 1164 1164 1165 1165 try … … 1289 1289 finally 1290 1290 { 1291 StringBu fferPool.free(formattedNumber);1291 StringBuilderPool.free(formattedNumber); 1292 1292 } 1293 1293 … … 1315 1315 TransformerImpl transformer, int contextNode, 1316 1316 char numberType, int numberWidth, long listElement, 1317 FastStringBu ffer formattedNumber)1317 FastStringBuilder formattedNumber) 1318 1318 throws javax.xml.transform.TransformerException 1319 1319 { … … 1359 1359 } 1360 1360 1361 FastStringBu ffer stringBuf = StringBufferPool.get();1361 FastStringBuilder stringBuf = StringBuilderPool.get(); 1362 1362 1363 1363 try … … 1370 1370 finally 1371 1371 { 1372 StringBu fferPool.free(stringBuf);1372 StringBuilderPool.free(stringBuf); 1373 1373 } 1374 1374 break; … … 1639 1639 */ 1640 1640 protected void int2alphaCount(long val, char[] aTable, 1641 FastStringBu ffer stringBuf)1641 FastStringBuilder stringBuf) 1642 1642 { 1643 1643 -
trunk/Res_ScXslt/com/scenari/xsldtm/xalan/templates/OutputProperties.java
r10215 r10372 30 30 import com.scenari.xsldtm.xml.serializer.OutputPropertiesFactory; 31 31 import com.scenari.xsldtm.xml.serializer.OutputPropertyUtils; 32 import com.scenari.xsldtm.xml.utils.FastStringBu ffer;32 import com.scenari.xsldtm.xml.utils.FastStringBuilder; 33 33 import com.scenari.xsldtm.xml.utils.QName; 34 34 … … 419 419 420 420 // Just an initial guess at reasonable tuning parameters 421 FastStringBu ffer fsb = new FastStringBuffer(9,9);421 FastStringBuilder fsb = new FastStringBuilder(9,9); 422 422 423 423 for (int i = 0; i < s; i++) … … 488 488 int l = s.length(); 489 489 boolean inCurly = false; 490 FastStringBu ffer buf = new FastStringBuffer();490 FastStringBuilder buf = new FastStringBuilder(); 491 491 492 492 // parse through string, breaking on whitespaces. I do this instead -
trunk/Res_ScXslt/com/scenari/xsldtm/xalan/xslt/EnvironmentCheck.java
r10215 r10372 844 844 845 845 // Found Xalan-J 1.x, grab it's version fields 846 StringBu ffer buf = new StringBuffer();846 StringBuilder buf = new StringBuilder(); 847 847 Field f = clazz.getField("PRODUCT"); 848 848 … … 877 877 878 878 // Found Xalan-J 2.x, grab it's version fields 879 StringBu ffer buf = new StringBuffer();879 StringBuilder buf = new StringBuilder(); 880 880 Field f = clazz.getField("S_VERSION"); 881 881 buf.append(f.get(null)); -
trunk/Res_ScXslt/com/scenari/xsldtm/xml/dtm/DTM.java
r10215 r10372 43 43 * 44 44 * <p>Text content of a node is represented by an index and length, 45 * permitting efficient storage such as a shared FastStringBu ffer.</p>45 * permitting efficient storage such as a shared FastStringBuilder.</p> 46 46 * 47 47 * <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 212 212 public String getMessageAndLocation() { 213 213 214 StringBu ffer sbuffer = new StringBuffer();214 StringBuilder sbuffer = new StringBuilder(); 215 215 String message = super.getMessage(); 216 216 … … 252 252 253 253 if (null != locator) { 254 StringBu ffer sbuffer = new StringBuffer();254 StringBuilder sbuffer = new StringBuilder(); 255 255 String systemID = locator.getSystemId(); 256 256 int line = locator.getLineNumber(); -
trunk/Res_ScXslt/com/scenari/xsldtm/xml/dtm/ref/DTMDefaultBase.java
r10215 r10372 843 843 } 844 844 845 StringBu ffer sb=new StringBuffer();845 StringBuilder sb=new StringBuilder(); 846 846 sb.append("["+nodeHandle+": "+typestring+ 847 847 "(0x"+Integer.toHexString(getExpandedTypeID(nodeHandle))+") "+ -
trunk/Res_ScXslt/com/scenari/xsldtm/xml/dtm/ref/DTMDocumentImpl.java
r10215 r10372 32 32 import com.scenari.xsldtm.xml.dtm.DTMManager; 33 33 import com.scenari.xsldtm.xml.dtm.DTMWSFilter; 34 import com.scenari.xsldtm.xml.utils.FastStringBu ffer;34 import com.scenari.xsldtm.xml.utils.FastStringBuilder; 35 35 import com.scenari.xsldtm.xml.utils.XMLString; 36 36 import com.scenari.xsldtm.xml.utils.XMLStringFactory; … … 108 108 // text/comment table: string buffer to hold the text string values of the document, 109 109 // each of which is addressed by the absolute offset and length in the buffer 110 private FastStringBu ffer m_char = new FastStringBuffer();110 private FastStringBuilder m_char = new FastStringBuilder(); 111 111 // Start of string currently being accumulated into m_char; 112 112 // needed because the string may be appended in several chunks. … … 253 253 * Set a reference pointer to the content-text repository 254 254 * 255 * @param bufferRef FastStringBu ffer reference to an instance of255 * @param bufferRef FastStringBuilder reference to an instance of 256 256 * buffer 257 257 */ 258 void setContentBuffer(FastStringBu ffer buffer) {258 void setContentBuffer(FastStringBuilder buffer) { 259 259 m_char = buffer; 260 260 } … … 263 263 * Get a reference pointer to the content-text repository 264 264 * 265 * @return FastStringBu ffer reference to an instance of buffer265 * @return FastStringBuilder reference to an instance of buffer 266 266 */ 267 FastStringBu ffer getContentBuffer() {267 FastStringBuilder getContentBuffer() { 268 268 return m_char; 269 269 } … … 372 372 if(len!=m_char_current_start) 373 373 { 374 // The FastStringBu ffer has been previously agreed upon374 // The FastStringBuilder has been previously agreed upon 375 375 appendTextChild(m_char_current_start,len-m_char_current_start); 376 376 m_char_current_start=len; … … 1407 1407 * underlying m_chars object may not store characters in a 1408 1408 * single contiguous array -- for example,the current 1409 * FastStringBu ffer may split a single node's text across1409 * FastStringBuilder may split a single node's text across 1410 1410 * multiple allocation units. This call tells us how many 1411 1411 * separate accesses will be required to retrieve the entire … … 1436 1436 * the underlying m_chars object may not store characters in a 1437 1437 * single contiguous array -- for example,the current 1438 * FastStringBu ffer may split a single node's text across1438 * FastStringBuilder may split a single node's text across 1439 1439 * multiple allocation units. This call retrieves a single 1440 1440 * 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 41 41 import com.scenari.xsldtm.xml.res.XMLErrorResources; 42 42 import com.scenari.xsldtm.xml.res.XMLMessages; 43 import com.scenari.xsldtm.xml.utils.FastStringBu ffer;43 import com.scenari.xsldtm.xml.utils.FastStringBuilder; 44 44 import com.scenari.xsldtm.xml.utils.QName; 45 import com.scenari.xsldtm.xml.utils.StringBu fferPool;45 import com.scenari.xsldtm.xml.utils.StringBuilderPool; 46 46 import com.scenari.xsldtm.xml.utils.TreeWalker; 47 47 import com.scenari.xsldtm.xml.utils.XMLCharacterRecognizer; … … 817 817 || DTM.DOCUMENT_FRAGMENT_NODE == type) 818 818 { 819 FastStringBu ffer buf = StringBufferPool.get();819 FastStringBuilder buf = StringBuilderPool.get(); 820 820 String s; 821 821 … … 828 828 finally 829 829 { 830 StringBu fferPool.free(buf);830 StringBuilderPool.free(buf); 831 831 } 832 832 … … 842 842 // %REVIEW% DOM Level 3 is expected to add a "whole text" 843 843 // retrieval method which performs this function for us. 844 FastStringBu ffer buf = StringBufferPool.get();844 FastStringBuilder buf = StringBuilderPool.get(); 845 845 while(node!=null) 846 846 { … … 849 849 } 850 850 String s=(buf.length() > 0) ? buf.toString() : ""; 851 StringBu fferPool.free(buf);851 StringBuilderPool.free(buf); 852 852 return m_xstrf.newstr( s ); 853 853 } … … 876 876 // %REVIEW% DOM Level 3 is expected to add a "whole text" 877 877 // retrieval method which performs this function for us. 878 FastStringBu ffer buf = StringBufferPool.get();878 FastStringBuilder buf = StringBuilderPool.get(); 879 879 while(node!=null) 880 880 { … … 883 883 } 884 884 boolean b = buf.isWhitespace(0, buf.length()); 885 StringBu fferPool.free(buf);885 StringBuilderPool.free(buf); 886 886 return b; 887 887 } … … 891 891 /** 892 892 * Retrieve the text content of a DOM subtree, appending it into a 893 * user-supplied FastStringBu ffer object. Note that attributes are893 * user-supplied FastStringBuilder object. Note that attributes are 894 894 * not considered part of the content of an element. 895 895 * <p> … … 908 908 * @param node Node whose subtree is to be walked, gathering the 909 909 * contents of all Text or CDATASection nodes. 910 * @param buf FastStringBu ffer into which the contents of the text910 * @param buf FastStringBuilder into which the contents of the text 911 911 * nodes are to be concatenated. 912 912 */ 913 protected static void getNodeData(Node node, FastStringBu ffer buf)913 protected static void getNodeData(Node node, FastStringBuilder buf) 914 914 { 915 915 … … 1249 1249 return node.getNodeValue(); 1250 1250 1251 FastStringBu ffer buf = StringBufferPool.get();1251 FastStringBuilder buf = StringBuilderPool.get(); 1252 1252 buf.append(node.getNodeValue()); 1253 1253 while(n!=null) … … 1257 1257 } 1258 1258 String s = (buf.length() > 0) ? buf.toString() : ""; 1259 StringBu fferPool.free(buf);1259 StringBuilderPool.free(buf); 1260 1260 return s; 1261 1261 } … … 1626 1626 /** 1627 1627 * Retrieve the text content of a DOM subtree, appending it into a 1628 * user-supplied FastStringBu ffer object. Note that attributes are1628 * user-supplied FastStringBuilder object. Note that attributes are 1629 1629 * not considered part of the content of an element. 1630 1630 * <p> … … 1643 1643 * @param node Node whose subtree is to be walked, gathering the 1644 1644 * contents of all Text or CDATASection nodes. 1645 * @param buf FastStringBu ffer into which the contents of the text1645 * @param buf FastStringBuilder into which the contents of the text 1646 1646 * nodes are to be concatenated. 1647 1647 */ -
trunk/Res_ScXslt/com/scenari/xsldtm/xml/dtm/ref/sax2dtm/SAX2DTM.java
r10215 r10372 47 47 import com.scenari.xsldtm.xml.res.XMLErrorResources; 48 48 import com.scenari.xsldtm.xml.res.XMLMessages; 49 import com.scenari.xsldtm.xml.utils.FastStringBu ffer;49 import com.scenari.xsldtm.xml.utils.FastStringBuilder; 50 50 import com.scenari.xsldtm.xml.utils.IntStack; 51 51 import com.scenari.xsldtm.xml.utils.IntVector; … … 80 80 * Made protected rather than private so SAX2RTFDTM can access it. 81 81 */ 82 //private FastStringBu ffer m_chars = new FastStringBuffer(13, 13);83 protected FastStringBu ffer m_chars;82 //private FastStringBuilder m_chars = new FastStringBuilder(13, 13); 83 protected FastStringBuilder m_chars; 84 84 85 85 /** This vector holds offset and length data. … … 266 266 m_dataOrQName = new SuballocatedIntVector(blocksize, DEFAULT_NUMBLOCKS_SMALL); 267 267 m_valuesOrPrefixes = new DTMStringPool(16); 268 m_chars = new FastStringBu ffer(7, 10);268 m_chars = new FastStringBuilder(7, 10); 269 269 m_contextIndexes = new IntStack(4); 270 270 m_parents = new IntStack(4); … … 275 275 m_dataOrQName = new SuballocatedIntVector(blocksize, DEFAULT_NUMBLOCKS); 276 276 m_valuesOrPrefixes = new DTMStringPool(); 277 m_chars = new FastStringBu ffer(10, 13);277 m_chars = new FastStringBuilder(10, 13); 278 278 m_contextIndexes = new IntStack(); 279 279 m_parents = new IntStack(); … … 528 528 529 529 if(normalize) 530 FastStringBu ffer.sendNormalizedSAXcharacters(str.toCharArray(),530 FastStringBuilder.sendNormalizedSAXcharacters(str.toCharArray(), 531 531 0, str.length(), ch); 532 532 else -
trunk/Res_ScXslt/com/scenari/xsldtm/xml/dtm/ref/sax2dtm/SAX2DTM2.java
r10215 r10372 30 30 import com.scenari.xsldtm.xml.res.XMLMessages; 31 31 import com.scenari.xsldtm.xml.serializer.SerializationHandler; 32 import com.scenari.xsldtm.xml.utils.FastStringBu ffer;32 import com.scenari.xsldtm.xml.utils.FastStringBuilder; 33 33 import com.scenari.xsldtm.xml.utils.XMLString; 34 34 import com.scenari.xsldtm.xml.utils.XMLStringDefault; … … 2978 2978 if (child == DTM.NULL) return EMPTY_STR; 2979 2979 2980 // optimization: only create StringBu ffer if > 1 child2980 // optimization: only create StringBuilder if > 1 child 2981 2981 if ((_exptype2(child) == DTM.TEXT_NODE) && (_nextsib2(child) == DTM.NULL)) 2982 2982 { … … 3109 3109 3110 3110 if(normalize) 3111 FastStringBu ffer.sendNormalizedSAXcharacters(str.toCharArray(),3111 FastStringBuilder.sendNormalizedSAXcharacters(str.toCharArray(), 3112 3112 0, str.length(), ch); 3113 3113 else -
trunk/Res_ScXslt/com/scenari/xsldtm/xml/serializer/ToStream.java
r10215 r10372 38 38 import com.scenari.xsldtm.xml.res.XMLMessages; 39 39 import com.scenari.xsldtm.xml.utils.BoolStack; 40 import com.scenari.xsldtm.xml.utils.FastStringBu ffer;40 import com.scenari.xsldtm.xml.utils.FastStringBuilder; 41 41 import com.scenari.xsldtm.xml.utils.QName; 42 42 import com.scenari.xsldtm.xml.utils.TreeWalker; … … 2469 2469 int l = s.length(); 2470 2470 boolean inCurly = false; 2471 FastStringBu ffer buf = new FastStringBuffer();2471 FastStringBuilder buf = new FastStringBuilder(); 2472 2472 2473 2473 // parse through string, breaking on whitespaces. I do this instead … … 2762 2762 m_writer.flush(); 2763 2763 2764 // make a StringBu ffer to write the name="value" pairs to.2765 StringBu ffer sb = new StringBuffer();2764 // make a StringBuilder to write the name="value" pairs to. 2765 StringBuilder sb = new StringBuilder(); 2766 2766 int nAttrs = m_attributes.getLength(); 2767 2767 if (nAttrs > 0) 2768 2768 { 2769 2769 // make a writer that internally appends to the same 2770 // StringBu ffer2770 // StringBuilder 2771 2771 java.io.Writer writer = 2772 new ToStream.WritertoStringBu ffer(sb);2772 new ToStream.WritertoStringBuilder(sb); 2773 2773 2774 2774 processAttributes(writer, nAttrs); … … 2778 2778 } 2779 2779 sb.append('>'); // the potential > after the attributes. 2780 // convert the StringBu ffer to a char array and2780 // convert the StringBuilder to a char array and 2781 2781 // emit the trace event that these characters "might" 2782 2782 // be written … … 2805 2805 * the same code. 2806 2806 */ 2807 private class WritertoStringBu ffer extends java.io.Writer2808 { 2809 final private StringBu ffer m_stringbuf;2807 private class WritertoStringBuilder extends java.io.Writer 2808 { 2809 final private StringBuilder m_stringbuf; 2810 2810 /** 2811 2811 * @see java.io.Writer#write(char[], int, int) 2812 2812 */ 2813 WritertoStringBu ffer(StringBuffer sb)2813 WritertoStringBuilder(StringBuilder sb) 2814 2814 { 2815 2815 m_stringbuf = sb; -
trunk/Res_ScXslt/com/scenari/xsldtm/xml/serializer/ToUnknownStream.java
r10215 r10372 1283 1283 1284 1284 if (m_tracer != null) { 1285 StringBu ffer sb = new StringBuffer();1285 StringBuilder sb = new StringBuilder(); 1286 1286 1287 1287 sb.append('<'); 1288 1288 sb.append(elementName); 1289 1289 1290 // convert the StringBu ffer to a char array and1290 // convert the StringBuilder to a char array and 1291 1291 // emit the trace event that these characters "might" 1292 1292 // be written -
trunk/Res_ScXslt/com/scenari/xsldtm/xml/utils/DOMHelper.java
r10215 r10372 1228 1228 /** 1229 1229 * Get the textual contents of the node. See 1230 * getNodeData(Node,FastStringBu ffer) for discussion of how1230 * getNodeData(Node,FastStringBuilder) for discussion of how 1231 1231 * whitespace nodes are handled. 1232 1232 * … … 1234 1234 * @return String containing a concatenation of all the 1235 1235 * textual content within that node. 1236 * @see #getNodeData(Node,FastStringBu ffer)1236 * @see #getNodeData(Node,FastStringBuilder) 1237 1237 * 1238 1238 */ … … 1240 1240 { 1241 1241 1242 FastStringBu ffer buf = StringBufferPool.get();1242 FastStringBuilder buf = StringBuilderPool.get(); 1243 1243 String s; 1244 1244 … … 1251 1251 finally 1252 1252 { 1253 StringBu fferPool.free(buf);1253 StringBuilderPool.free(buf); 1254 1254 } 1255 1255 … … 1259 1259 /** 1260 1260 * Retrieve the text content of a DOM subtree, appending it into a 1261 * user-supplied FastStringBu ffer object. Note that attributes are1261 * user-supplied FastStringBuilder object. Note that attributes are 1262 1262 * not considered part of the content of an element. 1263 1263 * <p> … … 1271 1271 * @param node Node whose subtree is to be walked, gathering the 1272 1272 * contents of all Text or CDATASection nodes. 1273 * @param buf FastStringBu ffer into which the contents of the text1273 * @param buf FastStringBuilder into which the contents of the text 1274 1274 * nodes are to be concatenated. 1275 1275 */ 1276 public static void getNodeData(Node node, FastStringBu ffer buf)1276 public static void getNodeData(Node node, FastStringBuilder buf) 1277 1277 { 1278 1278 -
trunk/Res_ScXslt/com/scenari/xsldtm/xml/utils/FastStringBuilder.java
r10215 r10372 15 15 */ 16 16 /* 17 * $Id: FastStringBu ffer.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 $ 18 18 */ 19 19 package com.scenari.xsldtm.xml.utils; … … 22 22 * Bare-bones, unsafe, fast string buffer. No thread-safety, no 23 23 * parameter range checking, exposed fields. Note that in typical 24 * applications, thread-safety of a StringBu ffer is a somewhat24 * applications, thread-safety of a StringBuilder is a somewhat 25 25 * dubious concept in any case. 26 26 * <p> 27 * Note that Stree and DTM used a single FastStringBu ffer as a string pool,27 * Note that Stree and DTM used a single FastStringBuilder as a string pool, 28 28 * by recording start and length indices within this single buffer. This 29 29 * minimizes heap overhead, but of course requires more work when retrieving 30 30 * the data. 31 31 * <p> 32 * FastStringBu ffer operates as a "chunked buffer". Doing so32 * FastStringBuilder operates as a "chunked buffer". Doing so 33 33 * reduces the need to recopy existing information when an append 34 34 * exceeds the space available; we just allocate another chunk and … … 43 43 * <p> 44 44 * %REVIEW% An experiment in self-tuning is 45 * included in the code (using nested FastStringBu ffers to achieve45 * included in the code (using nested FastStringBuilders to achieve 46 46 * variation in chunk sizes), but this implementation has proven to 47 47 * be problematic when data may be being copied from the FSB into itself. … … 50 50 * <p> 51 51 */ 52 public class FastStringBu ffer52 public class FastStringBuilder 53 53 { 54 54 // If nonzero, forces the inial chunk size. … … 101 101 /** 102 102 * Field m_maxChunkBits affects our chunk-growth strategy, by saying what 103 * the largest permissible chunk size is in this particular FastStringBu ffer103 * the largest permissible chunk size is in this particular FastStringBuilder 104 104 * hierarchy. 105 105 */ … … 111 111 * into the first chunk of the next size up. For example, if m_rechunkBits 112 112 * is set to 3, then after 8 chunks at a given size we will rebundle 113 * them as the first element of a FastStringBu ffer using a chunk size113 * them as the first element of a FastStringBuilder using a chunk size 114 114 * 8 times larger (chunkBits shifted left three bits). 115 115 */ … … 143 143 * Field m_lastChunk is an index into m_array[], pointing to the last 144 144 * chunk of the Chunked Array currently in use. Note that additional 145 * chunks may actually be allocated, eg if the FastStringBu ffer had145 * chunks may actually be allocated, eg if the FastStringBuilder had 146 146 * previously been truncated or if someone issued an ensureSpace request. 147 147 * <p> … … 154 154 * Field m_firstFree is an index into m_array[m_lastChunk][], pointing to 155 155 * the first character in the Chunked Array which is not part of the 156 * FastStringBu ffer's current content. Since m_array[][] is zero-based,156 * FastStringBuilder's current content. Since m_array[][] is zero-based, 157 157 * the length of that content can be calculated as 158 158 * (m_lastChunk<<m_chunkBits) + m_firstFree … … 161 161 162 162 /** 163 * Field m_innerFSB, when non-null, is a FastStringBu ffer whose total163 * Field m_innerFSB, when non-null, is a FastStringBuilder whose total 164 164 * length equals m_chunkSize, and which replaces m_array[0]. This allows 165 * building a hierarchy of FastStringBu ffers, where early appends use165 * building a hierarchy of FastStringBuilders, where early appends use 166 166 * a smaller chunkSize (for less wasted memory overhead) but later 167 167 * ones use a larger chunkSize (for less heap activity overhead). 168 168 */ 169 FastStringBu ffer m_innerFSB = null;170 171 /** 172 * Construct a FastStringBu ffer, with allocation policy as per parameters.169 FastStringBuilder m_innerFSB = null; 170 171 /** 172 * Construct a FastStringBuilder, with allocation policy as per parameters. 173 173 * <p> 174 174 * For coding convenience, I've expressed both allocation sizes in terms of … … 191 191 * advance before we attempt to take a step from initChunkBits to maxChunkBits 192 192 */ 193 public FastStringBu ffer(int initChunkBits, int maxChunkBits,193 public FastStringBuilder(int initChunkBits, int maxChunkBits, 194 194 int rebundleBits) 195 195 { … … 221 221 222 222 /** 223 * Construct a FastStringBu ffer, using a default rebundleBits value.223 * Construct a FastStringBuilder, using a default rebundleBits value. 224 224 * 225 225 * NEEDSDOC @param initChunkBits 226 226 * NEEDSDOC @param maxChunkBits 227 227 */ 228 public FastStringBu ffer(int initChunkBits, int maxChunkBits)228 public FastStringBuilder(int initChunkBits, int maxChunkBits) 229 229 { 230 230 this(initChunkBits, maxChunkBits, 2); … … 232 232 233 233 /** 234 * Construct a FastStringBu ffer, using default maxChunkBits and234 * Construct a FastStringBuilder, using default maxChunkBits and 235 235 * rebundleBits values. 236 236 * <p> … … 242 242 * NEEDSDOC @param initChunkBits 243 243 */ 244 public FastStringBu ffer(int initChunkBits)244 public FastStringBuilder(int initChunkBits) 245 245 { 246 246 this(initChunkBits, 15, 2); … … 248 248 249 249 /** 250 * Construct a FastStringBu ffer, using a default allocation policy.251 */ 252 public FastStringBu ffer()250 * Construct a FastStringBuilder, using a default allocation policy. 251 */ 252 public FastStringBuilder() 253 253 { 254 254 … … 256 256 // counts, so actual memory allocation unit is doubled for UTF-16 chars. 257 257 // 258 // For reference: In the original FastStringBu ffer, we simply258 // For reference: In the original FastStringBuilder, we simply 259 259 // overallocated by blocksize (default 1KB) on each buffer-growth. 260 260 this(10, 15, 2); … … 264 264 * Get the length of the list. Synonym for length(). 265 265 * 266 * @return the number of characters in the FastStringBu ffer's content.266 * @return the number of characters in the FastStringBuilder's content. 267 267 */ 268 268 public final int size() … … 274 274 * Get the length of the list. Synonym for size(). 275 275 * 276 * @return the number of characters in the FastStringBu ffer's content.276 * @return the number of characters in the FastStringBuilder's content. 277 277 */ 278 278 public final int length() … … 282 282 283 283 /** 284 * Discard the content of the FastStringBu ffer, and most of the memory284 * Discard the content of the FastStringBuilder, and most of the memory 285 285 * that was allocated by it, restoring the initial state. Note that this 286 286 * may eventually be different from setLength(0), which see. … … 293 293 294 294 // Recover the original chunk size 295 FastStringBu ffer innermost = this;295 FastStringBuilder innermost = this; 296 296 297 297 while (innermost.m_innerFSB != null) … … 311 311 312 312 /** 313 * Directly set how much of the FastStringBu ffer's storage is to be313 * Directly set how much of the FastStringBuilder's storage is to be 314 314 * considered part of its content. This is a fast but hazardous 315 315 * operation. It is not protected against negative values, or values 316 316 * greater than the amount of storage currently available... and even 317 317 * if additional storage does exist, its contents are unpredictable. 318 * The only safe use for our setLength() is to truncate the FastStringBu ffer318 * The only safe use for our setLength() is to truncate the FastStringBuilder 319 319 * to a shorter string. 320 320 * … … 355 355 * NEEDSDOC @param rootFSB 356 356 */ 357 private final void setLength(int l, FastStringBu ffer rootFSB)357 private final void setLength(int l, FastStringBuilder rootFSB) 358 358 { 359 359 … … 388 388 * directly from an array of arrays and hence a double copy is needed. 389 389 * By using ensureCapacity we hope to minimize the heap overhead of building 390 * the intermediate StringBu ffer.390 * the intermediate StringBuilder. 391 391 * <p> 392 392 * (It really is a pity that Java didn't design String as a final subclass 393 * of MutableString, rather than having StringBu ffer be a separate hierarchy.393 * of MutableString, rather than having StringBuilder be a separate hierarchy. 394 394 * We'd avoid a <strong>lot</strong> of double-buffering.) 395 395 * 396 * @return the contents of the FastStringBu ffer as a standard Java string.396 * @return the contents of the FastStringBuilder as a standard Java string. 397 397 */ 398 398 public final String toString() … … 401 401 int length = (m_lastChunk << m_chunkBits) + m_firstFree; 402 402 403 return getString(new StringBu ffer(length), 0, 0, length).toString();404 } 405 406 /** 407 * Append a single character onto the FastStringBu ffer, growing the403 return getString(new StringBuilder(length), 0, 0, length).toString(); 404 } 405 406 /** 407 * Append a single character onto the FastStringBuilder, growing the 408 408 * storage if necessary. 409 409 * <p> … … 449 449 // Should do all the work of both encapsulating 450 450 // existing data and establishing new sizes/offsets 451 m_innerFSB = new FastStringBu ffer(this);451 m_innerFSB = new FastStringBuilder(this); 452 452 } 453 453 … … 464 464 465 465 /** 466 * Append the contents of a String onto the FastStringBu ffer,466 * Append the contents of a String onto the FastStringBuilder, 467 467 * growing the storage if necessary. 468 468 * <p> … … 529 529 // Should do all the work of both encapsulating 530 530 // existing data and establishing new sizes/offsets 531 m_innerFSB = new FastStringBu ffer(this);531 m_innerFSB = new FastStringBuilder(this); 532 532 } 533 533 … … 546 546 547 547 /** 548 * Append the contents of a StringBu ffer onto the FastStringBuffer,548 * Append the contents of a StringBuilder onto the FastStringBuilder, 549 549 * growing the storage if necessary. 550 550 * <p> … … 552 552 * references to m_array[] may no longer be valid. 553 553 * 554 * @param value StringBu ffer whose contents are to be appended.555 */ 556 public final void append(StringBu ffer value)554 * @param value StringBuilder whose contents are to be appended. 555 */ 556 public final void append(StringBuilder value) 557 557 { 558 558 … … 611 611 // Should do all the work of both encapsulating 612 612 // existing data and establishing new sizes/offsets 613 m_innerFSB = new FastStringBu ffer(this);613 m_innerFSB = new FastStringBuilder(this); 614 614 } 615 615 … … 629 629 /** 630 630 * Append part of the contents of a Character Array onto the 631 * FastStringBu ffer, growing the storage if necessary.631 * FastStringBuilder, growing the storage if necessary. 632 632 * <p> 633 633 * NOTE THAT after calling append(), previously obtained … … 694 694 // Should do all the work of both encapsulating 695 695 // existing data and establishing new sizes/offsets 696 m_innerFSB = new FastStringBu ffer(this);696 m_innerFSB = new FastStringBuilder(this); 697 697 } 698 698 … … 711 711 712 712 /** 713 * Append the contents of another FastStringBu ffer onto714 * this FastStringBu ffer, growing the storage if necessary.713 * Append the contents of another FastStringBuilder onto 714 * this FastStringBuilder, growing the storage if necessary. 715 715 * <p> 716 716 * NOTE THAT after calling append(), previously obtained 717 717 * references to m_array[] may no longer be valid. 718 718 * 719 * @param value FastStringBu ffer whose contents are719 * @param value FastStringBuilder whose contents are 720 720 * to be appended. 721 721 */ 722 public final void append(FastStringBu ffer value)722 public final void append(FastStringBuilder value) 723 723 { 724 724 … … 794 794 // Should do all the work of both encapsulating 795 795 // existing data and establishing new sizes/offsets 796 m_innerFSB = new FastStringBu ffer(this);796 m_innerFSB = new FastStringBuilder(this); 797 797 } 798 798 … … 864 864 return getOneChunkString(startChunk, startColumn, length); 865 865 } 866 return getString(new StringBu ffer(length), startChunk, startColumn,866 return getString(new StringBuilder(length), startChunk, startColumn, 867 867 length).toString();