summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2006-02-24 14:04:37 (EST)
committer pelder2006-02-24 14:04:37 (EST)
commit79d9bb81ecd0f91b46087d61dac630f0d1bd6ddb (patch)
treebfc015c550698ce797976cd8dfd79df6b0222903
downloadorg.eclipse.jet-79d9bb81ecd0f91b46087d61dac630f0d1bd6ddb.zip
org.eclipse.jet-79d9bb81ecd0f91b46087d61dac630f0d1bd6ddb.tar.gz
org.eclipse.jet-79d9bb81ecd0f91b46087d61dac630f0d1bd6ddb.tar.bz2
Initial commit
-rw-r--r--plugins/org.eclipse.jet/.classpath7
-rw-r--r--plugins/org.eclipse.jet/.cvsignore4
-rw-r--r--plugins/org.eclipse.jet/.jetproperties4
-rw-r--r--plugins/org.eclipse.jet/.options7
-rw-r--r--plugins/org.eclipse.jet/.project34
-rw-r--r--plugins/org.eclipse.jet/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--plugins/org.eclipse.jet/.settings/org.eclipse.jdt.core.prefs246
-rw-r--r--plugins/org.eclipse.jet/.settings/org.eclipse.jdt.ui.prefs6
-rw-r--r--plugins/org.eclipse.jet/META-INF/MANIFEST.MF44
-rw-r--r--plugins/org.eclipse.jet/about.html24
-rw-r--r--plugins/org.eclipse.jet/build.properties22
-rw-r--r--plugins/org.eclipse.jet/bundlebuild.xml19
-rw-r--r--plugins/org.eclipse.jet/dynPlugin.xml6
-rw-r--r--plugins/org.eclipse.jet/html/book.css106
-rw-r--r--plugins/org.eclipse.jet/html/reference/.cvsignore2
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/addElementTag.html86
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/addNodeTag.html91
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/addTextElementTag.html96
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/addTextNodeTag.html97
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/caseTag.html79
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/chooseTag.html72
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/copyElementTag.html94
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/copyNodeTag.html97
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/getTag.html82
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/ifTag.html79
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/includeTag.html82
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/initialCodeTag.html72
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/iterateTag.html92
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/loadTag.html94
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/logTag.html84
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/otherwiseTag.html75
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/overview.html182
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/removeElementTag.html70
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/removeNodeTag.html71
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/setTag.html80
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/setVariableTag.html74
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/userRegionTag.html72
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/visitTag.html79
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/visitorTag.html80
-rw-r--r--plugins/org.eclipse.jet/html/reference/controlTags/whenTag.html79
-rw-r--r--plugins/org.eclipse.jet/html/reference/formatTags/lcTag.html88
-rw-r--r--plugins/org.eclipse.jet/html/reference/formatTags/overview.html70
-rw-r--r--plugins/org.eclipse.jet/html/reference/formatTags/replaceAllTag.html92
-rw-r--r--plugins/org.eclipse.jet/html/reference/formatTags/stripTag.html72
-rw-r--r--plugins/org.eclipse.jet/html/reference/formatTags/ucTag.html88
-rw-r--r--plugins/org.eclipse.jet/html/reference/javaTags/classTag.html86
-rw-r--r--plugins/org.eclipse.jet/html/reference/javaTags/impliedImportTag.html70
-rw-r--r--plugins/org.eclipse.jet/html/reference/javaTags/importTag.html72
-rw-r--r--plugins/org.eclipse.jet/html/reference/javaTags/importsLocationTag.html70
-rw-r--r--plugins/org.eclipse.jet/html/reference/javaTags/overview.html91
-rw-r--r--plugins/org.eclipse.jet/html/reference/javaTags/packageTag.html88
-rw-r--r--plugins/org.eclipse.jet/html/reference/javaTags/resourceTag.html86
-rw-r--r--plugins/org.eclipse.jet/html/reference/javaTags/srcFolderTag.html76
-rw-r--r--plugins/org.eclipse.jet/html/reference/workspaceTags/copyFileTag.html102
-rw-r--r--plugins/org.eclipse.jet/html/reference/workspaceTags/fileTag.html94
-rw-r--r--plugins/org.eclipse.jet/html/reference/workspaceTags/folderTag.html76
-rw-r--r--plugins/org.eclipse.jet/html/reference/workspaceTags/overview.html70
-rw-r--r--plugins/org.eclipse.jet/html/reference/workspaceTags/projectTag.html76
-rw-r--r--plugins/org.eclipse.jet/html/whatsnew/changelog.html209
-rw-r--r--plugins/org.eclipse.jet/javadoc.xml6
-rw-r--r--plugins/org.eclipse.jet/plugin.properties31
-rw-r--r--plugins/org.eclipse.jet/plugin.xml1013
-rw-r--r--plugins/org.eclipse.jet/schema/deployedTransforms.exsd124
-rw-r--r--plugins/org.eclipse.jet/schema/tagLibraries.exsd480
-rw-r--r--plugins/org.eclipse.jet/schema/transform.exsd195
-rw-r--r--plugins/org.eclipse.jet/schema/xpathFunctions.exsd126
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/AbstractContextExtender.java64
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/BodyContentWriter.java283
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/IWriterListener.java46
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Context.java370
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Platform.java334
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Template.java35
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/JET2TemplateLoader.java36
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Writer.java199
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/WriterPositionException.java43
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/XPathContextExtender.java451
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/ASTCompilerParseListener.java494
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/BodyElements.java139
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/Comment.java85
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/DefaultJET2ASTVisitor.java125
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2AST.java154
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2ASTElement.java136
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2ASTVisitor.java94
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2CompilationUnit.java297
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Compiler.java496
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Declaration.java51
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Directive.java79
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Expression.java52
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Scriptlet.java51
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JavaElement.java78
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/Problem.java220
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/TagLibraryUsageManager.java87
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/TagValidationVisitor.java157
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/TextElement.java84
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/TextRewritingVisitor.java210
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/XMLBodyElement.java137
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/XMLElement.java108
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/XMLEmptyElement.java56
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/package.html12
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/InternalJET2Platform.java371
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/BundleBuildParameters.java67
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2Builder.java254
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2BundleBuildTool.java138
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2TransformProjectNature.java78
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/CommentElementDelegate.java85
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/CompilerStateManager.java75
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/DeclarationElementDelegate.java70
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/GenXMLElement.java94
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/JET2CompilerState.java111
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/MethodBodyCreator.java198
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/XMLElementDelegate.java183
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/JET2JavaGenerator.java111
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/JET2TransformGenerator.java48
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/XMLEndGenerator.java47
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/XMLStartGenerator.java80
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/extensionpoints/XPathFunctionsManager.java247
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/l10n/JET2Messages.java241
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/l10n/JET2Messages.properties134
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/launch/JET2TransformationDelegate.java96
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/launch/JETProcess.java110
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/launch/JETStreamMonitor.java108
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/launch/JETStreamsProxy.java61
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETCoreElement.java34
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETMark.java272
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETParseEventListener.java41
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETParseEventListener2.java38
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETParser.java638
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETReader.java800
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/ParseProblemSeverity.java51
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/DoNothingRuntimeTagElement.java136
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/IJET2Runnable.java35
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/IJET2TemplateBundleDescriptor.java42
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/IJET2TemplateBundleSupplier.java41
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/JET2Bundle.java182
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/JET2TemplateStatus.java86
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/PluginDeployedTemplateBundleSupplier.java180
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/PluginReferencedTemplateBundleDescriptor.java72
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/ProjectTemplateBundleDescriptor.java130
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/ProjectTemplateBundleSupplier.java256
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/RuntimeLoggerContextExtender.java100
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/RuntimeTagLogger.java31
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeConditionalRuntimeTag.java82
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeContainerRuntimeTag.java120
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeCustomRuntimeTag.java171
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeEmptyRuntimeTag.java73
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeFunctionRuntimeTag.java92
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeIteratingRuntimeTag.java102
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/SafeOtherRuntimeTag.java108
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/TagFactoryImpl.java102
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/TemplateBundleManager.java114
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/model/EMFModelLoader.java145
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/model/TransformLoadContext.java58
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/runtime/model/WorkspaceLoadContext.java63
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/InternalTagLibManager.java181
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/TagAttributeDefinitionImpl.java81
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/TagDefinitionImpl.java227
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/TagLibraryImpl.java199
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/AddElementTag.java71
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/AddTextElementTag.java73
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/ChooseTag.java81
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/CopyElementTag.java71
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/GetTag.java73
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/IfTag.java57
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/IncludeTag.java78
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/InitialCodeTag.java72
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/IterateTag.java128
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/LoadTag.java100
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/LogTag.java67
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/OtherwiseTag.java64
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/RemoveElementTag.java64
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/SetTag.java71
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/SetVariableTag.java57
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/UserRegionTag.java206
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/VisitTag.java67
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/VisitorTag.java113
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/WhenTag.java80
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/format/LowerCaseTag.java86
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/format/ReplaceAllTag.java77
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/format/StripTag.java59
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/format/UpperCaseTag.java85
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/java/ImpliedImportTag.java53
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/java/ImportTag.java54
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/java/ImportsLocationTag.java164
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/java/JavaClassTag.java50
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/java/JavaResourceTag.java50
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/java/PackageTag.java63
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/java/SrcFolderTag.java61
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/CopyFileTag.java144
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/FileTag.java123
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/FolderTag.java100
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/workspace/ProjectTag.java83
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/AnnotationManagerImpl.java56
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/NodeSetImpl.java182
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/XPathExpressionImpl.java116
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/XPathFactoryImpl.java48
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/XPathImpl.java118
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Axis.java349
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/BinaryOp.java178
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/BooleanExpr.java48
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/BooleanLiteral.java62
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/ContextNode.java54
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/ExprNode.java47
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Function.java92
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/LogicalOp.java105
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/NodeSetCast.java81
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/NodeSetExpr.java49
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/NodeSetLiteral.java47
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/NodeTest.java227
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/NodeTestKind.java108
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/NumberExpr.java48
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/NumberLiteral.java58
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Predicate.java89
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/RelOp.java393
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Root.java64
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Step.java83
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/StringLiteral.java59
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/StringNode.java43
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/UnaryMinus.java57
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/UnionExpr.java68
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Variable.java96
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/BooleanFunction.java85
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/BuiltinXPathFunctionResolver.java90
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/CeilingFunction.java54
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/ConcatFunction.java61
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/ContainsFunction.java56
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/CountFunction.java63
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/FloorFunction.java54
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/LastFunction.java60
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/LocalNameFunction.java84
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/NameFunction.java86
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/NamespaceUriFunction.java88
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/NotFunction.java54
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/NumberFunction.java90
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/PositionFunction.java61
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/RoundFunction.java67
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/StartsWithFunction.java57
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/StringFunction.java132
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/StringLengthFunction.java72
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/SubstringAfterFunction.java64
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/SubstringBeforeFunction.java63
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/SubstringFunction.java94
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/SumFunction.java72
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/functions/TrueFalseFunction.java54
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/AnyAttributeSetting.java75
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/DOMInspector.java382
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EMFEAttrAsElementWrapper.java45
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EMFEAttrAsElementWrapperInspector.java120
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EMFResourceInspector.java130
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EMFXMLNodeWrapper.java76
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EMFXMLNodeWrapperInspector.java101
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EObjectInspector.java1061
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EStructuralFeatureSettingInspector.java120
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/XMLTypeUtil2.java61
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/parser/Token.java80
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/parser/TokenInstance.java53
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/parser/XPathParser.java687
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/parser/XPathTokenScanner.java374
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/parser/XPathTokens.java89
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/package.html12
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/runtime/model/ILoadContext.java43
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/runtime/model/IModelLoader.java57
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/runtime/model/package.html12
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/AbstractConditionalTag.java63
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/AbstractContainerTag.java68
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/AbstractCustomTag.java116
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/AbstractEmptyTag.java44
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/AbstractFunctionTag.java46
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/AbstractIteratingTag.java101
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/AbstractOtherTag.java44
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/ConditionalTag.java51
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/ContainerTag.java74
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/CustomTag.java104
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/CustomTagKind.java69
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/EmptyTag.java47
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/FunctionTag.java46
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/IteratingTag.java68
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/JET2TagException.java70
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/OtherTag.java69
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/RuntimeTagElement.java96
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/TagAttributeDefinition.java76
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/TagDefinition.java123
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/TagFactory.java33
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/TagInfo.java146
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/TagLibrary.java82
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/TagLibraryManager.java75
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/package.html12
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/IWorkspaceAction.java70
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/WorkspaceContextExtender.java202
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/WsCopyBinaryFileAction.java198
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/WsCopyTextFileAction.java229
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/WsFileFromWriterAction.java194
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/WsFolderAction.java133
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/WsProjectAction.java137
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/package.html12
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/transform/IJETBundle.java52
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/transform/TransformContextExtender.java308
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/transform/TransformContextListener.java41
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/transform/package.html12
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/Context.java145
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/DefaultXPathFunctionResolver.java71
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/IAnnotationManager.java45
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/NamespaceContext.java32
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/NodeSet.java30
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/XPath.java41
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/XPathException.java52
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/XPathExpression.java39
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/XPathFactory.java44
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/XPathFunction.java47
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/XPathFunctionMetaData.java103
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/XPathFunctionResolver.java28
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/XPathFunctionWithContext.java35
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/XPathLexicalException.java69
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/XPathRuntimeException.java63
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/XPathSyntaxException.java65
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/XPathVariableResolver.java29
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/inspector/AddElementException.java70
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/inspector/CopyElementException.java67
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/inspector/ExpandedName.java106
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/inspector/IElementInspector.java112
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/inspector/INodeInspector.java90
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/inspector/INodeInspectorExtension1.java45
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/inspector/InspectorManager.java191
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/inspector/InvalidChildException.java77
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/inspector/SimpleElementRequiresValueException.java65
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/inspector/package.html12
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/xpath/package.html12
-rw-r--r--plugins/org.eclipse.jet/templates/jet2java.javajet92
-rw-r--r--plugins/org.eclipse.jet/templates/jet2transform.javajet47
-rw-r--r--plugins/org.eclipse.jet/templates/xmlEnd.javajet15
-rw-r--r--plugins/org.eclipse.jet/templates/xmlStart.javajet21
-rw-r--r--plugins/org.eclipse.jet/toc.xml23
-rw-r--r--plugins/org.eclipse.jet/tocApiReference.xml6
-rw-r--r--plugins/org.eclipse.jet/tocExtensionPointiReference.xml11
-rw-r--r--plugins/org.eclipse.jet/tocWhatsNew.xml6
-rw-r--r--plugins/org.eclipse.jet/toccontrolTags.xml27
-rw-r--r--plugins/org.eclipse.jet/tocformatTags.xml11
-rw-r--r--plugins/org.eclipse.jet/tocjavaTags.xml14
-rw-r--r--plugins/org.eclipse.jet/tocworkspaceTags.xml11
-rw-r--r--plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.newproject_1.0.0.jarbin0 -> 55828 bytes
-rw-r--r--plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.taglibdoc_1.0.0.jarbin0 -> 32397 bytes
340 files changed, 36186 insertions, 0 deletions
diff --git a/plugins/org.eclipse.jet/.classpath b/plugins/org.eclipse.jet/.classpath
new file mode 100644
index 0000000..751c8f2
--- /dev/null
+++ b/plugins/org.eclipse.jet/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.jet/.cvsignore b/plugins/org.eclipse.jet/.cvsignore
new file mode 100644
index 0000000..b5b06c0
--- /dev/null
+++ b/plugins/org.eclipse.jet/.cvsignore
@@ -0,0 +1,4 @@
+bin
+help
+dump.xml
+models
diff --git a/plugins/org.eclipse.jet/.jetproperties b/plugins/org.eclipse.jet/.jetproperties
new file mode 100644
index 0000000..a9dc5d9
--- /dev/null
+++ b/plugins/org.eclipse.jet/.jetproperties
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jet-settings>
+ <template-container>templates</template-container> <source-container>src</source-container>
+</jet-settings>
diff --git a/plugins/org.eclipse.jet/.options b/plugins/org.eclipse.jet/.options
new file mode 100644
index 0000000..7c97ac2
--- /dev/null
+++ b/plugins/org.eclipse.jet/.options
@@ -0,0 +1,7 @@
+org.eclipse.jet/debug=false
+org.eclipse.jet/debug/projectBundleLoading=false
+org.eclipse.jet/debug/pluginBundleLoading=false
+org.eclipse.jet/debug/bundleLoading=false
+org.eclipse.jet/debug/traceTagExecution=false
+org.eclipse.jet/debug/ext/xpathFunctions=false
+org.eclipse.jet/debug/xpath/compilations=false \ No newline at end of file
diff --git a/plugins/org.eclipse.jet/.project b/plugins/org.eclipse.jet/.project
new file mode 100644
index 0000000..0e19ddf
--- /dev/null
+++ b/plugins/org.eclipse.jet/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.jet</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.emf.codegen.JETBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.emf.codegen.jet.IJETNature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.jet/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.jet/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..c84b593
--- /dev/null
+++ b/plugins/org.eclipse.jet/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+#Thu Feb 23 10:59:14 EST 2006
+eclipse.preferences.version=1
+encoding//src/org/eclipse/jet/internal/l10n/JET2Messages.properties=8859_1
diff --git a/plugins/org.eclipse.jet/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.jet/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..6d57dde
--- /dev/null
+++ b/plugins/org.eclipse.jet/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,246 @@
+#Tue Feb 07 09:36:12 EST 2006
+eclipse.preferences.version=1
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=52
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=52
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=52
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=52
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=20
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=20
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=36
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=52
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=52
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=52
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=36
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=68
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=84
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=84
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=2
+org.eclipse.jdt.core.formatter.blank_lines_after_package=2
+org.eclipse.jdt.core.formatter.blank_lines_before_field=1
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=0
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=next_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=next_line_shifted
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=next_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=next_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=next_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false
+org.eclipse.jdt.core.formatter.comment.format_comments=false
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=false
+org.eclipse.jdt.core.formatter.comment.format_source_code=false
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=false
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=140
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=2
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
diff --git a/plugins/org.eclipse.jet/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.jet/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..4e16ced
--- /dev/null
+++ b/plugins/org.eclipse.jet/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,6 @@
+#Tue Feb 07 09:36:12 EST 2006
+eclipse.preferences.version=1
+formatter_profile=_EMFCodeFormatter.profile
+formatter_settings_version=9
+internal.default.compliance=default
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return Returns the ${bare_field_name}.\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} The ${bare_field_name} to set.\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/**\r\n * &lt;copyright&gt;\r\n *\r\n * Copyright (c) ${year} IBM Corporation and others.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Common Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/cpl-v10.html\r\n * \r\n * Contributors\: \r\n * IBM - Initial API and implementation\r\n *\r\n * &lt;/copyright&gt;\r\n *\r\n * $$Id$$\r\n */\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
diff --git a/plugins/org.eclipse.jet/META-INF/MANIFEST.MF b/plugins/org.eclipse.jet/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..83e7dec
--- /dev/null
+++ b/plugins/org.eclipse.jet/META-INF/MANIFEST.MF
@@ -0,0 +1,44 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.jet;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.jet.internal.InternalJET2Platform
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ant.core,
+ org.eclipse.core.resources,
+ org.eclipse.core.runtime,
+ org.eclipse.debug.core,
+ org.eclipse.emf.codegen,
+ org.eclipse.emf.common,
+ org.eclipse.emf.ecore,
+ org.eclipse.emf.ecore.xmi,
+ org.eclipse.text;visibility:=reexport,
+ org.eclipse.core.expressions
+Eclipse-AutoStart: true
+Export-Package: org.eclipse.jet,
+ org.eclipse.jet.compiler,
+ org.eclipse.jet.runtime.model,
+ org.eclipse.jet.taglib,
+ org.eclipse.jet.transform,
+ org.eclipse.jet.xpath,
+ org.eclipse.jet.xpath.inspector,
+ org.eclipse.jet.internal;x-friends:="org.eclipse.jet.tests,org.eclipse.jet.ui",
+ org.eclipse.jet.internal.builder;x-friends:="org.eclipse.jet.tests",
+ org.eclipse.jet.internal.compiler;x-friends:="org.eclipse.jet.tests",
+ org.eclipse.jet.internal.compiler.templates;x-friends:="org.eclipse.jet.tests",
+ org.eclipse.jet.internal.launch;x-friends:="org.eclipse.jet.tests,org.eclipse.jet.ui",
+ org.eclipse.jet.internal.parser;x-friends:="org.eclipse.jet.tests",
+ org.eclipse.jet.internal.runtime;x-friends:="org.eclipse.jet.tests,org.eclipse.jet.ui",
+ org.eclipse.jet.internal.runtime.model;x-friends:="org.eclipse.jet.tests",
+ org.eclipse.jet.internal.taglib;x-friends:="org.eclipse.jet.tests",
+ org.eclipse.jet.internal.taglib.control;x-friends:="org.eclipse.jet.tests",
+ org.eclipse.jet.internal.taglib.format;x-friends:="org.eclipse.jet.tests",
+ org.eclipse.jet.internal.taglib.java;x-friends:="org.eclipse.jet.tests",
+ org.eclipse.jet.internal.taglib.workspace;x-friends:="org.eclipse.jet.tests",
+ org.eclipse.jet.internal.xpath;x-friends:="org.eclipse.jet.tests",
+ org.eclipse.jet.internal.xpath.ast;x-friends:="org.eclipse.jet.tests",
+ org.eclipse.jet.internal.xpath.functions;x-friends:="org.eclipse.jet.tests",
+ org.eclipse.jet.internal.xpath.inspectors;x-friends:="org.eclipse.jet.tests",
+ org.eclipse.jet.internal.xpath.parser;x-friends:="org.eclipse.jet.tests"
+Bundle-Vendor: %providerName
diff --git a/plugins/org.eclipse.jet/about.html b/plugins/org.eclipse.jet/about.html
new file mode 100644
index 0000000..1c0db85
--- /dev/null
+++ b/plugins/org.eclipse.jet/about.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>February 22, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
+
+</body>
+</html>
+
diff --git a/plugins/org.eclipse.jet/build.properties b/plugins/org.eclipse.jet/build.properties
new file mode 100644
index 0000000..ca7e81c
--- /dev/null
+++ b/plugins/org.eclipse.jet/build.properties
@@ -0,0 +1,22 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ schema/,\
+ bundlebuild.xml,\
+ transforms/,\
+ plugin.properties,\
+ html/,\
+ toc.xml,\
+ toccontrolTags.xml,\
+ tocformatTags.xml,\
+ tocjavaTags.xml,\
+ tocworkspaceTags.xml,\
+ tocExtensionPointiReference.xml,\
+ tocApiReference.xml,\
+ tocWhatsNew.xml,\
+ about.html
+src.includes = templates/,\
+ src/,\
+ about.html
diff --git a/plugins/org.eclipse.jet/bundlebuild.xml b/plugins/org.eclipse.jet/bundlebuild.xml
new file mode 100644
index 0000000..b42cf5a
--- /dev/null
+++ b/plugins/org.eclipse.jet/bundlebuild.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project default="jar_export" name="build" >
+
+ <!-- =================================
+ target: jar_export
+ ================================= -->
+ <target name="jar_export" depends="" description="--> Export the transformation as a plugin jar">
+ <jar destfile="${bundleJarFile}"
+ basedir="${jet2Project}"
+ manifest="${jet2Project}/META-INF/MANIFEST.MF">
+ <include name="plugin.xml"/>
+ <include name="templates/**"/>
+ <fileset dir="bin" >
+ </fileset>
+ </jar>
+ </target>
+
+
+</project>
diff --git a/plugins/org.eclipse.jet/dynPlugin.xml b/plugins/org.eclipse.jet/dynPlugin.xml
new file mode 100644
index 0000000..daeb27e
--- /dev/null
+++ b/plugins/org.eclipse.jet/dynPlugin.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project default="plugin_export" name="build">
+ <target name="plugin_export">
+ <pde.exportPlugins destination="C:\workspaces\rt_jet2_dev\.metadata\.plugins\org.eclipse.emf.jet2\dynamicPlugins" exportSource="false" exportType="directory" plugins="my.second.jet2.project" source="1.3" target="1.2" useJARFormat="true"/>
+ </target>
+</project>
diff --git a/plugins/org.eclipse.jet/html/book.css b/plugins/org.eclipse.jet/html/book.css
new file mode 100644
index 0000000..9871470
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/book.css
@@ -0,0 +1,106 @@
+P.Code {
+ display: block;
+ text-align: left;
+ text-indent: 0.00pt;
+ margin-top: 0.000000pt;
+ margin-bottom: 0.000000pt;
+ margin-right: 0.000000pt;
+ margin-left: 15pt;
+ font-size: 10.000000pt;
+ font-weight: medium;
+ font-style: Regular;
+ color: #4444CC;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+ font-family: "Courier New";
+}
+H6.CaptionFigColumn {
+ display: block;
+ text-align: left;
+ text-indent: 0.000000pt;
+ margin-top: 3.000000pt;
+ margin-bottom: 11.000000pt;
+ margin-right: 0.000000pt;
+ margin-left: 0.000000pt;
+ font-size: 9.000000pt;
+ font-weight: medium;
+ font-style: Italic;
+ color: #000000;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+ font-family: "Arial";
+}
+P.Note {
+ display: block;
+ text-align: left;
+ text-indent: 0pt;
+ margin-top: 19.500000pt;
+ margin-bottom: 19.500000pt;
+ margin-right: 0.000000pt;
+ margin-left: 30pt;
+ font-size: 11.000000pt;
+ font-weight: medium;
+ font-style: Italic;
+ color: #000000;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+ font-family: "Arial";
+}
+EM.UILabel {
+ font-weight: Bold;
+ font-style: Regular;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+}
+EM.CodeName {
+ font-weight: Bold;
+ font-style: Regular;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+ font-family:"Courier New";
+}
+
+body, html { border: 0px }
+
+
+/* following font face declarations need to be removed for DBCS */
+
+body, h1, h2, h3, h4, h5, h6, p, table, td, caption, th, ul, ol, dl, li, dd, dt {font-family: Arial, Helvetica, sans-serif; color: #000000}
+pre { font-family: Courier, monospace}
+
+/* end font face declarations */
+
+/* following font size declarations should be OK for DBCS */
+body, h1, h2, h3, h4, h5, h6, p, table, td, caption, th, ul, ol, dl, li, dd, dt {font-size: 10pt; }
+pre { font-size: 10pt}
+
+/* end font size declarations */
+
+body { background: #FFFFFF}
+h1 { font-size: 18pt; margin-top: 5; margin-bottom: 1 }
+h2 { font-size: 14pt; margin-top: 25; margin-bottom: 3 }
+h3 { font-size: 11pt; margin-top: 20; margin-bottom: 3 }
+h4 { font-size: 10pt; margin-top: 20; margin-bottom: 3; font-style: italic }
+p { margin-top: 10px; margin-bottom: 10px }
+pre { margin-left: 6; font-size: 9pt; color: #4444CC }
+a:link { color: #0000FF }
+a:hover { color: #000080 }
+a:visited { text-decoration: underline }
+ul { margin-top: 0; margin-bottom: 10 }
+li { margin-top: 0; margin-bottom: 0 }
+li p { margin-top: 0; margin-bottom: 0 }
+ol { margin-top: 0; margin-bottom: 10 }
+dl { margin-top: 0; margin-bottom: 10 }
+dt { margin-top: 0; margin-bottom: 0; font-weight: bold }
+dd { margin-top: 0; margin-bottom: 0 }
+strong { font-weight: bold}
+em { font-style: italic}
+var { font-style: italic}
+div.revision { border-left-style: solid; border-left-width: thin;
+ border-left-color: #7B68EE; padding-left:5 }
+th { font-weight: bold } \ No newline at end of file
diff --git a/plugins/org.eclipse.jet/html/reference/.cvsignore b/plugins/org.eclipse.jet/html/reference/.cvsignore
new file mode 100644
index 0000000..eedc0fc
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/.cvsignore
@@ -0,0 +1,2 @@
+api
+extensionpoints
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/addElementTag.html b/plugins/org.eclipse.jet/html/reference/controlTags/addElementTag.html
new file mode 100644
index 0000000..705ad35
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/addElementTag.html
@@ -0,0 +1,86 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;c:addElement&gt; - Standard JET2 Control Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;c:addElement&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Control Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>addElement</B></P>
+<P><P> Create a new model element under the selected node.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:addElement select=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:addElement select=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot; var=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">select</TD>
+ <TD><BR> An XPath expression identifying the parent of the new element.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">name</TD>
+ <TD><BR> The name of the new element.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Optional Attributes</TH></TR>
+ <TR>
+ <TR>
+ <TD width="10%">var</TD>
+ <TD><BR> A variable name that will refer to the newly created element.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin addElement example -->
+
+ &lt;c:addElement select=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot;/&gt;<br>
+<!-- End addElement example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/addNodeTag.html b/plugins/org.eclipse.jet/html/reference/controlTags/addNodeTag.html
new file mode 100644
index 0000000..c11aadc
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/addNodeTag.html
@@ -0,0 +1,91 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;c:addNode&gt; - Standard JET2 Control Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;c:addNode&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Control Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>addNode</B></P>
+<P>
+ Create a new model element under the selected node.
+ </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:addNode select=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:addNode select=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot; var=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">select</TD>
+ <TD>
+ An XPath expression identifying the parent of the new element.
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%">name</TD>
+ <TD>
+ The name of the new element.
+ </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Optional Attributes</TH></TR>
+ <TR>
+ <TR>
+ <TD width="10%">var</TD>
+ <TD>
+ The name of a variable that will be created to refer to the element.
+ </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin addNode example -->
+ &lt;c:addNode select=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot;/&gt;<br>
+<!-- End addNode example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/addTextElementTag.html b/plugins/org.eclipse.jet/html/reference/controlTags/addTextElementTag.html
new file mode 100644
index 0000000..81e3476
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/addTextElementTag.html
@@ -0,0 +1,96 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;c:addTextElement&gt; - Standard JET2 Control Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;c:addTextElement&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Control Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>addTextElement</B></P>
+<P><P> Create a new model element node under the selected element, and whose text content is the content of this tag.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:addTextElement select=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/c:addTextElement&gt;
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:addTextElement select=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot; var=&quot;<I>value</I>&quot; cdata=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/c:addTextElement&gt;
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">select</TD>
+ <TD><BR> An XPath expression determining the parent of the new element.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">name</TD>
+ <TD><BR> The name of the new element.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Optional Attributes</TH></TR>
+ <TR>
+ <TR>
+ <TD width="10%">var</TD>
+ <TD><BR> A variable name that will refer to the newly created element.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">cdata</TD>
+ <TD><BR> Add the text as a CData section. Default is 'false'.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin addTextElement example -->
+
+ &lt;c:addTextElement select=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/c:addTextElement&gt;
+<!-- End addTextElement example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/addTextNodeTag.html b/plugins/org.eclipse.jet/html/reference/controlTags/addTextNodeTag.html
new file mode 100644
index 0000000..336ca6f
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/addTextNodeTag.html
@@ -0,0 +1,97 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;c:addTextNode&gt; - Standard JET2 Control Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;c:addTextNode&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Control Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>addTextNode</B></P>
+<P>
+ Create a new model element node under the selected element, and whose text content is the content of this tag.
+ </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:addTextNode select=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/c:addTextNode&gt;
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:addTextNode select=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot; var=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/c:addTextNode&gt;
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">select</TD>
+ <TD>
+ An XPath expression determining the parent of the new element.
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%">name</TD>
+ <TD>
+ The name of the new element.
+ </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Optional Attributes</TH></TR>
+ <TR>
+ <TR>
+ <TD width="10%">var</TD>
+ <TD>
+ The name of a variable that will refer to this newly created element.
+ </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin addTextNode example -->
+ &lt;c:addTextNode select=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/c:addTextNode&gt;
+<!-- End addTextNode example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/caseTag.html b/plugins/org.eclipse.jet/html/reference/controlTags/caseTag.html
new file mode 100644
index 0000000..73495e8
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/caseTag.html
@@ -0,0 +1,79 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;c:case&gt; - Standard JET2 Control Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;c:case&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Control Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>case</B></P>
+<P><P> *** DEPRECATED - use 'when' tag instead. ***<P>Define a one of the mutually exclusive cases of a 'choose' tag. The body of this tag is processed only if the 'test' XPath expression evaluates to 'true', and no previous 'case' or 'otherwise' tag in the containing 'choose' tag has processed its body content.<P><P>If the 'test' XPath expression is does not result in a boolean value, then it is converted to a boolean value according the the XPath 1.0 specification. In particular, if the XPath expression results in a set of objects, then 'test' is considered to be true if and only if the set is not empty.<P><P>If the 'test' XPath expression is not well formed, then an error results.<P><P>If this tag is not directly contained by a 'choose' tag, then an error results.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:case test=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if tag condition is
+ satisfied</I><BR>
+ &lt;/c:case&gt;
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:case test=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if tag condition is
+ satisfied</I><BR>
+ &lt;/c:case&gt;
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">test</TD>
+ <TD><BR> An expression expression, that, if true, causes the tag contents to be evaluated.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin case example -->
+
+ &lt;c:case test=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if tag condition is
+ satisfied</I><BR>
+ &lt;/c:case&gt;
+<!-- End case example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/chooseTag.html b/plugins/org.eclipse.jet/html/reference/controlTags/chooseTag.html
new file mode 100644
index 0000000..0551d15
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/chooseTag.html
@@ -0,0 +1,72 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;c:choose&gt; - Standard JET2 Control Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;c:choose&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Control Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>choose</B></P>
+<P><P> Define a group of mutually exclusive choices. The contents of this tag are restricted to 'when' and 'otherwise' tags only.<P><P>During execution of this tag, each 'when' and 'otherwise' tag is evaluated in sequence. If one of these tags evaluates to 'true', then any subsequent tags are ignored. A 'when' tag evaluates to 'true' if its 'test' attribute's XPath expression evaluates to 'true'. An 'otherwise' tag evaluates to 'true' if no preceeding 'when' (or 'otherwise') tag has evaluated to true.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:choose&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;/c:choose&gt;
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:choose&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;/c:choose&gt;
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin choose example -->
+
+ &lt;c:choose&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;/c:choose&gt;
+<!-- End choose example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/copyElementTag.html b/plugins/org.eclipse.jet/html/reference/controlTags/copyElementTag.html
new file mode 100644
index 0000000..0961173
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/copyElementTag.html
@@ -0,0 +1,94 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;c:copyElement&gt; - Standard JET2 Control Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;c:copyElement&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Control Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>copyElement</B></P>
+<P><P> Copy the selected node to the selected location.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:copyElement select=&quot;<I>value</I>&quot; toSelect=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:copyElement select=&quot;<I>value</I>&quot; toSelect=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot; recursive=&quot;<I>value</I>&quot; var=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">select</TD>
+ <TD><BR> An XPath expression selecting the element node to copy.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">toSelect</TD>
+ <TD><BR> An XPath expression identifying the parent of the newly selected node.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">name</TD>
+ <TD><BR> The name for the newly created element.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Optional Attributes</TH></TR>
+ <TR>
+ <TR>
+ <TD width="10%">recursive</TD>
+ <TD><BR> Determine whether child elements of the copied element are copied, too. Default is 'true'.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">var</TD>
+ <TD><BR> The name of a variable that will be set to the newly copied element.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin copyElement example -->
+
+ &lt;c:copyElement select=&quot;<I>value</I>&quot; toSelect=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot;/&gt;<br>
+<!-- End copyElement example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/copyNodeTag.html b/plugins/org.eclipse.jet/html/reference/controlTags/copyNodeTag.html
new file mode 100644
index 0000000..6ca4df6
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/copyNodeTag.html
@@ -0,0 +1,97 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;c:copyNode&gt; - Standard JET2 Control Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;c:copyNode&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Control Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>copyNode</B></P>
+<P>
+ Copy the selected node to the selected location.
+ </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:copyNode select=&quot;<I>value</I>&quot; toSelect=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:copyNode select=&quot;<I>value</I>&quot; toSelect=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot; var=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">select</TD>
+ <TD>
+ An XPath expression selecting the element node to copy.
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%">toSelect</TD>
+ <TD>
+ An XPath expression identifying the parent of the newly selected node.
+ </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Optional Attributes</TH></TR>
+ <TR>
+ <TR>
+ <TD width="10%">name</TD>
+ <TD>
+ The name for the newly created element.
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%">var</TD>
+ <TD>
+ The name of a variable that will refer to this newly created element.
+ </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin copyNode example -->
+ &lt;c:copyNode select=&quot;<I>value</I>&quot; toSelect=&quot;<I>value</I>&quot;/&gt;<br>
+<!-- End copyNode example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/getTag.html b/plugins/org.eclipse.jet/html/reference/controlTags/getTag.html
new file mode 100644
index 0000000..912cce9
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/getTag.html
@@ -0,0 +1,82 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;c:get&gt; - Standard JET2 Control Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;c:get&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Control Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>get</B></P>
+<P><P> Write a the result of an XPath expression.<P><P>If the 'select' XPath expression returns more than one object, only the first is written. If the XPath expression selects no objects, then an error occurs, unless the 'default' attribute is specified. If the 'select' XPath expression is malformed, then an error occurs.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:get select=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:get select=&quot;<I>value</I>&quot; default=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">select</TD>
+ <TD><BR> The XPath expression to evaluate.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Optional Attributes</TH></TR>
+ <TR>
+ <TR>
+ <TD width="10%">default</TD>
+ <TD><BR> The value to write, if the XPath expression selects no objects.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin get example -->
+
+ &lt;c:get select=&quot;<I>value</I>&quot;/&gt;<br>
+<!-- End get example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/ifTag.html b/plugins/org.eclipse.jet/html/reference/controlTags/ifTag.html
new file mode 100644
index 0000000..ef86677
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/ifTag.html
@@ -0,0 +1,79 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;c:if&gt; - Standard JET2 Control Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;c:if&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Control Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>if</B></P>
+<P><P> Process the tag contents if a test condition is satisfied.<P><P>If the 'test' XPath expression is does not result in a boolean value, then it is converted to a boolean value according the the XPath 1.0 specification. In particular, if the XPath expression results in a set of objects, then 'test' is considered to be true if and only if the set is not empty.<P><P>If the 'test' XPath expression is not well formed, then an error results.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:if test=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if tag condition is
+ satisfied</I><BR>
+ &lt;/c:if&gt;
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:if test=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if tag condition is
+ satisfied</I><BR>
+ &lt;/c:if&gt;
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">test</TD>
+ <TD><BR> An expression expression, that, if true, causes the tag contents to be evaluated.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin if example -->
+
+ &lt;c:if test=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if tag condition is
+ satisfied</I><BR>
+ &lt;/c:if&gt;
+<!-- End if example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/includeTag.html b/plugins/org.eclipse.jet/html/reference/controlTags/includeTag.html
new file mode 100644
index 0000000..a61853c
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/includeTag.html
@@ -0,0 +1,82 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;c:include&gt; - Standard JET2 Control Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;c:include&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Control Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>include</B></P>
+<P><P> Process the referenced template, and include its results in the output of the current template.<P><P>The 'restoreNames' attribute is useful in recursive transforms. It causes the tag to save the listed variable values prior to executing the template, and then restore them after exectuion.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:include template=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:include template=&quot;<I>value</I>&quot; restoreNames=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">template</TD>
+ <TD><BR> A transform project relative path to the template to execute.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Optional Attributes</TH></TR>
+ <TR>
+ <TR>
+ <TD width="10%">restoreNames</TD>
+ <TD><BR> A comma separated list of variable names (without the $ sign).<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin include example -->
+
+ &lt;c:include template=&quot;<I>value</I>&quot;/&gt;<br>
+<!-- End include example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/initialCodeTag.html b/plugins/org.eclipse.jet/html/reference/controlTags/initialCodeTag.html
new file mode 100644
index 0000000..82432cc
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/initialCodeTag.html
@@ -0,0 +1,72 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;c:initialCode&gt; - Standard JET2 Control Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;c:initialCode&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Control Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>initialCode</B></P>
+<P><P> A child tag of the 'userRegion' tag containing the initial code to write. See 'userRegion' for more information.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:initialCode&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;/c:initialCode&gt;
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:initialCode&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;/c:initialCode&gt;
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin initialCode example -->
+
+ &lt;c:initialCode&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;/c:initialCode&gt;
+<!-- End initialCode example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/iterateTag.html b/plugins/org.eclipse.jet/html/reference/controlTags/iterateTag.html
new file mode 100644
index 0000000..02d07ad
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/iterateTag.html
@@ -0,0 +1,92 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;c:iterate&gt; - Standard JET2 Control Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;c:iterate&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Control Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>iterate</B></P>
+<P><P> Write the tag contents for each in the template input model identified by an XPath expression.<P><P>If the &apos;select&apos; XPath expression selects no objects, then the contents of the tag are not processed. If the XPath expression is not well-formed, then an error results.<P><P>If the 'select' XPath expression returns a number, then the body of the loop is processed that number of times, and the variable named by 'var' is set to 1 for the first iteration, and incremented by one for each successive iteration.<P><P>If there is a variable in scope with the same name as the value &apos;var&apos; attribute, then it is hidden during the execution of this tag.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:iterate select=&quot;<I>value</I>&quot; var=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be repeated for each iteration</I><BR>
+ &lt;/c:iterate&gt;
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:iterate select=&quot;<I>value</I>&quot; var=&quot;<I>value</I>&quot; delimiter=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be repeated for each iteration</I><BR>
+ &lt;/c:iterate&gt;
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">select</TD>
+ <TD><BR> An XPath expression that returns either a node set (a collection of elements or attributes) or a number.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">var</TD>
+ <TD><BR> A variable name. During each iteration, the value of the variable is an object from the set of objects selected by the 'select' XPath expression.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Optional Attributes</TH></TR>
+ <TR>
+ <TR>
+ <TD width="10%">delimiter</TD>
+ <TD><BR> A string that is written to the tag's output between iteration of the tag. The text is not written after the last iteration.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin iterate example -->
+
+ &lt;c:iterate select=&quot;<I>value</I>&quot; var=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be repeated for each iteration</I><BR>
+ &lt;/c:iterate&gt;
+<!-- End iterate example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/loadTag.html b/plugins/org.eclipse.jet/html/reference/controlTags/loadTag.html
new file mode 100644
index 0000000..426d48d
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/loadTag.html
@@ -0,0 +1,94 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;c:load&gt; - Standard JET2 Control Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;c:load&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Control Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>load</B></P>
+<P><P> Load the referenced model, and set the passed variable to the loaded document root.<P><P>The optional urlContext attribute determines how relative URL in the url attribute are resolved. Predefined constants: 'transform', indicating that URL is relative to the root directory of the transform; 'workspace', indicating the URL is relative to the current Eclipse workspace.<P><P>The optional loader attribute determines which loader is used to load the model. The default loader is 'emf', although other loaders may have been contributed.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:load url=&quot;<I>value</I>&quot; var=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:load url=&quot;<I>value</I>&quot; var=&quot;<I>value</I>&quot; urlContext=&quot;<I>value</I>&quot; loader=&quot;<I>value</I>&quot; type=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">url</TD>
+ <TD><BR> The URL of the model to load. Usually, this is a relative URL, and is interpretation is controlled by the urlContext attribute.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">var</TD>
+ <TD><BR> A variable name. The root of the loaded document is set to this variable.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Optional Attributes</TH></TR>
+ <TR>
+ <TR>
+ <TD width="10%">urlContext</TD>
+ <TD><BR> A url context constant. See tag comments for possible values. The default is 'transform'.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">loader</TD>
+ <TD><BR> A constant defining the loader to use. The default is 'emf'.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">type</TD>
+ <TD><BR> The type (typically the extension) of the model. That may be required if the URL does not have a standard extension.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin load example -->
+
+ &lt;c:load url=&quot;<I>value</I>&quot; var=&quot;<I>value</I>&quot;/&gt;<br>
+<!-- End load example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/logTag.html b/plugins/org.eclipse.jet/html/reference/controlTags/logTag.html
new file mode 100644
index 0000000..77a18cd
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/logTag.html
@@ -0,0 +1,84 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;c:log&gt; - Standard JET2 Control Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;c:log&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Control Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>log</B></P>
+<P><P> Write a message to the transformation log. The contents of the tag are written to the log. Nothing is written the template output.<P><P>The optional 'severity' attribute may have one of the following values: 'info', 'warning' or 'error'. The default is 'info'.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:log&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/c:log&gt;
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:log severity=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/c:log&gt;
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Optional Attributes</TH></TR>
+ <TR>
+ <TR>
+ <TD width="10%">severity</TD>
+ <TD><BR> The message severity level. Default is 'info'.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin log example -->
+
+ &lt;c:log&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/c:log&gt;
+<!-- End log example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/otherwiseTag.html b/plugins/org.eclipse.jet/html/reference/controlTags/otherwiseTag.html
new file mode 100644
index 0000000..e62ff1a
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/otherwiseTag.html
@@ -0,0 +1,75 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;c:otherwise&gt; - Standard JET2 Control Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;c:otherwise&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Control Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>otherwise</B></P>
+<P><P> Define a default case for a 'choose' tag. The body of this tag is processed only if no previous 'case' or 'otherwise' tag in the containing 'choose' tag has processed its body content.<P><P>An error occurs if the 'otherwise' is not directly contained by a 'choose' tag.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:otherwise&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if tag condition is
+ satisfied</I><BR>
+ &lt;/c:otherwise&gt;
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:otherwise&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if tag condition is
+ satisfied</I><BR>
+ &lt;/c:otherwise&gt;
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin otherwise example -->
+
+ &lt;c:otherwise&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if tag condition is
+ satisfied</I><BR>
+ &lt;/c:otherwise&gt;
+<!-- End otherwise example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/overview.html b/plugins/org.eclipse.jet/html/reference/controlTags/overview.html
new file mode 100644
index 0000000..fb65e92
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/overview.html
@@ -0,0 +1,182 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<TITLE>overview.html</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>Overview</P>
+ </TH>
+ <TH align="right">Standard JET2 Control Tags</TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<P>controlTags</P>
+<P><P> Control flow and data management tags. This tags allow templates to evaluate conditions, perform loops and access and set information in the template input.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%"><A href="iterateTag.html">&lt;c:iterate&gt;</A></TD>
+ <TD><!-- Begin iterate description -->
+ <P> Write the tag contents for each in the template input model identified by an XPath expression
+ <!-- End iterate description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="ifTag.html">&lt;c:if&gt;</A></TD>
+ <TD><!-- Begin if description -->
+ <P> Process the tag contents if a test condition is satisfied
+ <!-- End if description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="getTag.html">&lt;c:get&gt;</A></TD>
+ <TD><!-- Begin get description -->
+ <P> Write a the result of an XPath expression
+ <!-- End get description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="setTag.html">&lt;c:set&gt;</A></TD>
+ <TD><!-- Begin set description -->
+ <P> Set an attribute on an object selected by an XPath expression
+ <!-- End set description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="chooseTag.html">&lt;c:choose&gt;</A></TD>
+ <TD><!-- Begin choose description -->
+ <P> Define a group of mutually exclusive choices
+ <!-- End choose description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="caseTag.html">&lt;c:case&gt;</A></TD>
+ <TD><!-- Begin case description -->
+ <P> *** DEPRECATED - use 'when' tag instead
+ <!-- End case description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="otherwiseTag.html">&lt;c:otherwise&gt;</A></TD>
+ <TD><!-- Begin otherwise description -->
+ <P> Define a default case for a 'choose' tag
+ <!-- End otherwise description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="visitorTag.html">&lt;c:visitor&gt;</A></TD>
+ <TD><!-- Begin visitor description -->
+ <P> *** PROTOTYPE *** Iterate over an object and all its contained objects, typically be doing a depth-first traversal
+ <!-- End visitor description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="visitTag.html">&lt;c:visit&gt;</A></TD>
+ <TD><!-- Begin visit description -->
+ <P> Define content to process for an object found by the parent 'visitor' tag, provided a condition is met
+ <!-- End visit description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="userRegionTag.html">&lt;c:userRegion&gt;</A></TD>
+ <TD><!-- Begin userRegion description -->
+ <P> Define a region in the generated text where users may write customized code
+ <!-- End userRegion description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="includeTag.html">&lt;c:include&gt;</A></TD>
+ <TD><!-- Begin include description -->
+ <P> Process the referenced template, and include its results in the output of the current template
+ <!-- End include description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="logTag.html">&lt;c:log&gt;</A></TD>
+ <TD><!-- Begin log description -->
+ <P> Write a message to the transformation log
+ <!-- End log description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="initialCodeTag.html">&lt;c:initialCode&gt;</A></TD>
+ <TD><!-- Begin initialCode description -->
+ <P> A child tag of the 'userRegion' tag containing the initial code to write
+ <!-- End initialCode description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="setVariableTag.html">&lt;c:setVariable&gt;</A></TD>
+ <TD><!-- Begin setVariable description -->
+ <P> Create a variable whose value is set to the result of the provided XPath expression
+ <!-- End setVariable description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="addElementTag.html">&lt;c:addElement&gt;</A></TD>
+ <TD><!-- Begin addElement description -->
+ <P> Create a new model element under the selected node
+ <!-- End addElement description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="addTextElementTag.html">&lt;c:addTextElement&gt;</A></TD>
+ <TD><!-- Begin addTextElement description -->
+ <P> Create a new model element node under the selected element, and whose text content is the content of this tag
+ <!-- End addTextElement description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="removeElementTag.html">&lt;c:removeElement&gt;</A></TD>
+ <TD><!-- Begin removeElement description -->
+ <P> Remove the selected node from the document tree
+ <!-- End removeElement description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="copyElementTag.html">&lt;c:copyElement&gt;</A></TD>
+ <TD><!-- Begin copyElement description -->
+ <P> Copy the selected node to the selected location
+ <!-- End copyElement description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="loadTag.html">&lt;c:load&gt;</A></TD>
+ <TD><!-- Begin load description -->
+ <P> Load the referenced model, and set the passed variable to the loaded document root
+ <!-- End load description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="whenTag.html">&lt;c:when&gt;</A></TD>
+ <TD><!-- Begin when description -->
+ <P> Define a one of the mutually exclusive cases of a 'choose' tag
+ <!-- End when description -->
+ </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example Directive</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: sans-serif"><SPAN
+ style="font-family: monospace">&lt;%@taglib prefix=&quot;c&quot;
+ id=&quot;org.eclipse.jet.controlTags&quot;%&gt;</SPAN></SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/removeElementTag.html b/plugins/org.eclipse.jet/html/reference/controlTags/removeElementTag.html
new file mode 100644
index 0000000..c36ff74
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/removeElementTag.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;c:removeElement&gt; - Standard JET2 Control Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;c:removeElement&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Control Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>removeElement</B></P>
+<P><P> Remove the selected node from the document tree.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:removeElement select=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:removeElement select=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">select</TD>
+ <TD><BR> An XPath expression determining the document to remove.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin removeElement example -->
+
+ &lt;c:removeElement select=&quot;<I>value</I>&quot;/&gt;<br>
+<!-- End removeElement example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/removeNodeTag.html b/plugins/org.eclipse.jet/html/reference/controlTags/removeNodeTag.html
new file mode 100644
index 0000000..8a8a030
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/removeNodeTag.html
@@ -0,0 +1,71 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;c:removeNode&gt; - Standard JET2 Control Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;c:removeNode&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Control Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>removeNode</B></P>
+<P>
+ Remove the selected node from the document tree.
+ </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:removeNode select=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:removeNode select=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">select</TD>
+ <TD>
+ An XPath expression determining the document to remove.
+ </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin removeNode example -->
+ &lt;c:removeNode select=&quot;<I>value</I>&quot;/&gt;<br>
+<!-- End removeNode example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/setTag.html b/plugins/org.eclipse.jet/html/reference/controlTags/setTag.html
new file mode 100644
index 0000000..e0fc223
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/setTag.html
@@ -0,0 +1,80 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;c:set&gt; - Standard JET2 Control Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;c:set&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Control Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>set</B></P>
+<P><P> Set an attribute on an object selected by an XPath expression. The value of the attribute is determined by the contents of the tag.<P><P>If the XPath expression results in more than one object being selected, then that attribute is created on only the first selected object. <P><P>If the XPath expression does not select an object, or if the XPath expression is malformed, then an error occurs.<P><P>The 'name' attribute need not refer to an attribute defined on the selected object. If the attribute does not exist, one is created dynamically. Such dynamically created attributes are not permanent - they are destroyed when the JET2Context object passed to the template is destroyed.<P><P>If the 'name' attribute refers to an existing attribute on the selected object, then the tag attempts to convert the string contents of this tag to the appropriate attribute data type. If this conversion fails, then an error occurs.<P><P><P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:set select=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/c:set&gt;
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:set select=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/c:set&gt;
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">select</TD>
+ <TD><BR> The XPath expression to evaluate.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">name</TD>
+ <TD><BR> The name of the attribute to set or create and set.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin set example -->
+
+ &lt;c:set select=&quot;<I>value</I>&quot; name=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/c:set&gt;
+<!-- End set example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/setVariableTag.html b/plugins/org.eclipse.jet/html/reference/controlTags/setVariableTag.html
new file mode 100644
index 0000000..59d0c77
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/setVariableTag.html
@@ -0,0 +1,74 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;c:setVariable&gt; - Standard JET2 Control Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;c:setVariable&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Control Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>setVariable</B></P>
+<P><P> Create a variable whose value is set to the result of the provided XPath expression.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:setVariable select=&quot;<I>value</I>&quot; var=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:setVariable select=&quot;<I>value</I>&quot; var=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">select</TD>
+ <TD><BR> An XPath expression to creates the variable's value.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">var</TD>
+ <TD><BR> The name of the variable to set.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin setVariable example -->
+
+ &lt;c:setVariable select=&quot;<I>value</I>&quot; var=&quot;<I>value</I>&quot;/&gt;<br>
+<!-- End setVariable example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/userRegionTag.html b/plugins/org.eclipse.jet/html/reference/controlTags/userRegionTag.html
new file mode 100644
index 0000000..8513928
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/userRegionTag.html
@@ -0,0 +1,72 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;c:userRegion&gt; - Standard JET2 Control Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;c:userRegion&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Control Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>userRegion</B></P>
+<P><P> Define a region in the generated text where users may write customized code. <P><P>The tag must contain a single 'initialCode' tag. Content before the initialCode tag is considered a 'begin marker', while content after it is considered an<P>'end marker'. During execution, the existing file is searched for the begin and end markers. If found, the content of the user region tag is replaced with<P>the content found in the existing file. If the markers are not found (or the file does not exist), then the markers, along with the content of the initialCode<P>tag are written.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:userRegion&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;/c:userRegion&gt;
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:userRegion&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;/c:userRegion&gt;
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin userRegion example -->
+
+ &lt;c:userRegion&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;/c:userRegion&gt;
+<!-- End userRegion example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/visitTag.html b/plugins/org.eclipse.jet/html/reference/controlTags/visitTag.html
new file mode 100644
index 0000000..5559d34
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/visitTag.html
@@ -0,0 +1,79 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;c:visit&gt; - Standard JET2 Control Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;c:visit&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Control Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>visit</B></P>
+<P><P> Define content to process for an object found by the parent 'visitor' tag, provided a condition is met. The contents of this tag are evaluated if the current object of the 'visitor' iteration satisfies the 'test' XPath expression.<P><P>The 'test' XPath expression is relative to the current object of the parent 'visitor' tag. If the 'test' XPath expression is does not result in a boolean value, then it is converted to a boolean value according the the XPath 1.0 specification. In particular, if the XPath expression results in a set of objects, then 'test' is considered to be true if and only if the set is not empty.<P><P>Note that more than one 'visit' tag may be executed for the same object identified by the parent 'visitor' tag.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:visit test=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if tag condition is
+ satisfied</I><BR>
+ &lt;/c:visit&gt;
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:visit test=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if tag condition is
+ satisfied</I><BR>
+ &lt;/c:visit&gt;
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">test</TD>
+ <TD>TODO Define description of test</TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin visit example -->
+
+ &lt;c:visit test=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if tag condition is
+ satisfied</I><BR>
+ &lt;/c:visit&gt;
+<!-- End visit example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/visitorTag.html b/plugins/org.eclipse.jet/html/reference/controlTags/visitorTag.html
new file mode 100644
index 0000000..1b94458
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/visitorTag.html
@@ -0,0 +1,80 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;c:visitor&gt; - Standard JET2 Control Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;c:visitor&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Control Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>visitor</B></P>
+<P><P> *** PROTOTYPE *** Iterate over an object and all its contained objects, typically be doing a depth-first traversal. For each identified object, the tag evaluates the 'test' condition on its contained 'visit' tags. Only those tags whose test condition is true have their contents processed.<P><P>If the 'select' XPath expression returns more than one object, only the first is written. If the XPath expression selects no objects, then an error occurs, unless the 'default' attribute is specified. If the 'select' XPath expression is malformed, then an error occurs.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:visitor select=&quot;<I>value</I>&quot; var=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be repeated for each iteration</I><BR>
+ &lt;/c:visitor&gt;
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:visitor select=&quot;<I>value</I>&quot; var=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be repeated for each iteration</I><BR>
+ &lt;/c:visitor&gt;
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">select</TD>
+ <TD><BR> The XPath expression to evaluate.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">var</TD>
+ <TD><BR> The name of a variable that will contain the current object in the iteration.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin visitor example -->
+
+ &lt;c:visitor select=&quot;<I>value</I>&quot; var=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be repeated for each iteration</I><BR>
+ &lt;/c:visitor&gt;
+<!-- End visitor example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/controlTags/whenTag.html b/plugins/org.eclipse.jet/html/reference/controlTags/whenTag.html
new file mode 100644
index 0000000..835a5ce
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/controlTags/whenTag.html
@@ -0,0 +1,79 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;c:when&gt; - Standard JET2 Control Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;c:when&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Control Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>when</B></P>
+<P><P> Define a one of the mutually exclusive cases of a 'choose' tag. The body of this tag is processed only if the 'test' XPath expression evaluates to 'true', and no previous 'when' or 'otherwise' tag in the containing 'choose' tag has processed its body content.<P><P>If the 'test' XPath expression is does not result in a boolean value, then it is converted to a boolean value according the the XPath 1.0 specification. In particular, if the XPath expression results in a set of objects, then 'test' is considered to be true if and only if the set is not empty.<P><P>If the 'test' XPath expression is not well formed, then an error results.<P><P>If this tag is not directly contained by a 'choose' tag, then an error results.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:when test=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if tag condition is
+ satisfied</I><BR>
+ &lt;/c:when&gt;
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;c:when test=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if tag condition is
+ satisfied</I><BR>
+ &lt;/c:when&gt;
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">test</TD>
+ <TD><BR> An expression expression, that, if true, causes the tag contents to be evaluated.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin when example -->
+
+ &lt;c:when test=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if tag condition is
+ satisfied</I><BR>
+ &lt;/c:when&gt;
+<!-- End when example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/formatTags/lcTag.html b/plugins/org.eclipse.jet/html/reference/formatTags/lcTag.html
new file mode 100644
index 0000000..4b6f1b0
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/formatTags/lcTag.html
@@ -0,0 +1,88 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;f:lc&gt; - Standard JET2 Format Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;f:lc&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Format Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>lc</B></P>
+<P><P> Convert the tag contents to lower case.<P><P>If 'offset' is specified, start conversion from the specified character, otherwise, start conversion from the first character.<P><P>if 'length' is specified, convert only the specified number of characters, otherwise, convert all characters from the start character on.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;f:lc&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/f:lc&gt;
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;f:lc offset=&quot;<I>value</I>&quot; length=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/f:lc&gt;
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Optional Attributes</TH></TR>
+ <TR>
+ <TR>
+ <TD width="10%">offset</TD>
+ <TD><BR> The starting offset (0-based) of the conversion. When omitted, 0 (the start of the content to be converted) is assumed.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">length</TD>
+ <TD><BR> The number of characters to convert. When omitted, it is assumed that all characters after (and including) the starting character will be converted.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin lc example -->
+
+ &lt;f:lc&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/f:lc&gt;
+<!-- End lc example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/formatTags/overview.html b/plugins/org.eclipse.jet/html/reference/formatTags/overview.html
new file mode 100644
index 0000000..738ce68
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/formatTags/overview.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<TITLE>overview.html</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>Overview</P>
+ </TH>
+ <TH align="right">Standard JET2 Format Tags</TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<P>formatTags</P>
+<P><P> Standard utility tags that rewrite their content in a different format.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%"><A href="replaceAllTag.html">&lt;f:replaceAll&gt;</A></TD>
+ <TD><!-- Begin replaceAll description -->
+ <P> Replace all instances of a value in the tag's content with a new value
+ <!-- End replaceAll description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="stripTag.html">&lt;f:strip&gt;</A></TD>
+ <TD><!-- Begin strip description -->
+ <P> *** DEPRECATED *** Strip all whitespace from the content
+ <!-- End strip description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="ucTag.html">&lt;f:uc&gt;</A></TD>
+ <TD><!-- Begin uc description -->
+ <P> Convert the tag contents to upper case
+ <!-- End uc description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="lcTag.html">&lt;f:lc&gt;</A></TD>
+ <TD><!-- Begin lc description -->
+ <P> Convert the tag contents to lower case
+ <!-- End lc description -->
+ </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example Directive</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: sans-serif"><SPAN
+ style="font-family: monospace">&lt;%@taglib prefix=&quot;f&quot;
+ id=&quot;org.eclipse.jet.formatTags&quot;%&gt;</SPAN></SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/formatTags/replaceAllTag.html b/plugins/org.eclipse.jet/html/reference/formatTags/replaceAllTag.html
new file mode 100644
index 0000000..fdda080
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/formatTags/replaceAllTag.html
@@ -0,0 +1,92 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;f:replaceAll&gt; - Standard JET2 Format Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;f:replaceAll&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Format Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>replaceAll</B></P>
+<P><P> Replace all instances of a value in the tag's content with a new value.<P><P>If the 'regex' attribute is supplied, and equals 'true', then 'value' is treated as a Regular Expression as defined in java.util.reg.Pattern, otherwise 'value' is treated as a literal value.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;f:replaceAll value=&quot;<I>value</I>&quot; replacement=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/f:replaceAll&gt;
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;f:replaceAll value=&quot;<I>value</I>&quot; replacement=&quot;<I>value</I>&quot; regex=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/f:replaceAll&gt;
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">value</TD>
+ <TD><BR> The value to be replace, or a regular expression defining the value to replace.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">replacement</TD>
+ <TD><BR> The replacement text.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Optional Attributes</TH></TR>
+ <TR>
+ <TR>
+ <TD width="10%">regex</TD>
+ <TD><BR> A boolean value ('true' or 'false'). If omitted, 'false' is assumed.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin replaceAll example -->
+
+ &lt;f:replaceAll value=&quot;<I>value</I>&quot; replacement=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/f:replaceAll&gt;
+<!-- End replaceAll example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/formatTags/stripTag.html b/plugins/org.eclipse.jet/html/reference/formatTags/stripTag.html
new file mode 100644
index 0000000..557bea5
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/formatTags/stripTag.html
@@ -0,0 +1,72 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;f:strip&gt; - Standard JET2 Format Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;f:strip&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Format Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>strip</B></P>
+<P><P> *** DEPRECATED *** Strip all whitespace from the content. This is equivalent to a 'replaceAll' with a regular expression of '\s+'.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;f:strip&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/f:strip&gt;
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;f:strip&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/f:strip&gt;
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin strip example -->
+
+ &lt;f:strip&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/f:strip&gt;
+<!-- End strip example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/formatTags/ucTag.html b/plugins/org.eclipse.jet/html/reference/formatTags/ucTag.html
new file mode 100644
index 0000000..6e24248
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/formatTags/ucTag.html
@@ -0,0 +1,88 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;f:uc&gt; - Standard JET2 Format Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;f:uc&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Format Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>uc</B></P>
+<P><P> Convert the tag contents to upper case.<P><P>If 'offset' is specified, start conversion from the specified character, otherwise, start conversion from the first character.<P><P>if 'length' is specified, convert only the specified number of characters, otherwise, convert all characters from the start character on.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;f:uc&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/f:uc&gt;
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;f:uc offset=&quot;<I>value</I>&quot; length=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/f:uc&gt;
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Optional Attributes</TH></TR>
+ <TR>
+ <TR>
+ <TD width="10%">offset</TD>
+ <TD><BR> The starting offset (0-based) of the conversion. When omitted, 0 (the start of the content to be converted) is assumed.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">length</TD>
+ <TD><BR> The number of characters to convert. When omitted, it is assumed that all characters after (and including) the starting character will be converted.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin uc example -->
+
+ &lt;f:uc&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/f:uc&gt;
+<!-- End uc example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/javaTags/classTag.html b/plugins/org.eclipse.jet/html/reference/javaTags/classTag.html
new file mode 100644
index 0000000..b9fec4a
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/javaTags/classTag.html
@@ -0,0 +1,86 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;java:class&gt; - Standard JET2 Java Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;java:class&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Java Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>class</B></P>
+<P><P> Create a Java class with the specified name.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;java:class name=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;java:class name=&quot;<I>value</I>&quot; package=&quot;<I>value</I>&quot; srcFolder=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">name</TD>
+ <TD><BR> The name unqualified name of the Java class.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Optional Attributes</TH></TR>
+ <TR>
+ <TR>
+ <TD width="10%">package</TD>
+ <TD><BR> The name of the java package. If not specified, then the name of the containing 'java:package' tag is used, otherwise, the default package is used.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">srcFolder</TD>
+ <TD><BR> The a path of source folder. If a relative path, this relative to any containing 'ws:project' or 'ws:folder' tags. If absolute, it is treated as a workspace relative path. If omitted, the first source folder of the containing project is used.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin class example -->
+
+ &lt;java:class name=&quot;<I>value</I>&quot;/&gt;<br>
+<!-- End class example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/javaTags/impliedImportTag.html b/plugins/org.eclipse.jet/html/reference/javaTags/impliedImportTag.html
new file mode 100644
index 0000000..d6da436
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/javaTags/impliedImportTag.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;java:impliedImport&gt; - Standard JET2 Java Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;java:impliedImport&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Java Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>impliedImport</B></P>
+<P><P> *** PROTOTYPE *** Record a name as being implicitly imported. This is a name that a sibling class of the one being generated by the current template.<P><P>This tag must occur after the initial 'importsLocation' tag, but before any 'imports' tags in the template.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;java:impliedImport name=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;java:impliedImport name=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">name</TD>
+ <TD><BR> The name of the class (unqualified) for which there is an implicit import.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin impliedImport example -->
+
+ &lt;java:impliedImport name=&quot;<I>value</I>&quot;/&gt;<br>
+<!-- End impliedImport example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/javaTags/importTag.html b/plugins/org.eclipse.jet/html/reference/javaTags/importTag.html
new file mode 100644
index 0000000..6408941
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/javaTags/importTag.html
@@ -0,0 +1,72 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;java:import&gt; - Standard JET2 Java Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;java:import&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Java Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>import</B></P>
+<P><P> Replace the enclosed content with the equivalent unqualified Java name (if possible), and ensure an appropriate Java import statement is generated.<P><P>This tag must be preceded by a 'importsLocation' tag.<P><P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;java:import&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/java:import&gt;
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;java:import&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/java:import&gt;
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin import example -->
+
+ &lt;java:import&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
+ &lt;/java:import&gt;
+<!-- End import example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/javaTags/importsLocationTag.html b/plugins/org.eclipse.jet/html/reference/javaTags/importsLocationTag.html
new file mode 100644
index 0000000..28755e5
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/javaTags/importsLocationTag.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;java:importsLocation&gt; - Standard JET2 Java Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;java:importsLocation&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Java Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>importsLocation</B></P>
+<P><P> Identify the location for Java import statement generation. Subsequent 'imports' tags will create appropriate Java import statements at this tag's location.<P><P>This tag may occur only once in a template.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;java:importsLocation package=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;java:importsLocation package=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">package</TD>
+ <TD><BR> The package to which the Java code is being written.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin importsLocation example -->
+
+ &lt;java:importsLocation package=&quot;<I>value</I>&quot;/&gt;<br>
+<!-- End importsLocation example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/javaTags/overview.html b/plugins/org.eclipse.jet/html/reference/javaTags/overview.html
new file mode 100644
index 0000000..334bfc1
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/javaTags/overview.html
@@ -0,0 +1,91 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<TITLE>overview.html</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>Overview</P>
+ </TH>
+ <TH align="right">Standard JET2 Java Tags</TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<P>javaTags</P>
+<P><P> Tags useful in generating Java code.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%"><A href="importsLocationTag.html">&lt;java:importsLocation&gt;</A></TD>
+ <TD><!-- Begin importsLocation description -->
+ <P> Identify the location for Java import statement generation
+ <!-- End importsLocation description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="impliedImportTag.html">&lt;java:impliedImport&gt;</A></TD>
+ <TD><!-- Begin impliedImport description -->
+ <P> *** PROTOTYPE *** Record a name as being implicitly imported
+ <!-- End impliedImport description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="importTag.html">&lt;java:import&gt;</A></TD>
+ <TD><!-- Begin import description -->
+ <P> Replace the enclosed content with the equivalent unqualified Java name (if possible), and ensure an appropriate Java import statement is generated
+ <!-- End import description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="packageTag.html">&lt;java:package&gt;</A></TD>
+ <TD><!-- Begin package description -->
+ <P> Create a Java package
+ <!-- End package description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="resourceTag.html">&lt;java:resource&gt;</A></TD>
+ <TD><!-- Begin resource description -->
+ <P> Create a file within a Java package
+ <!-- End resource description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="classTag.html">&lt;java:class&gt;</A></TD>
+ <TD><!-- Begin class description -->
+ <P> Create a Java class with the specified name
+ <!-- End class description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="srcFolderTag.html">&lt;java:srcFolder&gt;</A></TD>
+ <TD><!-- Begin srcFolder description -->
+ <P> Create a source folder with the specified path
+ <!-- End srcFolder description -->
+ </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example Directive</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: sans-serif"><SPAN
+ style="font-family: monospace">&lt;%@taglib prefix=&quot;java&quot;
+ id=&quot;org.eclipse.jet.javaTags&quot;%&gt;</SPAN></SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/javaTags/packageTag.html b/plugins/org.eclipse.jet/html/reference/javaTags/packageTag.html
new file mode 100644
index 0000000..f651c46
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/javaTags/packageTag.html
@@ -0,0 +1,88 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;java:package&gt; - Standard JET2 Java Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;java:package&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Java Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>package</B></P>
+<P><P> Create a Java package.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;java:package name=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;/java:package&gt;
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;java:package name=&quot;<I>value</I>&quot; srcFolder=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;/java:package&gt;
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">name</TD>
+ <TD><BR> The package name.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Optional Attributes</TH></TR>
+ <TR>
+ <TR>
+ <TD width="10%">srcFolder</TD>
+ <TD></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin package example -->
+
+ &lt;java:package name=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;/java:package&gt;
+<!-- End package example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/javaTags/resourceTag.html b/plugins/org.eclipse.jet/html/reference/javaTags/resourceTag.html
new file mode 100644
index 0000000..e090670
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/javaTags/resourceTag.html
@@ -0,0 +1,86 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;java:resource&gt; - Standard JET2 Java Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;java:resource&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Java Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>resource</B></P>
+<P><P> Create a file within a Java package.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;java:resource name=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;java:resource name=&quot;<I>value</I>&quot; package=&quot;<I>value</I>&quot; srcFolder=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">name</TD>
+ <TD><BR> The unqualified file name.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Optional Attributes</TH></TR>
+ <TR>
+ <TR>
+ <TD width="10%">package</TD>
+ <TD></TD>
+ </TR>
+ <TR>
+ <TD width="10%">srcFolder</TD>
+ <TD></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin resource example -->
+
+ &lt;java:resource name=&quot;<I>value</I>&quot;/&gt;<br>
+<!-- End resource example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/javaTags/srcFolderTag.html b/plugins/org.eclipse.jet/html/reference/javaTags/srcFolderTag.html
new file mode 100644
index 0000000..fc43fe7
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/javaTags/srcFolderTag.html
@@ -0,0 +1,76 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;java:srcFolder&gt; - Standard JET2 Java Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;java:srcFolder&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Java Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>srcFolder</B></P>
+<P><P> Create a source folder with the specified path. If the path is relative, it is relative to any containing 'ws:folder' or 'ws:project' , or the default project (if any), if there is no such tag.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;java:srcFolder path=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;/java:srcFolder&gt;
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;java:srcFolder path=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;/java:srcFolder&gt;
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">path</TD>
+ <TD><BR> The path of the source folder. If this path is absolute, it is treated as a workspace relative path. Otherwise, it is relative to any containing 'ws:folder' or 'ws:project' tag, the default project (if set), or the workspace itself.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin srcFolder example -->
+
+ &lt;java:srcFolder path=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;/java:srcFolder&gt;
+<!-- End srcFolder example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/workspaceTags/copyFileTag.html b/plugins/org.eclipse.jet/html/reference/workspaceTags/copyFileTag.html
new file mode 100644
index 0000000..624bef7
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/workspaceTags/copyFileTag.html
@@ -0,0 +1,102 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;ws:copyFile&gt; - Standard JET2 Workspace Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;ws:copyFile&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Workspace Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>copyFile</B></P>
+<P><P> Copy the file refered to by 'url' to the location refered to by 'path'.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;ws:copyFile src=&quot;<I>value</I>&quot; target=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;ws:copyFile src=&quot;<I>value</I>&quot; target=&quot;<I>value</I>&quot; binary=&quot;<I>value</I>&quot; replace=&quot;<I>value</I>&quot; srcEncoding=&quot;<I>value</I>&quot; targetEncoding=&quot;<I>value</I>&quot; srcContext=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">src</TD>
+ <TD><BR> An absolute or relative URL identifying the file to copy. If a relative URL, the 'srcContext' attribute controls resolution of the URL.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">target</TD>
+ <TD><BR> The destination path of the resource. If relative, this is relative to any containing 'folder' or 'project' tag, otherwise, the first path element is treated as a project name.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Optional Attributes</TH></TR>
+ <TR>
+ <TR>
+ <TD width="10%">binary</TD>
+ <TD><BR> Indicates whether the copy is binary or text base. Possible values: 'true' or 'false'. Default: 'false'.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">replace</TD>
+ <TD><BR> Indicates if any existing version of the file should be replaced. Possible values: 'true' or 'false'. Default: 'true'.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">srcEncoding</TD>
+ <TD><BR> Defines the default text encoding of the source file. This is only meaningful if the 'binary' attribute is not 'false'. Default is the platform default text encoding.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">targetEncoding</TD>
+ <TD><BR> Identifies the text encoding to use when writing the target file. This is only meaningful if the 'binary' attribute is not 'true'. The default text encoding is determined by the platform.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">srcContext</TD>
+ <TD><BR> Determines the context of relative URL in the 'src' attribute. Default value is 'transform'. Possible values: 'transform', 'workspace'.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin copyFile example -->
+
+ &lt;ws:copyFile src=&quot;<I>value</I>&quot; target=&quot;<I>value</I>&quot;/&gt;<br>
+<!-- End copyFile example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/workspaceTags/fileTag.html b/plugins/org.eclipse.jet/html/reference/workspaceTags/fileTag.html
new file mode 100644
index 0000000..ad4681f
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/workspaceTags/fileTag.html
@@ -0,0 +1,94 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;ws:file&gt; - Standard JET2 Workspace Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;ws:file&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Workspace Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>file</B></P>
+<P><P> Create or write an Eclipse workspace file. If the file does not exist, the tag attempts to create it and any containing folders. An error occurs if the file does not exist and cannot be created.<P><P>Note that the actual creation of the workspace file is deferred until the JET2Context passed to the executing template has the 'commit' method calls. If the template is part of a JET2 transform, this occurs once all templates have executed.<P><P>If the 'file' tag is contained directly or indirectly by a 'folder' or 'project' tag AND the 'path' attribute on this tag is relative (does not start with a '/'), then the 'path' attribute is treated as relative to the containing 'folder' or 'project'.<P><P>An absolute 'path' (one starting with '/') is treated as a workspace relative path. That is, the first component after the slash is interpreted as the name of an Eclipse Project, and subsequence segments are treated as folder names, with the last segment being interpreted as the file name.<P><P>When executing, this tag will cause the implicit creation of any folders containing the folder to be created. It will not implicitly create a containing workspace project.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;ws:file path=&quot;<I>value</I>&quot; template=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;ws:file path=&quot;<I>value</I>&quot; template=&quot;<I>value</I>&quot; encoding=&quot;<I>value</I>&quot; replace=&quot;<I>value</I>&quot; derived=&quot;<I>value</I>&quot;/&gt;<br>
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">path</TD>
+ <TD><BR> A relative path (no initial '/') or an absolute path.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">template</TD>
+ <TD><BR> A project-relative path of a JET template to execute. The template provides the file's contents.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Optional Attributes</TH></TR>
+ <TR>
+ <TR>
+ <TD width="10%">encoding</TD>
+ <TD><BR> The character encoding of the file. If omitted, then the Eclipse workspace determines the encoding. If provided, then the encoding is changed to the specified value. A value of '#default' restores the encoding of the file to the workspace determined default.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">replace</TD>
+ <TD><BR> A boolean ('true' or 'false') value. If 'true', the tag will overwrite an existing file, otherwise it will not. If omitted, a value of 'true' is assumed.<BR> </TD>
+ </TR>
+ <TR>
+ <TD width="10%">derived</TD>
+ <TD><BR> A boolean value ('true' or 'false') determining the value of the workspace 'derived' attribute for the file. If omitted, a value of 'false' is assumed.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin file example -->
+
+ &lt;ws:file path=&quot;<I>value</I>&quot; template=&quot;<I>value</I>&quot;/&gt;<br>
+<!-- End file example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/workspaceTags/folderTag.html b/plugins/org.eclipse.jet/html/reference/workspaceTags/folderTag.html
new file mode 100644
index 0000000..a31da04
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/workspaceTags/folderTag.html
@@ -0,0 +1,76 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;ws:folder&gt; - Standard JET2 Workspace Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;ws:folder&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Workspace Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>folder</B></P>
+<P><P> Ensure the existence on an Eclipse Workspace Folder. If the folder does not exist, the tag attempts to create it and any containing folders. An error occurs if the folder does not exist and cannot be created.<P><P>Note that the actual creation of the workspace folder is deferred until the JET2Context passed to the executing template has the 'commit' method calls. If the template is part of a JET2 transform, this occurs once all templates have executed.<P><P>If the 'folder' tag is contained directly or indirectly by another 'folder' tag or by a 'project' tag AND the 'path' attribute on this tag is relative (does not start with a '/'), then the 'path' attribute is treated as relative to the containing 'folder' or 'project'.<P><P>The 'folder' tag may contain other tags. Contained 'folder' and 'file' tags will have relative path names iterpreted as being relative to the folder defined by this tag.<P><P>An absolute 'path' (one starting with '/') is treated as a workspace relative path. That is, the first component after the slash is interpreted as the name of an Eclipse Project, and subsequence segments are treated as folder names.<P><P>When executing, this tag will cause the implicit creation of any folders containing the folder to be created. It will not implicitly create a containing workspace project.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;ws:folder path=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;/ws:folder&gt;
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;ws:folder path=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;/ws:folder&gt;
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">path</TD>
+ <TD><BR> A relative path (no initial '/') or an absolute path.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin folder example -->
+
+ &lt;ws:folder path=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;/ws:folder&gt;
+<!-- End folder example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/workspaceTags/overview.html b/plugins/org.eclipse.jet/html/reference/workspaceTags/overview.html
new file mode 100644
index 0000000..f8d80de
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/workspaceTags/overview.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<TITLE>overview.html</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>Overview</P>
+ </TH>
+ <TH align="right">Standard JET2 Workspace Tags</TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<P>workspaceTags</P>
+<P><P> A library of tags for performing actions against the Eclipse workspace.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%"><A href="projectTag.html">&lt;ws:project&gt;</A></TD>
+ <TD><!-- Begin project description -->
+ <P> Ensure the existence of an Eclipse Project of a given name
+ <!-- End project description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="folderTag.html">&lt;ws:folder&gt;</A></TD>
+ <TD><!-- Begin folder description -->
+ <P> Ensure the existence on an Eclipse Workspace Folder
+ <!-- End folder description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="fileTag.html">&lt;ws:file&gt;</A></TD>
+ <TD><!-- Begin file description -->
+ <P> Create or write an Eclipse workspace file
+ <!-- End file description -->
+ </TD>
+ </TR>
+ <TR>
+ <TD width="10%"><A href="copyFileTag.html">&lt;ws:copyFile&gt;</A></TD>
+ <TD><!-- Begin copyFile description -->
+ <P> Copy the file refered to by 'url' to the location refered to by 'path'
+ <!-- End copyFile description -->
+ </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example Directive</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: sans-serif"><SPAN
+ style="font-family: monospace">&lt;%@taglib prefix=&quot;ws&quot;
+ id=&quot;org.eclipse.jet.workspaceTags&quot;%&gt;</SPAN></SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/reference/workspaceTags/projectTag.html b/plugins/org.eclipse.jet/html/reference/workspaceTags/projectTag.html
new file mode 100644
index 0000000..f432aae
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/reference/workspaceTags/projectTag.html
@@ -0,0 +1,76 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<META name="GENERATOR" content="IBM Software Development Platform">
+<TITLE>&lt;ws:project&gt; - Standard JET2 Workspace Tags</TITLE>
+</HEAD>
+<BODY>
+<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH align="left">
+ <P>&lt;ws:project&gt;</P></TH>
+ <TH align="right"><A href="overview.html">Standard JET2 Workspace Tags</A></TH>
+ </TR>
+ </TBODY>
+</TABLE>
+<HR>
+<P><B>project</B></P>
+<P><P> Ensure the existence of an Eclipse Project of a given name. If the project does not exist, it is created. If the project is not opened, it is opened.<P><P>Note that the actual creation of the workspace project is deferred until the JET2Context passed to the executing template has the 'commit' method calls. If the template is part of a JET2 transform, this occurs once all templates have executed.<P><P>An error occurs of the project does not exist and cannot be created, or if the project exists, but cannot be opened.<P><P>The 'project' tag may contain other tags. Contained 'folder' and 'file' tags will have relative path names iterpreted as being relative to the project defined by this tag.<P> </P>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Tag Summary</TH></TR>
+ <TR>
+ <TD width="10%">required</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;ws:project name=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;/ws:project&gt;
+ </SPAN></TD>
+ </TR>
+ <TR>
+ <TD width="10%">full tag</TD>
+ <TD><SPAN style="font-family: monospace">
+ &lt;ws:project name=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;/ws:project&gt;
+ </SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<exists node="tag/attribute use='required'">
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Required Attributes</TH></TR>
+ <TR>
+ <TD width="10%">name</TD>
+ <TD><BR> The name of the project.<BR> </TD>
+ </TR>
+ </TBODY>
+</TABLE>
+</exists>
+<HR>
+<TABLE border="1" width="100%">
+ <TBODY>
+ <TR>
+ <TH colspan="2" align="left">Example</TH></TR>
+ <TR>
+ <TD width="10%"></TD>
+ <TD><SPAN style="font-family: monospace">
+<!-- Begin project example -->
+
+ &lt;ws:project name=&quot;<I>value</I>&quot;&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
+ &lt;/ws:project&gt;
+<!-- End project example -->
+</SPAN></TD>
+ </TR>
+ </TBODY>
+</TABLE>
+<P></P></BODY>
+</HTML>
diff --git a/plugins/org.eclipse.jet/html/whatsnew/changelog.html b/plugins/org.eclipse.jet/html/whatsnew/changelog.html
new file mode 100644
index 0000000..db3e210
--- /dev/null
+++ b/plugins/org.eclipse.jet/html/whatsnew/changelog.html
@@ -0,0 +1,209 @@
+<html
+<head>
+<link rel="STYLESHEET" href="../book.css" charset="ISO-8859-1" type="text/css">
+<title>What's New</title>
+</head>
+<body>
+<h2>Build 20060216</h2>
+<h3>**** WARNING *** PENDING PLUG-IN and PACKAGE CHANGES ****</h3>
+<p>
+The go ahead has been given to create a new Eclipse EMFT project, <code>org.eclipse.jet</code>, which will include the JET2 plugins.
+In the coming weeks, the following names will be changing as this project comes into being:
+<p>
+<table>
+<tr><td><b>Item</b></td><td><b>Old Name</b></td><td><b>New Name</b></td></tr>
+<tr><td>JET2 Core plug-in</td><td><code>org.eclipse.emf.jet2</code></td><td><code>org.eclipse.jet</code></td></tr>
+<tr><td>JET2 UI plug-in</td><td><code>org.eclipse.emf.jet2.ui</code></td><td><code>org.eclipse.jet.ui</code></td></tr>
+<tr><td>JET2 public APIs package names</td><td><code>org.eclipse.emf.jet2....</code></td><td><code>org.eclipse.jet...</code></td></tr>
+</table>
+<p>
+These changes will break a number of things:
+<bl>
+<li>JET2 Project natures and builder names change ids, making the JET2 compiler inoperative on existing JET2 projects.</li>
+<li>JET2 Projects will refer to the old JET2 plug-in, causing PDE compile errors.</li>
+<li>JET2 generated Java classes will refer to the old package names, and will need to be re-built.</li>
+<li>Plug-ins using the JET2 extension points will have to be updated to use the new plugins.</li>
+</bl>
+<p>
+<br>
+When the change happens, additional information (and hopefully tools) will be distributed on how to fix these problems.
+</p>
+
+<h3>Functional changes</h3>
+<p>The JET2 editor has been removed. This is in prep for the move to Open Source - the editor is just
+not ready for prime time. If you have become attached to it's ideosyncratic behavior, let me know, I
+still have the code in a separate plug-in.
+</p>
+
+<h3>API Changes</h3>
+<bl>
+<li>An extension point <code>xpathFunctions</code> has been added to create additional XPath fuctions. Implmentations must implement
+<code>org.eclipse.emf.jet2.XPathFunction</code></li>
+</bl>
+
+<h2>Build 20060208b</h2>
+<h3>API Changes</h3>
+<bl>
+<li><code>TagInfo</code> has added an extra argument to its constructor to facilitate runtime tag execution tracing. The
+old constructor has been deprecated. <b>As this constructor is called by generated code, all JET2 projects should be re-built.</b>
+</li>
+<li><code>XPathContextExtender</code> now has extra methods <code>getAttributeValue</code>, <code>removeAttribute</code>,
+<code>getContents</code> and a new variant of <code>addTextElement</code>. See the java doc for details. This change
+will only be of interest to tag implementers.</li>
+</bl>
+
+<h2>Build 20060208</h2>
+<h3>API Changes</h3>
+<bl>
+<li>Internal package name changes. Most users should be unaffected.</li>
+<li>The code generator was creating a class _jet_transformation.java which used an
+internal interface <code>IJET2Transformation</code>. A new public interface has been
+introduced <code>JET2TemplateLoader</code>, and code generation has been changed.
+<b>Clean and rebuild you JET2 projects.</b></li>
+<li>The package <code>org.eclipse.emf.jet2.compile</code> has been renamed to
+<code>org.eclipse.emf.jet2.compiler</code>.
+</bl>
+
+<h3>New Features</h3>
+<bl>
+<li>The 'c:set' tag was not creating attributes on EMF-based models if the attribute name was not
+one defined in the model. This has been fixed.</li>
+<li>Primitive tag execution tracing is now available, but only by turning on plug-in tracing
+for <code>org.eclipse.emf.jet2</code>. This tracing should be expanded and enhanced in future builds.</li>
+</bl>
+
+<h2>Build 20060207</h2>
+<h3>Bug Fixes</h3>
+<bl>
+<li>Fixed loading of EMF-based input models.</li>
+</bl>
+
+<h2>Build 20060203</h2>
+<h3>API Changes</h3>
+<h4>Tag Library Meta-data access</h4>
+The package <code>org.eclipse.emf.jet2.taglib</code> now contains a <code>TagLibraryManager</code>
+class that provides access to tag libraries declared in the platform. <b>This is valuable for editors
+working on top of JET2.</b>
+<h4>JET2Context refactoring</h4>
+The class <code>JET2Context</code> has been put on a diet. Many of the methods in it have been moved
+to <code>TransformContextExtender</code>. The goal (not there yet) is to have JET2Context light weight
+enough that a JET2 template can be evaluated in a Java program outside of Eclipse. <b>This change shouldn't
+affect anyone, except perhaps tag library authors</b>.
+<h4>Code generator refactoring</h4>
+The classes used by the code generator have been moved to public classes. Any 'internal' classes used
+by the code generator have been deprecated. <b>This should not affect anyone, although transforms that
+have not been 'cleaned' lately may have warnings about using deprecated methods.</b>
+
+<h3>Code Generation Changes</h3>
+The code generator has changed. You should 'clean' your JET2 projects to get the latest code. <b>JET2
+is still compatible with the 'old' code, although there may be some warnings.</b>
+
+<h2>Build 20060202</h2>
+<h3>Deploying Transforms</h3>
+<h4>New files</h4>
+<p>The New JET2 Project wizard has been enhanced to make JET2 transforms more easy to build.
+A new file <b>build.properties</b> is now created. Most users should not need to modify it.
+</p>
+<p>
+For existing projects, you should create a build.properties file with the following contents:
+<pre>
+source.. = jet2java/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ templates/,\
+ plugin.xml
+src.includes = .project,\
+ build.properties,\
+ .classpath
+</pre>
+</p>
+<h4>Creating a deployable Transform</h4>
+<p>
+JET2 Transform projects can now be exported using the standard Eclipse plugin export tools. Steps to follow:
+<bl>
+<li>Right click over the project, and choose <b>Export...</b> from the context menu.</li>
+<li>In the export dialog, select <b>Plug-in Development -> Deployable Plug-ins and Fragments</b>, and click <b>Next</b></li>
+<li>Ensure your JET2 transform project is selected in the <b>Available Plug-ins and Fragments</b> list.</li>
+<li>Select the <b>Directory</b> button in the <b>Export Destination</b> group, and then select a directory to contain the exported
+transform (which will be a JAR file).</li>
+<li>In the <b>Export Options</b> group, ensure that <b>Package plug-ins as individual JAR archives</b> is selected.</li>
+<li>Click <b>Finish</b></li>
+<li>If you have exported to a directory in your workspace, refresh the directory (select, and press F5).
+The exported JAR file will be in the <b>plugins</b> directory under the target directory.</li>
+</bl>
+</p>
+<h4>Deploying a transform in plug-in</h4>
+<p>
+Some transforms designed to be invoked from other Java code. (This is the case for the transform called by the New JET2 Project wizard.)
+In order to package such a transform with the Java code (which is assumed to be in a plug-in), the <b>org.eclipse.emf.jet2.deployedTransforms</b>
+extension point must be used. The following rules must be observed:
+<bl>
+<li>The exported transform JAR must be in a directory within the deploying plug-in project.</li>
+<li>The build.properties file for the deploying plug-in project must include the JAR file, or one of its
+containing directories in its binary build specification.</li>
+<li>The deploying plug-in project must include an extension to <b>org.eclipse.emf.jet2.deployedTransforms</b>.<li>
+</bl>
+</p>
+<p>
+As an example, the plugin org.eclipse.emf.jet2 deploys the transform org.eclipse.emf.jet2.newProject. The transform is exported
+to a JAR in the directory 'transforms/plugins/org.eclipse.emf.jet2.newProject_1.0.0.jar'. The build.properties file for org.eclipse.emf.jet2
+includes a reference to 'transforms' in its binary build. Finally, the plugin.xml contains:
+<pre>
+ &lt;extension
+ point="org.eclipse.emf.jet2.deployedTransforms"&gt;
+ &lt;deployedTransform
+ bundle="transforms/plugins/org.eclipse.emf.jet2.newproject_1.0.0.jar"
+ id="org.eclipse.emf.jet2.newproject"
+ private="true"/&gt;
+ &lt;/extension&gt;
+</pre>
+</p>
+
+<h3>Other Changes</h3>
+<bl>
+<li>The New Project Wizard new generates a file <b>plugin.xml</b>. At this point, no use is made of
+this file. However, this will eventually contain additional transform information such as:
+the initial template to run, a general transform description, which tag libraries are required and
+which tag libraries should be automatically imported into each template. Expect additional
+capabilities in the next week or two.</li>
+</bl>
+
+<h2>Build 20060127</h2>
+<h3>Compiler</h3>
+<bl>
+<li>In build 20060126, the compiler was not writing new .java files (although it was successfully overwriting existing files).
+This has been fixed.</li>
+<li>Build 20060126 was missing an file essential for this change log to appear.</li>
+</bl>
+
+<h2>Build 20060126</h2>
+<h3>Tag libraries</h3>
+<bl>
+<li>Bug in &lt;c:iterate&gt; causing cryptic error message about a variable not being set has been fixed.</li>
+<li>&lt;c:iterate&gt; now can accept a number or numeric expression in the 'select' field, and will iterate
+that number of times. The iteration variable will be a number, starting at 1, and incremented through
+each iteration.</li>
+<li>&lt;ws:copyFile&gt; has had some attributes renamed. You will get compiler errors & warnings until you
+fix things. Attribute 'url' becomes 'src'. Attribute 'urlContext' becomes 'srcContext'. Attribute 'path' becomes
+'target'.</li>
+<li>A bug in &lt;ws:copyFile&gt; when 'srcContext' is 'workspace' and 'target' is an absolute path (starts with
+'/') has been fixed.</li>
+<li>A bug in &lt;c:userRegion&gt; has been fixed. This now works as intended.</li>
+</bl>
+<h3>Compiler</h3>
+<bl>
+<li>Compiler now warns about deprecated tag libraries, tags and attributes.</li>
+<li>Compiler now issues errors if tags that are empty should not be and vice versa.</li>
+<li>Bug in compiler was setting .jet files to 'derived'. This prevented CVS from checking these files
+by default. <b>For a few weeks, the compiler will automatically restore .jet files to be not derived.</b>
+</bl>
+<h3>APIs</h3>
+<bl>
+<li>Tag library APIs have been refactored. I will add documentation next week. In the meantime, check out
+the Javadoc for ContainerTag, ConditionalTag and IteratingTag.</li>
+<li>The abstract implementation of IteratingTag, AbstractIteratingTag has had methods added to support
+easy creation of 'delimiter' attributes'.</li>
+</bl>
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.jet/javadoc.xml b/plugins/org.eclipse.jet/javadoc.xml
new file mode 100644
index 0000000..6e15871
--- /dev/null
+++ b/plugins/org.eclipse.jet/javadoc.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project default="javadoc">
+ <target name="javadoc">
+ <javadoc access="protected" author="false" classpath="C:\usr\targetEnv\e3.2M4+emf2.2M4\eclipse\plugins\org.eclipse.equinox.registry_1.0.0.v20051214a.jar;C:\usr\targetEnv\e3.2M4+emf2.2M4\eclipse\plugins\org.eclipse.core.contenttype_3.2.0.v20051208.jar;C:\usr\targetEnv\e3.2M4+emf2.2M4\eclipse\plugins\org.eclipse.equinox.common_1.0.0.v20051205.jar;C:\usr\targetEnv\e3.2M4+emf2.2M4\eclipse\plugins\org.eclipse.emf.ecore_2.2.0.S200512220106.jar;C:\usr\targetEnv\e3.2M4+emf2.2M4\eclipse\plugins\org.eclipse.core.jobs_3.2.0.v20051208.jar;C:\usr\targetEnv\e3.2M4+emf2.2M4\eclipse\plugins\org.eclipse.core.runtime_3.2.0.v20051208.jar;C:\usr\targetEnv\e3.2M4+emf2.2M4\eclipse\plugins\org.eclipse.ant.core_3.1.100.v20051205.jar;C:\usr\targetEnv\e3.2M4+emf2.2M4\eclipse\plugins\org.eclipse.equinox.preferences_1.0.0.v20051211.jar;C:\usr\targetEnv\e3.2M4+emf2.2M4\eclipse\plugins\org.eclipse.osgi_3.2.0.v20051212a.jar;C:\usr\targetEnv\e3.2M4+emf2.2M4\eclipse\plugins\org.eclipse.debug.core_3.2.0.v20051215a.jar;C:\usr\targetEnv\e3.2M4+emf2.2M4\eclipse\plugins\org.eclipse.emf.common_2.2.0.S200512220106.jar;C:\usr\targetEnv\e3.2M4+emf2.2M4\eclipse\plugins\org.eclipse.emf.ecore.xmi_2.2.0.S200512220106.jar;C:\usr\targetEnv\e3.2M4+emf2.2M4\eclipse\plugins\org.eclipse.text_3.1.100.v20051212-0800.jar;C:\usr\targetEnv\e3.2M4+emf2.2M4\eclipse\plugins\org.eclipse.emf.codegen_2.2.0.S200512220106.jar;C:\usr\targetEnv\e3.2M4+emf2.2M4\eclipse\plugins\org.eclipse.core.resources_3.2.0.v20051208.jar" destdir="C:\usr\workspaces\ws_jet2_dev\org.eclipse.emf.jet2\html\reference\api" doctitle="JET2 API" nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" packagenames="org.eclipse.emf.jet2.taglib,org.eclipse.emf.jet2.model.load,org.eclipse.emf.jet2.compile,org.eclipse.emf.jet2,org.eclipse.emf.jet2.runtime,org.eclipse.emf.jet2.xpath.inspector,org.eclipse.emf.jet2.xpath" source="1.3" sourcepath="src" splitindex="true" use="true" version="true"/>
+ </target>
+</project>
diff --git a/plugins/org.eclipse.jet/plugin.properties b/plugins/org.eclipse.jet/plugin.properties
new file mode 100644
index 0000000..b88bb46
--- /dev/null
+++ b/plugins/org.eclipse.jet/plugin.properties
@@ -0,0 +1,31 @@
+# <copyright>
+# </copyright>
+#
+# $Id$
+
+# ====================================================================
+# To code developer:
+# Do NOT change the properties between this line and the
+# "%%% END OF TRANSLATED PROPERTIES %%%" line.
+# Make a new property name, append to the end of the file and change
+# the code to use the new property.
+# ====================================================================
+
+# ====================================================================
+# %%% END OF TRANSLATED PROPERTIES %%%
+# ====================================================================
+
+pluginName = JET Plug-in
+providerName = IBM
+
+jet2Launch.name = JET Transform
+
+jet2Builder.name = JET Template Builder
+
+tagLibraries.c.name = Standard JET Control Tags
+tagLibraries.ws.name = Standard JET Workspace Tags
+tagLibraries.java.name = Standard JET Java Tags
+tagLibraries.f.name = Standard JET Format Tags
+
+markers.runtimeProblem.name = JET Transform Runtime Problem
+markers.compileProblem.name = JET Template Compile Problem \ No newline at end of file
diff --git a/plugins/org.eclipse.jet/plugin.xml b/plugins/org.eclipse.jet/plugin.xml
new file mode 100644
index 0000000..b2f60ba
--- /dev/null
+++ b/plugins/org.eclipse.jet/plugin.xml
@@ -0,0 +1,1013 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+ <extension-point id="tagLibraries" name="Tag Libraries" schema="schema/tagLibraries.exsd"/>
+ <extension-point id="deployedTransforms" name="Deployed Transformations" schema="schema/deployedTransforms.exsd"/>
+ <extension-point id="transform" name="JET2 Transform" schema="schema/transform.exsd"/>
+ <extension-point id="xpathFunctions" name="XPath Custom Fucntions" schema="schema/xpathFunctions.exsd"/>
+ <extension
+ id="builder"
+ name="%jet2Builder.name"
+ point="org.eclipse.core.resources.builders">
+ <builder>
+ <run class="org.eclipse.jet.internal.builder.JET2Builder"/>
+ </builder>
+ </extension>
+ <extension
+ point="org.eclipse.debug.core.launchConfigurationTypes">
+ <launchConfigurationType
+ delegate="org.eclipse.jet.internal.launch.JET2TransformationDelegate"
+ id="org.eclipse.jet.jet2Transformation"
+ modes="run"
+ name="%jet2Launch.name"/>
+ </extension>
+ <extension
+ point="org.eclipse.jet.deployedTransforms">
+ <deployedTransform
+ bundle="transforms/plugins/org.eclipse.jet.transforms.newproject_1.0.0.jar"
+ id="org.eclipse.jet.transforms.newproject"
+ private="true"/>
+ <deployedTransform
+ bundle="transforms/plugins/org.eclipse.jet.transforms.taglibdoc_1.0.0.jar"
+ id="org.eclipse.jet.transforms.taglibdoc"
+ private="false"/>
+ </extension>
+ <extension
+ point="org.eclipse.jet.tagLibraries">
+ <tagLibrary
+ id="controlTags"
+ name="Standard JET2 Control Tags"
+ standardPrefix="c">
+ <iteratingTag
+ class="org.eclipse.jet.internal.taglib.control.IterateTag"
+ name="iterate">
+
+ <attribute
+ name="select"
+ type="xpath"
+ use="required">
+ <description>
+ An XPath expression that returns either a node set (a collection of elements or attributes) or a number.
+ </description>
+ </attribute>
+ <attribute
+ name="var"
+ type="string"
+ use="required">
+ <description>
+ A variable name. During each iteration, the value of the variable is an object from the set of objects selected by the &apos;select&apos; XPath expression.
+ </description>
+ </attribute>
+ <description>
+ Write the tag contents for each in the template input model identified by an XPath expression.
+
+If the &amp;apos;select&amp;apos; XPath expression selects no objects, then the contents of the tag are not processed. If the XPath expression is not well-formed, then an error results.
+
+If the &apos;select&apos; XPath expression returns a number, then the body of the loop is processed that number of times, and the variable named by &apos;var&apos; is set to 1 for the first iteration, and incremented by one for each successive iteration.
+
+If there is a variable in scope with the same name as the value &amp;apos;var&amp;apos; attribute, then it is hidden during the execution of this tag.
+ </description>
+ <attribute
+ name="delimiter"
+ type="string"
+ use="optional">
+
+ <description>
+ A string that is written to the tag's output between iteration of the tag. The text is not written after the last iteration.
+ </description>
+ </attribute>
+ </iteratingTag>
+ <conditionalTag
+ class="org.eclipse.jet.internal.taglib.control.IfTag"
+ name="if">
+ <attribute
+ name="test"
+ type="xpath"
+ use="required">
+ <description>
+ An expression expression, that, if true, causes the tag contents to be evaluated.
+ </description>
+ </attribute>
+ <description>
+ Process the tag contents if a test condition is satisfied.
+
+If the 'test' XPath expression is does not result in a boolean value, then it is converted to a boolean value according the the XPath 1.0 specification. In particular, if the XPath expression results in a set of objects, then 'test' is considered to be true if and only if the set is not empty.
+
+If the 'test' XPath expression is not well formed, then an error results.
+ </description>
+ </conditionalTag>
+ <emptyTag
+ class="org.eclipse.jet.internal.taglib.control.GetTag"
+ name="get">
+
+ <attribute
+ name="select"
+ type="xpath"
+ use="required">
+ <description>
+ The XPath expression to evaluate.
+ </description>
+ </attribute>
+ <attribute
+ name="default"
+ type="string"
+ use="optional">
+ <description>
+ The value to write, if the XPath expression selects no objects.
+ </description>
+ </attribute>
+ <description>
+ Write a the result of an XPath expression.
+
+If the 'select' XPath expression returns more than one object, only the first is written. If the XPath expression selects no objects, then an error occurs, unless the 'default' attribute is specified. If the 'select' XPath expression is malformed, then an error occurs.
+ </description>
+ </emptyTag>
+ <functionTag
+ class="org.eclipse.jet.internal.taglib.control.SetTag"
+ name="set">
+ <attribute
+ name="select"
+ type="xpath"
+ use="required">
+ <description>
+ The XPath expression to evaluate.
+ </description>
+ </attribute>
+ <attribute
+ name="name"
+ type="string"
+ use="required">
+ <description>
+ The name of the attribute to set or create and set.
+ </description>
+ </attribute>
+ <description>
+ Set an attribute on an object selected by an XPath expression. The value of the attribute is determined by the contents of the tag.
+
+If the XPath expression results in more than one object being selected, then that attribute is created on only the first selected object.
+
+If the XPath expression does not select an object, or if the XPath expression is malformed, then an error occurs.
+
+The 'name' attribute need not refer to an attribute defined on the selected object. If the attribute does not exist, one is created dynamically. Such dynamically created attributes are not permanent - they are destroyed when the JET2Context object passed to the template is destroyed.
+
+If the 'name' attribute refers to an existing attribute on the selected object, then the tag attempts to convert the string contents of this tag to the appropriate attribute data type. If this conversion fails, then an error occurs.
+
+
+ </description>
+ </functionTag>
+ <containerTag
+ class="org.eclipse.jet.internal.taglib.control.ChooseTag"
+ name="choose">
+ <description>
+ Define a group of mutually exclusive choices. The contents of this tag are restricted to &apos;when&apos; and &apos;otherwise&apos; tags only.
+
+During execution of this tag, each &apos;when&apos; and &apos;otherwise&apos; tag is evaluated in sequence. If one of these tags evaluates to &apos;true&apos;, then any subsequent tags are ignored. A &apos;when&apos; tag evaluates to &apos;true&apos; if its &apos;test&apos; attribute&apos;s XPath expression evaluates to &apos;true&apos;. An &apos;otherwise&apos; tag evaluates to &apos;true&apos; if no preceeding &apos;when&apos; (or &apos;otherwise&apos;) tag has evaluated to true.
+ </description>
+ </containerTag>
+ <conditionalTag
+ class="org.eclipse.jet.internal.taglib.control.WhenTag"
+ deprecated="true"
+ name="case">
+ <attribute
+ name="test"
+ type="xpath"
+ use="required">
+ <description>
+ An expression expression, that, if true, causes the tag contents to be evaluated.
+ </description>
+ </attribute>
+ <description>
+ *** DEPRECATED - use &apos;when&apos; tag instead. ***
+Define a one of the mutually exclusive cases of a &apos;choose&apos; tag. The body of this tag is processed only if the &apos;test&apos; XPath expression evaluates to &apos;true&apos;, and no previous &apos;case&apos; or &apos;otherwise&apos; tag in the containing &apos;choose&apos; tag has processed its body content.
+
+If the &apos;test&apos; XPath expression is does not result in a boolean value, then it is converted to a boolean value according the the XPath 1.0 specification. In particular, if the XPath expression results in a set of objects, then &apos;test&apos; is considered to be true if and only if the set is not empty.
+
+If the &apos;test&apos; XPath expression is not well formed, then an error results.
+
+If this tag is not directly contained by a &apos;choose&apos; tag, then an error results.
+ </description>
+ </conditionalTag>
+ <conditionalTag
+ class="org.eclipse.jet.internal.taglib.control.OtherwiseTag"
+ name="otherwise">
+ <description>
+ Define a default case for a 'choose' tag. The body of this tag is processed only if no previous 'case' or 'otherwise' tag in the containing 'choose' tag has processed its body content.
+
+An error occurs if the 'otherwise' is not directly contained by a 'choose' tag.
+ </description>
+ </conditionalTag>
+ <iteratingTag
+ class="org.eclipse.jet.internal.taglib.control.VisitorTag"
+ name="visitor">
+ <attribute
+ name="select"
+ type="xpath"
+ use="required">
+ <description>
+ The XPath expression to evaluate.
+ </description>
+ </attribute>
+ <attribute
+ name="var"
+ type="string"
+ use="required">
+ <description>
+ The name of a variable that will contain the current object in the iteration.
+ </description>
+ </attribute>
+ <description>
+ *** PROTOTYPE *** Iterate over an object and all its contained objects, typically be doing a depth-first traversal. For each identified object, the tag evaluates the 'test' condition on its contained 'visit' tags. Only those tags whose test condition is true have their contents processed.
+
+If the 'select' XPath expression returns more than one object, only the first is written. If the XPath expression selects no objects, then an error occurs, unless the 'default' attribute is specified. If the 'select' XPath expression is malformed, then an error occurs.
+ </description>
+ </iteratingTag>
+ <conditionalTag
+ class="org.eclipse.jet.internal.taglib.control.VisitTag"
+ name="visit">
+ <attribute
+ name="test"
+ type="xpath"
+ use="required"/>
+ <description>
+ Define content to process for an object found by the parent 'visitor' tag, provided a condition is met. The contents of this tag are evaluated if the current object of the 'visitor' iteration satisfies the 'test' XPath expression.
+
+The 'test' XPath expression is relative to the current object of the parent 'visitor' tag. If the 'test' XPath expression is does not result in a boolean value, then it is converted to a boolean value according the the XPath 1.0 specification. In particular, if the XPath expression results in a set of objects, then 'test' is considered to be true if and only if the set is not empty.
+
+Note that more than one 'visit' tag may be executed for the same object identified by the parent 'visitor' tag.
+ </description>
+ </conditionalTag>
+ <description>
+ Control flow and data management tags. This tags allow templates to evaluate conditions, perform loops and access and set information in the template input.
+ </description>
+ <containerTag
+ class="org.eclipse.jet.internal.taglib.control.UserRegionTag"
+ name="userRegion">
+
+ <description>
+ Define a region in the generated text where users may write customized code.
+
+The tag must contain a single &apos;initialCode&apos; tag. Content before the initialCode tag is considered a &apos;begin marker&apos;, while content after it is considered an
+&apos;end marker&apos;. During execution, the existing file is searched for the begin and end markers. If found, the content of the user region tag is replaced with
+the content found in the existing file. If the markers are not found (or the file does not exist), then the markers, along with the content of the initialCode
+tag are written.
+ </description>
+ </containerTag>
+ <emptyTag
+ class="org.eclipse.jet.internal.taglib.control.IncludeTag"
+ name="include">
+
+ <description>
+ Process the referenced template, and include its results in the output of the current template.
+
+The &apos;restoreNames&apos; attribute is useful in recursive transforms. It causes the tag to save the listed variable values prior to executing the template, and then restore them after exectuion.
+ </description>
+ <attribute
+ name="template"
+ type="string"
+ use="required">
+ <description>
+ A transform project relative path to the template to execute.
+ </description>
+ </attribute>
+ <attribute
+ name="restoreNames"
+ type="string"
+ use="optional">
+ <description>
+ A comma separated list of variable names (without the $ sign).
+ </description>
+ </attribute>
+ </emptyTag>
+ <functionTag
+ class="org.eclipse.jet.internal.taglib.control.LogTag"
+ name="log">
+ <description>
+ Write a message to the transformation log. The contents of the tag are written to the log. Nothing is written the template output.
+
+The optional 'severity' attribute may have one of the following values: 'info', 'warning' or 'error'. The default is 'info'.
+ </description>
+ <attribute
+ name="severity"
+ type="string"
+ use="optional">
+ <description>
+ The message severity level. Default is 'info'.
+ </description>
+ </attribute>
+ </functionTag>
+ <containerTag
+ class="org.eclipse.jet.internal.taglib.control.InitialCodeTag"
+ name="initialCode">
+
+ <description>
+ A child tag of the 'userRegion' tag containing the initial code to write. See 'userRegion' for more information.
+ </description>
+ </containerTag>
+ <emptyTag
+ class="org.eclipse.jet.internal.taglib.control.SetVariableTag"
+ name="setVariable">
+ <description>
+ Create a variable whose value is set to the result of the provided XPath expression.
+ </description>
+ <attribute
+ name="select"
+ type="xpath"
+ use="required">
+ <description>
+ An XPath expression to creates the variable's value.
+ </description>
+ </attribute>
+ <attribute
+ name="var"
+ type="string"
+ use="required">
+ <description>
+ The name of the variable to set.
+ </description>
+ </attribute>
+ </emptyTag>
+ <emptyTag
+ class="org.eclipse.jet.internal.taglib.control.AddElementTag"
+ name="addElement">
+
+
+ <description>
+ Create a new model element under the selected node.
+ </description>
+ <attribute
+ name="select"
+ type="xpath"
+ use="required">
+ <description>
+ An XPath expression identifying the parent of the new element.
+ </description>
+ </attribute>
+ <attribute
+ name="name"
+ type="string"
+ use="required">
+ <description>
+ The name of the new element.
+ </description>
+ </attribute>
+ <attribute
+ name="var"
+ type="string"
+ use="optional">
+ <description>
+ A variable name that will refer to the newly created element.
+ </description>
+ </attribute>
+ </emptyTag>
+ <functionTag
+ class="org.eclipse.jet.internal.taglib.control.AddTextElementTag"
+ name="addTextElement">
+
+
+ <description>
+ Create a new model element node under the selected element, and whose text content is the content of this tag.
+ </description>
+ <attribute
+ name="select"
+ type="xpath"
+ use="required">
+ <description>
+ An XPath expression determining the parent of the new element.
+ </description>
+ </attribute>
+ <attribute
+ name="name"
+ type="string"
+ use="required">
+ <description>
+ The name of the new element.
+ </description>
+ </attribute>
+ <attribute
+ name="var"
+ type="string"
+ use="optional">
+ <description>
+ A variable name that will refer to the newly created element.
+ </description>
+ </attribute>
+ <attribute
+ name="cdata"
+ type="boolean"
+ use="optional">
+ <description>
+ Add the text as a CData section. Default is 'false'.
+ </description>
+ </attribute>
+ </functionTag>
+ <emptyTag
+ class="org.eclipse.jet.internal.taglib.control.RemoveElementTag"
+ name="removeElement">
+ <description>
+ Remove the selected node from the document tree.
+ </description>
+ <attribute
+ name="select"
+ type="xpath"
+ use="required">
+ <description>
+ An XPath expression determining the document to remove.
+ </description>
+ </attribute>
+ </emptyTag>
+ <emptyTag
+ class="org.eclipse.jet.internal.taglib.control.CopyElementTag"
+ name="copyElement">
+
+ <description>
+ Copy the selected node to the selected location.
+ </description>
+ <attribute
+ name="select"
+ type="xpath"
+ use="required">
+ <description>
+ An XPath expression selecting the element node to copy.
+ </description>
+ </attribute>
+ <attribute
+ name="toSelect"
+ type="xpath"
+ use="required">
+ <description>
+ An XPath expression identifying the parent of the newly selected node.
+ </description>
+ </attribute>
+ <attribute
+ name="name"
+ type="string"
+ use="required">
+ <description>
+ The name for the newly created element.
+ </description>
+ </attribute>
+ <attribute
+ name="recursive"
+ type="boolean"
+ use="optional">
+ <description>
+ Determine whether child elements of the copied element are copied, too. Default is &apos;true&apos;.
+ </description>
+ </attribute>
+ <attribute
+ name="var"
+ type="string"
+ use="optional">
+ <description>
+ The name of a variable that will be set to the newly copied element.
+ </description>
+ </attribute>
+ </emptyTag>
+ <emptyTag
+ class="org.eclipse.jet.internal.taglib.control.LoadTag"
+ name="load">
+ <description>
+ Load the referenced model, and set the passed variable to the loaded document root.
+
+The optional urlContext attribute determines how relative URL in the url attribute are resolved. Predefined constants: &apos;transform&apos;, indicating that URL is relative to the root directory of the transform; &apos;workspace&apos;, indicating the URL is relative to the current Eclipse workspace.
+
+The optional loader attribute determines which loader is used to load the model. The default loader is &apos;emf&apos;, although other loaders may have been contributed.
+ </description>
+ <attribute
+ name="url"
+ type="string"
+ use="required">
+ <description>
+ The URL of the model to load. Usually, this is a relative URL, and is interpretation is controlled by the urlContext attribute.
+ </description>
+ </attribute>
+ <attribute
+ name="var"
+ type="string"
+ use="required">
+ A variable name which will be set to the root of the loaded model.
+ <description>
+ A variable name. The root of the loaded document is set to this variable.
+ </description>
+ </attribute>
+ <attribute
+ name="urlContext"
+ type="string"
+ use="optional">
+ <description>
+ A url context constant. See tag comments for possible values. The default is 'transform'.
+ </description>
+ </attribute>
+ <attribute
+ name="loader"
+ type="string"
+ use="optional">
+ <description>
+ A constant defining the loader to use. The default is 'emf'.
+ </description>
+ </attribute>
+ <attribute
+ name="type"
+ type="string"
+ use="optional">
+ <description>
+ The type (typically the extension) of the model. That may be required if the URL does not have a standard extension.
+ </description>
+ </attribute>
+ </emptyTag>
+ <conditionalTag
+ class="org.eclipse.jet.internal.taglib.control.WhenTag"
+ name="when">
+ <description>
+ Define a one of the mutually exclusive cases of a 'choose' tag. The body of this tag is processed only if the 'test' XPath expression evaluates to 'true', and no previous 'when' or 'otherwise' tag in the containing 'choose' tag has processed its body content.
+
+If the 'test' XPath expression is does not result in a boolean value, then it is converted to a boolean value according the the XPath 1.0 specification. In particular, if the XPath expression results in a set of objects, then 'test' is considered to be true if and only if the set is not empty.
+
+If the 'test' XPath expression is not well formed, then an error results.
+
+If this tag is not directly contained by a 'choose' tag, then an error results.
+ </description>
+ <attribute
+ name="test"
+ type="xpath"
+ use="required">
+ <description>
+ An expression expression, that, if true, causes the tag contents to be evaluated.
+ </description>
+ </attribute>
+ </conditionalTag>
+ </tagLibrary>
+ <tagLibrary
+ id="workspaceTags"
+ name="Standard JET2 Workspace Tags"
+ standardPrefix="ws">
+ <containerTag
+ allowAsEmpty="true"
+ class="org.eclipse.jet.internal.taglib.workspace.ProjectTag"
+ name="project">
+ <attribute
+ name="name"
+ type="string"
+ use="required">
+ <description>
+ The name of the project.
+ </description>
+ </attribute>
+ <description>
+ Ensure the existence of an Eclipse Project of a given name. If the project does not exist, it is created. If the project is not opened, it is opened.
+
+Note that the actual creation of the workspace project is deferred until the JET2Context passed to the executing template has the 'commit' method calls. If the template is part of a JET2 transform, this occurs once all templates have executed.
+
+An error occurs of the project does not exist and cannot be created, or if the project exists, but cannot be opened.
+
+The 'project' tag may contain other tags. Contained 'folder' and 'file' tags will have relative path names iterpreted as being relative to the project defined by this tag.
+ </description>
+ </containerTag>
+ <containerTag
+ allowAsEmpty="true"
+ class="org.eclipse.jet.internal.taglib.workspace.FolderTag"
+ name="folder">
+ <attribute
+ name="path"
+ type="string"
+ use="required">
+ <description>
+ A relative path (no initial '/') or an absolute path.
+ </description>
+ </attribute>
+ <description>
+ Ensure the existence on an Eclipse Workspace Folder. If the folder does not exist, the tag attempts to create it and any containing folders. An error occurs if the folder does not exist and cannot be created.
+
+Note that the actual creation of the workspace folder is deferred until the JET2Context passed to the executing template has the 'commit' method calls. If the template is part of a JET2 transform, this occurs once all templates have executed.
+
+If the 'folder' tag is contained directly or indirectly by another 'folder' tag or by a 'project' tag AND the 'path' attribute on this tag is relative (does not start with a '/'), then the 'path' attribute is treated as relative to the containing 'folder' or 'project'.
+
+The 'folder' tag may contain other tags. Contained 'folder' and 'file' tags will have relative path names iterpreted as being relative to the folder defined by this tag.
+
+An absolute 'path' (one starting with '/') is treated as a workspace relative path. That is, the first component after the slash is interpreted as the name of an Eclipse Project, and subsequence segments are treated as folder names.
+
+When executing, this tag will cause the implicit creation of any folders containing the folder to be created. It will not implicitly create a containing workspace project.
+ </description>
+ </containerTag>
+ <emptyTag
+ class="org.eclipse.jet.internal.taglib.workspace.FileTag"
+ name="file">
+ <attribute
+ name="path"
+ type="string"
+ use="required">
+ <description>
+ A relative path (no initial '/') or an absolute path.
+ </description>
+ </attribute>
+ <attribute
+ name="template"
+ type="string"
+ use="required">
+ <description>
+ A project-relative path of a JET template to execute. The template provides the file's contents.
+ </description>
+ </attribute>
+ <attribute
+ name="encoding"
+ type="string"
+ use="optional">
+ <description>
+ The character encoding of the file. If omitted, then the Eclipse workspace determines the encoding. If provided, then the encoding is changed to the specified value. A value of '#default' restores the encoding of the file to the workspace determined default.
+ </description>
+ </attribute>
+ <attribute
+ name="replace"
+ type="boolean"
+ use="optional">
+ <description>
+ A boolean ('true' or 'false') value. If 'true', the tag will overwrite an existing file, otherwise it will not. If omitted, a value of 'true' is assumed.
+ </description>
+ </attribute>
+ <attribute
+ name="derived"
+ type="boolean"
+ use="optional">
+ <description>
+ A boolean value ('true' or 'false') determining the value of the workspace 'derived' attribute for the file. If omitted, a value of 'false' is assumed.
+ </description>
+ </attribute>
+ <description>
+ Create or write an Eclipse workspace file. If the file does not exist, the tag attempts to create it and any containing folders. An error occurs if the file does not exist and cannot be created.
+
+Note that the actual creation of the workspace file is deferred until the JET2Context passed to the executing template has the 'commit' method calls. If the template is part of a JET2 transform, this occurs once all templates have executed.
+
+If the 'file' tag is contained directly or indirectly by a 'folder' or 'project' tag AND the 'path' attribute on this tag is relative (does not start with a '/'), then the 'path' attribute is treated as relative to the containing 'folder' or 'project'.
+
+An absolute 'path' (one starting with '/') is treated as a workspace relative path. That is, the first component after the slash is interpreted as the name of an Eclipse Project, and subsequence segments are treated as folder names, with the last segment being interpreted as the file name.
+
+When executing, this tag will cause the implicit creation of any folders containing the folder to be created. It will not implicitly create a containing workspace project.
+ </description>
+ </emptyTag>
+ <description>
+ A library of tags for performing actions against the Eclipse workspace.
+ </description>
+ <emptyTag
+ class="org.eclipse.jet.internal.taglib.workspace.CopyFileTag"
+ name="copyFile">
+
+ <description>
+ Copy the file refered to by 'url' to the location refered to by 'path'.
+ </description>
+ <attribute
+ name="binary"
+ type="boolean"
+ use="optional">
+ <description>
+ Indicates whether the copy is binary or text base. Possible values: 'true' or 'false'. Default: 'false'.
+ </description>
+ </attribute>
+ <attribute
+ name="replace"
+ type="boolean"
+ use="optional">
+ <description>
+ Indicates if any existing version of the file should be replaced. Possible values: 'true' or 'false'. Default: 'true'.
+ </description>
+ </attribute>
+ <attribute
+ name="srcEncoding"
+ type="string"
+ use="optional">
+ <description>
+ Defines the default text encoding of the source file. This is only meaningful if the 'binary' attribute is not 'false'. Default is the platform default text encoding.
+ </description>
+ </attribute>
+ <attribute
+ name="targetEncoding"
+ type="string"
+ use="optional">
+ <description>
+ Identifies the text encoding to use when writing the target file. This is only meaningful if the 'binary' attribute is not 'true'. The default text encoding is determined by the platform.
+ </description>
+ </attribute>
+ <attribute
+ name="src"
+ type="string"
+ use="required">
+ <description>
+ An absolute or relative URL identifying the file to copy. If a relative URL, the 'srcContext' attribute controls resolution of the URL.
+ </description>
+ </attribute>
+ <attribute
+ name="srcContext"
+ type="string"
+ use="optional">
+ <description>
+ Determines the context of relative URL in the 'src' attribute. Default value is 'transform'. Possible values: 'transform', 'workspace'.
+ </description>
+ </attribute>
+ <attribute
+ name="target"
+ type="string"
+ use="required">
+ <description>
+ The destination path of the resource. If relative, this is relative to any containing 'folder' or 'project' tag, otherwise, the first path element is treated as a project name.
+ </description>
+ </attribute>
+ </emptyTag>
+ </tagLibrary>
+ <tagLibrary
+ id="javaTags"
+ name="Standard JET2 Java Tags"
+ standardPrefix="java">
+ <emptyTag
+ class="org.eclipse.jet.internal.taglib.java.ImportsLocationTag"
+ name="importsLocation">
+ <attribute
+ name="package"
+ type="string"
+ use="required">
+ <description>
+ The package to which the Java code is being written.
+ </description>
+ </attribute>
+ <description>
+ Identify the location for Java import statement generation. Subsequent 'imports' tags will create appropriate Java import statements at this tag's location.
+
+This tag may occur only once in a template.
+ </description>
+ </emptyTag>
+ <emptyTag
+ class="org.eclipse.jet.internal.taglib.java.ImpliedImportTag"
+ name="impliedImport">
+ <attribute
+ name="name"
+ type="string"
+ use="required">
+ <description>
+ The name of the class (unqualified) for which there is an implicit import.
+ </description>
+ </attribute>
+ <description>
+ *** PROTOTYPE *** Record a name as being implicitly imported. This is a name that a sibling class of the one being generated by the current template.
+
+This tag must occur after the initial &apos;importsLocation&apos; tag, but before any &apos;imports&apos; tags in the template.
+ </description>
+ </emptyTag>
+ <functionTag
+ class="org.eclipse.jet.internal.taglib.java.ImportTag"
+ name="import">
+ <description>
+ Replace the enclosed content with the equivalent unqualified Java name (if possible), and ensure an appropriate Java import statement is generated.
+
+This tag must be preceded by a 'importsLocation' tag.
+
+ </description>
+ </functionTag>
+ <description>
+ Tags useful in generating Java code.
+ </description>
+ <containerTag
+ class="org.eclipse.jet.internal.taglib.java.PackageTag"
+ name="package"
+ processContents="standard">
+
+ <description>
+ Create a Java package.
+ </description>
+ <attribute
+ name="name"
+ type="string"
+ use="required">
+ <description>
+ The package name.
+ </description>
+ </attribute>
+ <attribute
+ name="srcFolder"
+ type="string"
+ use="optional">
+ <description/>
+ </attribute>
+ </containerTag>
+ <emptyTag
+ class="org.eclipse.jet.internal.taglib.java.JavaResourceTag"
+ name="resource">
+ <description>
+ Create a file within a Java package.
+ </description>
+ <attribute
+ name="name"
+ type="string"
+ use="required">
+ <description>
+ The unqualified file name.
+ </description>
+ </attribute>
+ <attribute
+ name="package"
+ type="string"
+ use="optional">
+ <description/>
+ </attribute>
+ <attribute
+ name="srcFolder"
+ type="string"
+ use="optional">
+ <description/>
+ </attribute>
+ </emptyTag>
+ <emptyTag
+ class="org.eclipse.jet.internal.taglib.java.JavaClassTag"
+ name="class">
+ <description>
+ Create a Java class with the specified name.
+ </description>
+ <attribute
+ name="name"
+ type="string"
+ use="required">
+ <description>
+ The name unqualified name of the Java class.
+ </description>
+ </attribute>
+ <attribute
+ name="package"
+ type="string"
+ use="optional">
+ <description>
+ The name of the java package. If not specified, then the name of the containing 'java:package' tag is used, otherwise, the default package is used.
+ </description>
+ </attribute>
+ <attribute
+ name="srcFolder"
+ type="string"
+ use="optional">
+ <description>
+ The a path of source folder. If a relative path, this relative to any containing 'ws:project' or 'ws:folder' tags. If absolute, it is treated as a workspace relative path. If omitted, the first source folder of the containing project is used.
+ </description>
+ </attribute>
+ </emptyTag>
+ <containerTag
+ allowAsEmpty="true"
+ class="org.eclipse.jet.internal.taglib.java.SrcFolderTag"
+ name="srcFolder"
+ processContents="standard">
+ <description>
+ Create a source folder with the specified path. If the path is relative, it is relative to any containing 'ws:folder' or 'ws:project' , or the default project (if any), if there is no such tag.
+ </description>
+ <attribute
+ name="path"
+ type="string"
+ use="required">
+ <description>
+ The path of the source folder. If this path is absolute, it is treated as a workspace relative path. Otherwise, it is relative to any containing 'ws:folder' or 'ws:project' tag, the default project (if set), or the workspace itself.
+ </description>
+ </attribute>
+ </containerTag>
+ </tagLibrary>
+ <tagLibrary
+ id="formatTags"
+ name="Standard JET2 Format Tags"
+ standardPrefix="f">
+
+ <functionTag
+ class="org.eclipse.jet.internal.taglib.format.ReplaceAllTag"
+ name="replaceAll">
+
+ <attribute
+ name="value"
+ type="string"
+ use="required">
+ <description>
+ The value to be replace, or a regular expression defining the value to replace.
+ </description>
+ </attribute>
+ <attribute
+ name="replacement"
+ type="string"
+ use="required">
+ <description>
+ The replacement text.
+ </description>
+ </attribute>
+ <attribute
+ name="regex"
+ type="boolean"
+ use="optional">
+ <description>
+ A boolean value ('true' or 'false'). If omitted, 'false' is assumed.
+ </description>
+ </attribute>
+ <description>
+ Replace all instances of a value in the tag's content with a new value.
+
+If the 'regex' attribute is supplied, and equals 'true', then 'value' is treated as a Regular Expression as defined in java.util.reg.Pattern, otherwise 'value' is treated as a literal value.
+ </description>
+ </functionTag>
+ <functionTag
+ class="org.eclipse.jet.internal.taglib.format.StripTag"
+ name="strip">
+ <description>
+ *** DEPRECATED *** Strip all whitespace from the content. This is equivalent to a &apos;replaceAll&apos; with a regular expression of &apos;\s+&apos;.
+ </description>
+ </functionTag>
+
+ <functionTag
+ class="org.eclipse.jet.internal.taglib.format.UpperCaseTag"
+ name="uc">
+ <attribute
+ name="offset"
+ use="optional">
+ <description>
+ The starting offset (0-based) of the conversion. When omitted, 0 (the start of the content to be converted) is assumed.
+ </description>
+ </attribute>
+ <attribute
+ name="length"
+ use="optional">
+ <description>
+ The number of characters to convert. When omitted, it is assumed that all characters after (and including) the starting character will be converted.
+ </description>
+ </attribute>
+ <description>
+ Convert the tag contents to upper case.
+
+If 'offset' is specified, start conversion from the specified character, otherwise, start conversion from the first character.
+
+if 'length' is specified, convert only the specified number of characters, otherwise, convert all characters from the start character on.
+ </description>
+ </functionTag> <functionTag
+ class="org.eclipse.jet.internal.taglib.format.LowerCaseTag"
+ name="lc">
+ <attribute
+ name="offset"
+ use="optional">
+ <description>
+ The starting offset (0-based) of the conversion. When omitted, 0 (the start of the content to be converted) is assumed.
+ </description>
+ </attribute>
+ <attribute
+ name="length"
+ use="optional">
+ <description>
+ The number of characters to convert. When omitted, it is assumed that all characters after (and including) the starting character will be converted.
+ </description>
+ </attribute>
+ <description>
+ Convert the tag contents to lower case.
+
+If 'offset' is specified, start conversion from the specified character, otherwise, start conversion from the first character.
+
+if 'length' is specified, convert only the specified number of characters, otherwise, convert all characters from the start character on.
+ </description>
+ </functionTag>
+ <description>
+ Standard utility tags that rewrite their content in a different format.
+ </description>
+ </tagLibrary>
+ </extension>
+ <extension
+ id="runtimeProblem"
+ name="%markers.runtimeProblem.name"
+ point="org.eclipse.core.resources.markers">
+ <super type="org.eclipse.core.resources.problemmarker"/>
+ </extension>
+ <extension
+ id="compileProblem"
+ name="%markers.compileProblem.name"
+ point="org.eclipse.core.resources.markers">
+ <super type="org.eclipse.core.resources.problemmarker"/>
+ <persistent value="true"/>
+ </extension>
+ <extension
+ point="org.eclipse.help.toc">
+ <toc
+ file="toc.xml"
+ primary="true"/>
+ <toc
+ file="toccontrolTags.xml"
+ primary="false"/>
+ <toc
+ file="tocformatTags.xml"
+ primary="false"/>
+ <toc
+ file="tocjavaTags.xml"
+ primary="false"/>
+ <toc
+ file="tocworkspaceTags.xml"
+ primary="false"/>
+ <toc
+ file="tocApiReference.xml"
+ primary="false"/>
+ <toc
+ file="tocExtensionPointiReference.xml"
+ primary="false"/>
+ <toc
+ file="tocWhatsNew.xml"
+ primary="false"/>
+ </extension>
+ <extension
+ point="org.eclipse.team.core.fileTypes">
+ <fileTypes
+ extension="jet"
+ type="text"/>
+ </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.jet/schema/deployedTransforms.exsd b/plugins/org.eclipse.jet/schema/deployedTransforms.exsd
new file mode 100644
index 0000000..8a2257e
--- /dev/null
+++ b/plugins/org.eclipse.jet/schema/deployedTransforms.exsd
@@ -0,0 +1,124 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.jet2">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.emf.jet2" id="deployedTransforms" name="Deployed Transformations"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence>
+ <element ref="deployedTransform" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="deployedTransform">
+ <annotation>
+ <appInfo>
+ <meta.element labelAttribute=""/>
+ </appInfo>
+ </annotation>
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="bundle" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="resource"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="private" type="boolean" use="default" value="false">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/plugins/org.eclipse.jet/schema/tagLibraries.exsd b/plugins/org.eclipse.jet/schema/tagLibraries.exsd
new file mode 100644
index 0000000..9b6e172
--- /dev/null
+++ b/plugins/org.eclipse.jet/schema/tagLibraries.exsd
@@ -0,0 +1,480 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.jet2">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.emf.jet2" id="tabLibraries" name="Tag Libraries"/>
+ </appInfo>
+ <documentation>
+ Defines JET tag libraries.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence>
+ <element ref="tagLibrary" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="tagLibrary">
+ <annotation>
+ <documentation>
+ Declares a tag library. That is, a collection of related JET2 tags.
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <choice>
+ <element ref="otherTag"/>
+ <element ref="functionTag"/>
+ <element ref="iteratingTag"/>
+ <element ref="conditionalTag"/>
+ <element ref="emptyTag"/>
+ <element ref="containerTag"/>
+ </choice>
+ <element ref="description" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ A unique name, within this plug-in for the library. For API purposes, the tag library id will be the concatenation of the plug-in id, a period (&apos;.&apos;) and this value.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ A short, descriptive name of the purpose of the tags in the library.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="standardPrefix" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="deprecated" type="boolean">
+ <annotation>
+ <documentation>
+ If set to &apos;true&apos;, indicates that use of the tag library is discourage.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="otherTag">
+ <annotation>
+ <appInfo>
+ <meta.element deprecated="true"/>
+ </appInfo>
+ <documentation>
+ The use of this element is discourage. Use this tag only if functionTag, iteratingTag, conditionalTag and emptyTag do not meet your requirements.
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="attribute" minOccurs="1" maxOccurs="unbounded"/>
+ <element ref="description" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.emf.jet2.taglib.AbstractOtherTag"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="deprecated" type="boolean">
+ <annotation>
+ <documentation>
+ If set to &apos;true&apos;, indicates that use of the tag is discourage.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="functionTag">
+ <annotation>
+ <documentation>
+ Define a tag that writes a value to the template output which is calculated from the elements content and any attribute values. Function tags require content in order to create output. An empty function tag, for example &amp;lt;myFunction/&amp;gt; will produce no output.
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="attribute" minOccurs="1" maxOccurs="unbounded"/>
+ <element ref="description" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.emf.jet2.taglib.AbstractFunctionTag"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="deprecated" type="boolean">
+ <annotation>
+ <documentation>
+ If set to &apos;true&apos;, indicates that use of the tag is discourage.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="iteratingTag">
+ <annotation>
+ <documentation>
+ Define a tag that causes repeated evaluation of its contents based on its attribute values.
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="attribute" minOccurs="1" maxOccurs="unbounded"/>
+ <element ref="description" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.emf.jet2.taglib.AbstractIteratingTag"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="deprecated" type="boolean">
+ <annotation>
+ <documentation>
+ If set to &apos;true&apos;, indicates that use of the tag is discourage.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="processContents" use="default" value="standard">
+ <annotation>
+ <documentation>
+ When set to &apos;custom&apos;, the tag handler is passed its processed contents, and is responsible for handling it appropriately. Otherwise, the enclosing template handles the contents automatically on the tag handler&apos;s behalf. The default is &apos;standard&apos;.
+ </documentation>
+ </annotation>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="custom">
+ </enumeration>
+ <enumeration value="standard">
+ </enumeration>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="conditionalTag">
+ <annotation>
+ <documentation>
+ Define a tag that conditionally writes its contents to the output depending on some calculation.
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="attribute" minOccurs="1" maxOccurs="unbounded"/>
+ <element ref="description" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.emf.jet2.taglib.AbstractConditionalTag"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="deprecated" type="boolean">
+ <annotation>
+ <documentation>
+ If set to &apos;true&apos;, indicates that use of the tag is discourage.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="processContents" use="default" value="standard">
+ <annotation>
+ <documentation>
+ When set to &apos;custom&apos;, the tag handler is passed its processed contents, and is responsible for handling it appropriately. Otherwise, the enclosing template handles the contents automatically on the tag handler&apos;s behalf. The default is &apos;standard&apos;.
+ </documentation>
+ </annotation>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="custom">
+ </enumeration>
+ <enumeration value="standard">
+ </enumeration>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="emptyTag">
+ <annotation>
+ <documentation>
+ Define a tag creates output or causes actions based on its context and attribute values only. An empty tag may have no content, and must be of the form &amp;lt;myEmptyTag ... /&amp;gt;
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="attribute" minOccurs="1" maxOccurs="unbounded"/>
+ <element ref="description" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.emf.jet2.taglib.AbstractEmptyTag"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="deprecated" type="boolean">
+ <annotation>
+ <documentation>
+ If set to &apos;true&apos;, indicates that use of the tag is discourage.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="attribute">
+ <complexType>
+ <sequence>
+ <element ref="description" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="use" use="default" value="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="required">
+ </enumeration>
+ <enumeration value="optional">
+ </enumeration>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="deprecated" type="boolean">
+ <annotation>
+ <documentation>
+ If set to &apos;true&apos;, indicates that use of the attribute is discourage.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="type" use="default" value="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="string">
+ </enumeration>
+ <enumeration value="boolean">
+ </enumeration>
+ <enumeration value="xpath">
+ </enumeration>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="containerTag">
+ <complexType>
+ <sequence>
+ <element ref="attribute" minOccurs="1" maxOccurs="unbounded"/>
+ <element ref="description" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.emf.jet2.taglib.AbstractContainerTag"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="deprecated" type="boolean">
+ <annotation>
+ <documentation>
+ If set to &apos;true&apos;, indicates that use of the tag is discourage.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="processContents" use="default" value="standard">
+ <annotation>
+ <documentation>
+ When set to &apos;custom&apos;, the tag handler is passed its processed contents, and is responsible for handling it appropriately. Otherwise, the enclosing template handles the contents automatically on the tag handler&apos;s behalf. The default is &apos;standard&apos;.
+ </documentation>
+ </annotation>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="standard">
+ </enumeration>
+ <enumeration value="custom">
+ </enumeration>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="allowAsEmpty" type="boolean">
+ <annotation>
+ <documentation>
+ Determines if the container can be expressed as an empty xml tag of the form &amp;lt;tag/&amp;gt;. The empty tag form
+is permitted if &lt;code&gt;true&lt;/code&gt; is specified. If not specified, then &lt;code&gt;false&lt;/code&gt; is assumed.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="description" type="string">
+ <annotation>
+ <appInfo>
+ <meta.element translatable="true"/>
+ </appInfo>
+ </annotation>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 1.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/plugins/org.eclipse.jet/schema/transform.exsd b/plugins/org.eclipse.jet/schema/transform.exsd
new file mode 100644
index 0000000..4bdf32d
--- /dev/null
+++ b/plugins/org.eclipse.jet/schema/transform.exsd
@@ -0,0 +1,195 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.jet2">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.emf.jet2" id="transform" name="JET2 Transform"/>
+ </appInfo>
+ <documentation>
+ Declares that the extending plugin is a JET2 transform.
+&lt;p&gt;
+&lt;b&gt;This extension point is not intended to be used directly by clients.&lt;/b&gt;
+ </documentation>
+ </annotation>
+
+ <include schemaLocation="schema://org.eclipse.core.expressions/schema/expressionLanguage.exsd"/>
+
+ <element name="extension">
+ <complexType>
+ <sequence>
+ <element ref="transform"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="transform">
+ <annotation>
+ <documentation>
+ Declares transformation access details. For JET2 Transform projects, there is exactly one of these.
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="description"/>
+ <element ref="tagLibraries"/>
+ <element ref="enablement" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ <attribute name="startTemplate" type="string" use="required">
+ <annotation>
+ <documentation>
+ The project relative path to the start template. Typically: template/control.jet
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="resource"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="templateLoaderClass" type="string" use="required">
+ <annotation>
+ <documentation>
+ The fully qualified Java class name of the template loader class.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.emf.internal.jet2.runtime.IJET2Transformation"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="modelLoader" type="string">
+ <annotation>
+ <documentation>
+ A reference to the id of the model loader to use when loading Eclipse resources. If not specified, &apos;emf&apos; is used.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="overrides" type="string">
+ <annotation>
+ <documentation>
+ The id of a JET2 transform that this transform overrides. If not specified, the transform does not override another transform.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="tagLibraries">
+ <annotation>
+ <documentation>
+ Declares tag libraries that may be used by the transform&apos;s templates.
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="importLibrary" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="importLibrary">
+ <annotation>
+ <documentation>
+ References an JET2 tag library.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ The tag library id. Example: org.eclipse.emf.jet2.controlTags
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="usePrefix" type="string" use="required">
+ <annotation>
+ <documentation>
+ The prefix to use for the tag library when the tag library is auto imported into the project&apos;s templates.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="autoImport" type="boolean" use="required">
+ <annotation>
+ <documentation>
+ Indicates whether the project&apos;s templates should implicitly import the tags in this library.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="description" type="string">
+ <annotation>
+ <documentation>
+ A textual description of the transform.
+ </documentation>
+ </annotation>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 1.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/plugins/org.eclipse.jet/schema/xpathFunctions.exsd b/plugins/org.eclipse.jet/schema/xpathFunctions.exsd
new file mode 100644
index 0000000..04a9c25
--- /dev/null
+++ b/plugins/org.eclipse.jet/schema/xpathFunctions.exsd
@@ -0,0 +1,126 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.jet2">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.emf.jet2" id="xpathFunctions" name="XPath Custom Fucntions"/>
+ </appInfo>
+ <documentation>
+ Declare custom XPath functions that will be available during JET XPath execution.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence>
+ <element ref="function" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="function">
+ <complexType>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ The name of the XPath function, as it will be called in an XPath expression. This must be an NCName.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="implementation" type="string">
+ <annotation>
+ <documentation>
+ The Java class that implements the function.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.emf.jet2.xpath.XPathFunction"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="minArgs" type="string" use="required">
+ <annotation>
+ <documentation>
+ The minimum number of arguments the function will accept. Must be a an integer greater than or equal to zero (0).
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="maxArgs" type="string" use="required">
+ <annotation>
+ <documentation>
+ The maximum number of arguments the function will accept, or -1, if the function will accept an unlimited number of arguments.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/AbstractContextExtender.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/AbstractContextExtender.java
new file mode 100644
index 0000000..8503284
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/AbstractContextExtender.java
@@ -0,0 +1,64 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet;
+
+
+/**
+ * A base class for extending the JET2 context.
+ *
+ */
+public abstract class AbstractContextExtender
+{
+
+ private final JET2Context baseContext;
+
+ /**
+ *
+ */
+ protected AbstractContextExtender(JET2Context context)
+ {
+ super();
+ this.baseContext = context;
+ if (!context.hasContextExtender(this.getClass()))
+ {
+ context.registerContextExtender(this.getClass(), createExtendedData(context));
+ }
+ }
+
+ /**
+ * Called by the AbstractContextExtender constructor if the extender's data
+ * has not yet been created in the context.
+ * @param context the context in which the data will be created.
+ * @return the extension data object.
+ */
+ protected abstract Object createExtendedData(JET2Context context);
+
+ protected Object getExtendedData()
+ {
+ return baseContext.getContextExtenderData(this.getClass());
+ }
+
+ /**
+ * Return the JET2Context that this extender instance is extending.
+ * @return the hosting context.
+ */
+ public final JET2Context getContext()
+ {
+ return baseContext;
+ }
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/BodyContentWriter.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/BodyContentWriter.java
new file mode 100644
index 0000000..18e4f18
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/BodyContentWriter.java
@@ -0,0 +1,283 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet;
+
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.jet.internal.InternalJET2Platform;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.BadPositionCategoryException;
+import org.eclipse.jface.text.DefaultPositionUpdater;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IPositionUpdater;
+import org.eclipse.jface.text.Position;
+
+
+/**
+ * Standard implementation of JET2Writer
+ *
+ */
+public class BodyContentWriter implements JET2Writer
+{
+
+ // private StringBuffer buffer = new StringBuffer();
+ private final BodyContentWriter parentWriter;
+
+ private final IDocument document = new Document();
+
+ private final Map listeners;
+
+ /**
+ *
+ */
+ public BodyContentWriter()
+ {
+ super();
+ parentWriter = null;
+ listeners = new HashMap(5);
+ }
+
+ /**
+ * Create a nested writer with the passed writer as the parent writer.
+ * @param parentWriter the parent writer
+ */
+ private BodyContentWriter(BodyContentWriter parentWriter)
+ {
+ this.parentWriter = parentWriter;
+ listeners = Collections.EMPTY_MAP; // don't record listeners on child writers...
+ }
+
+ /**
+ * @see org.eclipse.jet.JET2Writer#write(java.lang.String)
+ */
+ public final void write(String string)
+ {
+ try
+ {
+ document.replace(document.getLength(), 0, string);
+ }
+ catch (BadLocationException e)
+ {
+ // this should not happen. Log the error.
+ InternalJET2Platform.logError("Internal Error", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @see org.eclipse.jet.JET2Writer#write(org.eclipse.jet.JET2Writer)
+ */
+ public final void write(JET2Writer bodyContent)
+ {
+ int positionDelta = document.getLength();
+ write(bodyContent.toString());
+ try
+ {
+ // transfer position categories, position updaters and positions
+ IDocument childDocument = bodyContent.getDocument();
+
+ IPositionUpdater[] positionUpdaters = childDocument.getPositionUpdaters();
+ for (int i = 0; i < positionUpdaters.length; i++)
+ {
+ document.addPositionUpdater(positionUpdaters[i]);
+ }
+
+ String categories[] = childDocument.getPositionCategories();
+ for (int i = 0; i < categories.length; i++)
+ {
+ // ensure 'document' has the category - no harm in doing this if the category is already there
+ document.addPositionCategory(categories[i]);
+ Position[] positions = childDocument.getPositions(categories[i]);
+ for (int j = 0; j < positions.length; j++)
+ {
+ childDocument.removePosition(categories[i], positions[j]);
+ positions[j].setOffset(positions[j].getOffset() + positionDelta);
+ document.addPosition(categories[i], positions[j]);
+ }
+ }
+ }
+ catch (BadPositionCategoryException e)
+ {
+ // this exception should not occur in this circumstance. We are getting categories
+ // from the document we are applying them against, so we should never encounter problems.
+ InternalJET2Platform.logError("Internal Error", e); //$NON-NLS-1$
+ }
+ catch (BadLocationException e)
+ {
+ // this exception should not occur in this circumstance. If we are creating invalid positions
+ // then this is a sign of programming errors.
+ InternalJET2Platform.logError("Internal Error", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @see org.eclipse.jet.JET2Writer#write(int)
+ */
+ public final void write(int i)
+ {
+ write(String.valueOf(i));
+ }
+
+ /**
+ * @see java.lang.Object#toString()
+ */
+ public String toString()
+ {
+ return document.get();
+ }
+
+ public final JET2Writer newNestedContentWriter()
+ {
+ return new BodyContentWriter(this);
+ }
+
+ public final int getLength()
+ {
+ return document.getLength();
+ }
+
+ public final IDocument getDocument()
+ {
+ return document;
+ }
+
+ public final void addEventListener(String category, IWriterListener listener)
+ {
+ if (parentWriter != null)
+ {
+ parentWriter.addEventListener(category, listener);
+ }
+ else if (!listeners.containsKey(category))
+ {
+ listeners.put(category, listener);
+ }
+ }
+
+ public final void finalizeContent(Object file)
+ {
+ for (Iterator i = listeners.values().iterator(); i.hasNext();)
+ {
+ IWriterListener listener = (IWriterListener)i.next();
+ listener.finalizeContent(this, file);
+ }
+ }
+
+ public final void contentCommitted(Object committedObject)
+ {
+ for (Iterator i = listeners.values().iterator(); i.hasNext();)
+ {
+ IWriterListener listener = (IWriterListener)i.next();
+ listener.postCommitContent(this, committedObject);
+ }
+ }
+
+ public final void addPositionCategory(String category)
+ {
+ if (!document.containsPositionCategory(category))
+ {
+ document.addPositionCategory(category);
+ document.addPositionUpdater(new DefaultPositionUpdater(category));
+ }
+ }
+
+ public final void addPosition(String category, Position position)
+ {
+ try
+ {
+ document.addPosition(category, position);
+ }
+ catch (BadLocationException e)
+ {
+ throw new WriterPositionException(e);
+ }
+ catch (BadPositionCategoryException e)
+ {
+ throw new WriterPositionException(e);
+ }
+
+ }
+
+ public final Position[] getPositions(String category)
+ {
+ try
+ {
+ return document.getPositions(category);
+ }
+ catch (BadPositionCategoryException e)
+ {
+ throw new WriterPositionException(e);
+ }
+ }
+
+ public final void replace(int offset, int length, String text)
+ {
+ try
+ {
+ document.replace(offset, length, text);
+ }
+ catch (BadLocationException e)
+ {
+ throw new WriterPositionException(e);
+ }
+ }
+
+ public final JET2Writer getParentWriter()
+ {
+ return parentWriter;
+ }
+
+ public final void write(boolean b)
+ {
+ write(String.valueOf(b));
+ }
+
+ public final void write(char c)
+ {
+ write(String.valueOf(c));
+ }
+
+ public final void write(char[] data)
+ {
+ write(String.valueOf(data));
+ }
+
+ public final void write(double d)
+ {
+ write(String.valueOf(d));
+ }
+
+ public final void write(float f)
+ {
+ write(String.valueOf(f));
+ }
+
+ public final void write(long l)
+ {
+ write(String.valueOf(l));
+ }
+
+ public final void write(Object obj)
+ {
+ write(obj != null ? obj.toString() : ""); //$NON-NLS-1$
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/IWriterListener.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/IWriterListener.java
new file mode 100644
index 0000000..d4b3757
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/IWriterListener.java
@@ -0,0 +1,46 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet;
+
+
+/**
+ * Callback interface allowing participation in the finalization of a {@link JET2Writer}'s content.
+ *
+ */
+public interface IWriterListener
+{
+
+ /**
+ * Perform any finalization of the content in the writer.
+ * @param writer the writer in the process of being finalized
+ * @param file a handle to object to which the content will ultimately be written. The standard
+ * JET2 Workspace tags pass an org.eclipse.core.resources.IFile, but other tags may pass objects
+ * of other types.
+ */
+ public abstract void finalizeContent(JET2Writer writer, Object file);
+
+ /**
+ * Perform any post processing on the committed file based on content written.
+ * @param writer the writer that provided the committed content.
+ * @param file a handle to the object containing the comitted content. The standard
+ * JET2 Workspace tags pass an org.eclipse.core.resources.IFile, but other tags may pass objects
+ * of other types.
+ */
+ public abstract void postCommitContent(JET2Writer writer, Object file);
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Context.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Context.java
new file mode 100644
index 0000000..49c11b2
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Context.java
@@ -0,0 +1,370 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet;
+
+
+import java.text.MessageFormat;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.jet.internal.l10n.JET2Messages;
+import org.eclipse.jet.internal.runtime.JET2TemplateStatus;
+import org.eclipse.jet.taglib.JET2TagException;
+import org.eclipse.jet.taglib.TagFactory;
+import org.eclipse.jet.taglib.TagInfo;
+import org.eclipse.jet.transform.TransformContextExtender;
+
+
+/**
+ * Define the execution context for a JET2 transform or template.
+ *
+ */
+public final class JET2Context
+{
+
+ private Object source;
+
+ private BasicDiagnostic stati = new BasicDiagnostic("", Diagnostic.OK, "", null); //$NON-NLS-1$//$NON-NLS-2$
+
+ private final Map extendedContextData = new HashMap();
+
+ private TagFactory tagFactory = null;
+
+ /**
+ * Transitional item while refactoring JET2Context into TransformContextExtender.
+ */
+ private TransformContextExtender tce = null;
+
+ private final Map globalVariables = new HashMap();
+
+ /**
+ * Create a JET2 context with the specified source argument and the specified variables.
+ * @param source the source object
+ * @param variables A map <String,Object> of variable names to the object values.
+ */
+ public JET2Context(Object source, Map variables)
+ {
+ this.source = source;
+ globalVariables.putAll(variables);
+ }
+
+ /**
+ * Create a JET2 context with the specified source argument and no variables.
+ * <p>
+ * This is exactly equivalent to:
+ * <pre>
+ * JET2Context(source, Collections.EMPTY_MAP)
+ * </pre>
+ * @param source the source object
+ */
+ public JET2Context(Object source)
+ {
+ this(source, Collections.EMPTY_MAP);
+ }
+
+ private TransformContextExtender getTCE()
+ {
+ if (tce == null)
+ {
+ tce = new TransformContextExtender(this);
+ }
+ return tce;
+ }
+
+ /**
+ * Set the source object for the transformation
+ *
+ * @param source
+ */
+ public void setSource(Object source)
+ {
+ this.source = source;
+ }
+
+ /**
+ * Return the source object for the transformation.
+ *
+ * @return the source object
+ */
+ public Object getSource()
+ {
+ return source;
+ }
+
+ /**
+ * @param severity
+ * @param templatePath TODO
+ * @param tagInfo
+ * @param throwable
+ */
+ private void log(int severity, String templatePath, TagInfo tagInfo, String message, Throwable throwable)
+ {
+ if ((message == null || message.length() == 0) && throwable != null)
+ {
+ message = throwable.getLocalizedMessage();
+ if (message == null || message.length() == 0)
+ {
+ message = throwable.toString();
+ }
+ }
+ JET2TemplateStatus status = new JET2TemplateStatus(severity, getTCE().getId(),
+ message == null ? "" : message, //$NON-NLS-1$
+ templatePath,
+ tagInfo,
+ throwable);
+ stati.add(status);
+ }
+
+ // private void log(ExecutionLogEntry entry) {
+ // executionLog.add(entry);
+ // }
+
+ /**
+ * Log an informational message
+ *
+ * @param message
+ */
+ // Used once: LogTag.doFunction()
+ public void logInfo(String message)
+ {
+ log(Diagnostic.INFO, getTCE().getTemplatePath(), null, message, (Throwable)null);
+ }
+
+ /**
+ * Log a warning message
+ *
+ * @param message
+ */
+ // Used once: LogTag.doFunction()
+ public void logWarning(String message)
+ {
+ log(Diagnostic.WARNING, getTCE().getTemplatePath(), null, message, (Throwable)null);
+ }
+
+ /**
+ * Log an error message
+ *
+ * @param message
+ */
+ // Used once: LogTag.doFunction()
+ public void logError(String message)
+ {
+ log(Diagnostic.ERROR, getTCE().getTemplatePath(), null, message, null);
+ }
+
+ /**
+ * Log an exeception that occurred during execution
+ *
+ * @param e
+ */
+ // Used once: TransformContextExtender.commit()
+ public void logError(Throwable e)
+ {
+ log(Diagnostic.ERROR, getTCE().getTemplatePath(), null, null, e);
+ }
+
+ /**
+ * Log an exception that occured during execution, along with a message.
+ *
+ * @param message
+ * @param e
+ * @deprecated Please don't use, will be removed...
+ */
+ // Never used!
+ public void logError(String message, Throwable e)
+ {
+ log(Diagnostic.ERROR, getTCE().getTemplatePath(), null, message, e);
+ }
+
+ /**
+ * Return all logged messages for the transformation as a multi-status
+ * IStatus object.
+ *
+ * @return the transformation log, as an IStatus
+ */
+// public IStatus getLogAsMultiStatus()
+ public Diagnostic getLogAsMultiStatus()
+ {
+ String message = ""; //$NON-NLS-1$
+
+ int worstSeverity = stati.recomputeSeverity();;
+ if (worstSeverity == Diagnostic.OK)
+ {
+ message = JET2Messages.JET2Context_SuccessfulExecution;
+ }
+ else if (worstSeverity == Diagnostic.INFO)
+ {
+ message = JET2Messages.JET2Context_SuccessfulWithMessages;
+ }
+ else if (worstSeverity == Diagnostic.WARNING)
+ {
+ message = JET2Messages.JET2Context_SuccessfulWithWarnings;
+ }
+ else if (worstSeverity == Diagnostic.ERROR)
+ {
+ message = JET2Messages.JET2Context_ErrorsInExecution;
+ }
+ BasicDiagnostic summary = new BasicDiagnostic(JET2Platform.PLUGIN_ID, 0, stati.getChildren(), message, null);
+ summary.recomputeSeverity();
+// return BasicDiagnostic.toIStatus(summary);
+ return summary;
+
+ }
+
+ /**
+ * Log an error from the specified tag.
+ * @param tagInfo
+ * @param message the error message to display, or <code>null</code>
+ * @param exception
+ */
+ // Used 3 times: TagSafeRunnable.handleException() x 2, tagFactoryImpl.createTagElement(),
+ public void logError(TagInfo tagInfo, String message, Throwable exception)
+ {
+ log(Diagnostic.ERROR, getTCE().getTemplatePath(), tagInfo, message, exception);
+ }
+
+ private String getContextExtenderId(Class clazz)
+ {
+ return clazz.getName();
+ }
+
+ /**
+ * Test whether the context has an extender of the pass class.
+ * @param extenderClass the extender class
+ * @return <code>true</code> if the context has a registered extender of the passed class.
+ */
+ public boolean hasContextExtender(Class extenderClass)
+ {
+ return extendedContextData.containsKey(getContextExtenderId(extenderClass));
+ }
+
+ /**
+ * Register a context extender class and its data.
+ * <P>
+ * This method is not normally called by clients.
+ * It is intended for use by {@link AbstractContextExtender#AbstractContextExtender(JET2Context)}.
+ * </P>
+ * @param extenderClass the extender class
+ * @param extenderData the data to be associated with the class
+ * @throws IllegalStateException if <code>extenderClass</code> has already been registered on this context.
+ */
+ void registerContextExtender(Class extenderClass, Object extenderData)
+ {
+ String extenderId = getContextExtenderId(extenderClass);
+ if (extendedContextData.containsKey(extenderClass))
+ {
+ throw new IllegalStateException(extenderId + "already registered"); //$NON-NLS-1$
+ }
+
+ extendedContextData.put(extenderId, extenderData);
+ }
+
+ /**
+ * Return the context extension data for the passed class, or null if the extender class
+ * has no associated data, or if <code>extenderClass</code> is not registered on the context.
+ * <P>
+ * This method is not normally called by clients.
+ * It is intended for use by {@link AbstractContextExtender#getExtendedData()}.
+ * </P>
+ * @param extenderClass the context extender class.
+ * @return the associated data or <code>null</code>.
+ */
+ Object getContextExtenderData(Class extenderClass)
+ {
+ return extendedContextData.get(getContextExtenderId(extenderClass));
+ }
+
+ /**
+ * Log an error on the pass template
+ * @param templatePath
+ * @param tagInfo
+ * @param message
+ * @param e
+ */
+ // Used once: WorkspaceContextExtender.ContextData.commit()
+ public void logError(String templatePath, TagInfo tagInfo, String message, CoreException e)
+ {
+ log(Diagnostic.ERROR, templatePath, tagInfo, message, e);
+
+ }
+
+ /**
+ * Assigne or create a variable, and set its value.
+ * @param var the variable name. Cannot be <code>null</code>.
+ * @param value the variable value.
+ */
+ public void setVariable(String var, Object value)
+ {
+ globalVariables.put(var, value);
+ }
+
+ /**
+ * Return the value of a context variable
+ * @param var the variable name
+ * @return the value of the variable
+ * @throws JET2TagException if the variable does not exist.
+ */
+ public Object getVariable(String var) throws JET2TagException
+ {
+ if (!hasVariable(var))
+ {
+ String msg = JET2Messages.JET2Context_VariableNotFound;
+ throw new JET2TagException(MessageFormat.format(msg, new Object []{ var }));
+ }
+ return globalVariables.get(var);
+ }
+
+ /**
+ * Remove a variable
+ * @param var the variable name
+ */
+ public void removeVariable(String var) throws JET2TagException
+ {
+ globalVariables.remove(var);
+ }
+
+ /**
+ * Test whether a variable is defined
+ * @param var the variable name
+ * @return <code>true</code> if defined, <code>false</code> otherwise.
+ */
+ public boolean hasVariable(String var)
+ {
+ return globalVariables.containsKey(var);
+ }
+
+ /**
+ * @return the tagFactory
+ */
+ public final TagFactory getTagFactory()
+ {
+ return tagFactory;
+ }
+
+ /**
+ * @param tagFactory the tagFactory to set
+ */
+ public final void setTagFactory(TagFactory tagFactory)
+ {
+ this.tagFactory = tagFactory;
+ }
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Platform.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Platform.java
new file mode 100644
index 0000000..31595dc
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Platform.java
@@ -0,0 +1,334 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet;
+
+
+import java.io.IOException;
+import java.net.URL;
+import java.text.MessageFormat;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.jet.compiler.JET2Compiler;
+import org.eclipse.jet.internal.InternalJET2Platform;
+import org.eclipse.jet.internal.l10n.JET2Messages;
+import org.eclipse.jet.internal.runtime.IJET2Runnable;
+import org.eclipse.jet.internal.runtime.IJET2TemplateBundleDescriptor;
+import org.eclipse.jet.internal.runtime.JET2TemplateStatus;
+import org.eclipse.jet.internal.runtime.ProjectTemplateBundleDescriptor;
+import org.eclipse.jet.internal.runtime.RuntimeLoggerContextExtender;
+import org.eclipse.jet.internal.runtime.RuntimeTagLogger;
+import org.eclipse.jet.internal.runtime.model.EMFModelLoader;
+import org.eclipse.jet.runtime.model.IModelLoader;
+import org.eclipse.jet.taglib.JET2TagException;
+import org.eclipse.jet.taglib.TagInfo;
+import org.eclipse.jet.taglib.workspace.WorkspaceContextExtender;
+import org.eclipse.jet.transform.IJETBundle;
+import org.eclipse.jet.transform.TransformContextExtender;
+
+
+/**
+ * Access point for JET2 functionality.
+ *
+ */
+public class JET2Platform
+{
+
+ private static boolean DEBUG = InternalJET2Platform.getDefault().isDebugging()
+ && Boolean.valueOf(Platform.getDebugOption("org.eclipse.jet/debug/traceTagExecution")).booleanValue(); //$NON-NLS-1$
+
+ // place option constants here...
+ /**
+ * The Plugin identifier of the JET2 core plugin, "org.eclipse.jet".
+ */
+ public static final String PLUGIN_ID = "org.eclipse.jet"; //$NON-NLS-1$
+
+ /**
+ * The Project nature assigned to JET2 Transformation projects, "org.eclipse.jet.jet2Nature"
+ */
+ public static final String JET2_NATURE_ID = JET2Platform.PLUGIN_ID + "." + "jet2Nature"; //$NON-NLS-1$ //$NON-NLS-2$
+
+ /**
+ *
+ */
+ private JET2Platform()
+ {
+ super();
+ }
+
+ public static IStatus execute(final String id, final String source, final String kind, final IProgressMonitor monitor)
+ {
+ IStatus result = Status.OK_STATUS;
+
+ // TODO Dynamically determine the loader.
+ IModelLoader modelLoader = new EMFModelLoader();
+ try
+ {
+ Object objectSource = modelLoader.loadFromString(source, kind);
+ result = internalExecute(new JET2Context(objectSource), id, objectSource, monitor);
+ }
+ catch (IOException e)
+ {
+ result = InternalJET2Platform.newStatus(IStatus.ERROR, JET2Messages.JET2Platform_CouldNotParseString, e);
+ }
+
+ return result;
+ }
+
+ public static IStatus execute(final String id, final String source, final IProgressMonitor monitor)
+ {
+ return execute(id, source, null, monitor);
+ }
+
+ public static IStatus execute(final String id, final IResource resource, final IProgressMonitor monitor)
+ {
+ Object objectSource = resource;
+ IModelLoader modelLoader = new EMFModelLoader();
+ try
+ {
+ objectSource = modelLoader.load(new URL("platform:/resource/" + resource.getFullPath().toString())); //$NON-NLS-1$
+ final JET2Context context = new JET2Context(objectSource);
+ WorkspaceContextExtender wsExtender = new WorkspaceContextExtender(context);
+ wsExtender.pushContainer(resource.getParent());
+
+ return internalExecute(context, id, objectSource, monitor);
+ }
+ catch (IOException e)
+ {
+ // didn't work.
+ return new Status(IStatus.ERROR, id, IStatus.OK, e.getLocalizedMessage(), e);
+ }
+ }
+
+ /**
+ * Execute a JET2 transformation
+ * @param id
+ * @param source
+ * @param monitor
+ * @return the execution status
+ */
+ public static IStatus execute(final String id, final Object source, final IProgressMonitor monitor)
+ {
+ final JET2Context context = new JET2Context(source);
+ return internalExecute(context, id, source, monitor);
+ }
+
+ /**
+ * @param context
+ * @param id
+ * @param source
+ * @param monitor
+ * @return
+ */
+ private static IStatus internalExecute(final JET2Context context, final String id, final Object source, final IProgressMonitor monitor)
+ {
+ IStatus result;
+ monitor.beginTask(JET2Messages.JET2Platform_Executing + id, 100);
+ try
+ {
+ IJET2TemplateBundleDescriptor descriptor = InternalJET2Platform.getDefault().getTemplateBundleDescriptor(id);
+ if (descriptor instanceof ProjectTemplateBundleDescriptor)
+ {
+ ((ProjectTemplateBundleDescriptor)descriptor).getProject().deleteMarkers(
+ JET2Compiler.RUNTIME_PROBLEM_MARKER,
+ true,
+ IResource.DEPTH_INFINITE);
+ }
+ if (descriptor == null)
+ {
+ final String msg = MessageFormat.format(JET2Messages.JET2Platform_TransformNotFound, new Object []{ id });
+ result = InternalJET2Platform.newStatus(IStatus.ERROR, msg, null);
+ InternalJET2Platform.log(result);
+ return result;
+ }
+ monitor.subTask(JET2Messages.JET2Platform_RetrievingBundle);
+ final IJETBundle templateBundle = InternalJET2Platform.getDefault().getTemplateBundle(id, new SubProgressMonitor(monitor, 10));
+
+ final TransformContextExtender tce = new TransformContextExtender(context);
+ tce.setId(id);
+ tce.setTransform(templateBundle);
+
+ if (DEBUG)
+ {
+ RuntimeLoggerContextExtender rl = new RuntimeLoggerContextExtender(context);
+ rl.addListener(new RuntimeTagLogger()
+ {
+
+ public void log(String message, TagInfo td, String templatePath)
+ {
+ int nlPos = message.indexOf(System.getProperty("line.separator")); //$NON-NLS-1$
+ if(nlPos >= 0) {
+ message = message.substring(0, nlPos);
+ }
+ System.out.println((templatePath == null ? "" : templatePath + " ") + td.toString() + ": " + message); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ });
+ }
+
+ Diagnostic diagnostic = templateBundle.execute(new IJET2Runnable()
+ {
+
+ public Diagnostic run(JET2TemplateLoader loader) throws JET2TagException
+ {
+ XPathContextExtender xpe = new XPathContextExtender(context);
+ // once the bundle is dynamically loaded, force the extension point managers
+ // to refresh extensions in the loaded bundle.
+ // OSGi asynchronously broadcasts registry updates, but this is not prompt enough,
+ // and there is no mechanism for waiting for these
+ InternalJET2Platform.getDefault().getXPathFunctionsManager().forceRefresh(id);
+ InternalJET2Platform.getDefault().getTagLibManager().forceRefresh(id);
+
+ xpe.addCustomFunctions(InternalJET2Platform.getDefault().getXPathFunctionsManager().getCustomFunctions());
+
+ tce.setLoader(loader);
+
+ BodyContentWriter bodyContentWriter = new BodyContentWriter();
+ monitor.subTask(JET2Messages.JET2Platform_ExecutingTemplates);
+
+ // FIXME Hard coded value for control template - fix this
+ tce.execute("templates/control.jet", bodyContentWriter); //$NON-NLS-1$
+ // template.generate(context, bodyContentWriter);
+ monitor.worked(30);
+
+ monitor.subTask(JET2Messages.JET2Platform_CommittingResults);
+ tce.commit(new SubProgressMonitor(monitor, 60));
+
+ return context.getLogAsMultiStatus();
+ }
+ });
+ if (diagnostic.getSeverity() != Diagnostic.OK)
+ {
+ processResults(id, diagnostic);
+ }
+ result = BasicDiagnostic.toIStatus(diagnostic);
+ }
+ catch (CoreException e)
+ {
+ result = e.getStatus();
+ }
+ finally
+ {
+ monitor.done();
+ if(DEBUG) {
+ System.out.flush();
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * @param id
+ * @param result
+ * @throws CoreException
+ */
+ private static void processResults(final String id, final Diagnostic result)
+ {
+ IJET2TemplateBundleDescriptor descriptor = InternalJET2Platform.getDefault().getTemplateBundleDescriptor(id);
+ if (descriptor instanceof ProjectTemplateBundleDescriptor)
+ {
+ ProjectTemplateBundleDescriptor projectDescriptor = (ProjectTemplateBundleDescriptor)descriptor;
+ final IProject project = projectDescriptor.getProject();
+
+ // we use this runnable to allow markers to be completely created
+ // prior to becoming visible to the platform. See Eclipse FAQ 304
+ try
+ {
+ project.getWorkspace().run(new IWorkspaceRunnable()
+ {
+ public void run(IProgressMonitor monitor1) throws CoreException
+ {
+ addRuntimeProblemMarkersToProject(project, result);
+ }
+ }, null, IWorkspace.AVOID_UPDATE, null);
+ }
+ catch (CoreException e)
+ {
+ InternalJET2Platform.logError(JET2Messages.JET2Platform_ErrorMarkingProject, e);
+ InternalJET2Platform.log(BasicDiagnostic.toIStatus(result));
+ }
+ }
+ else
+ {
+ InternalJET2Platform.log(BasicDiagnostic.toIStatus(result));
+ }
+ }
+
+ /**
+ * @param project
+ * @param result
+ * @throws CoreException
+ */
+ private static void addRuntimeProblemMarkersToProject(IProject project, Diagnostic result) throws CoreException
+ {
+ // clear off any runtime markers...
+ project.deleteMarkers(JET2Compiler.RUNTIME_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);
+ Diagnostic[] problems = (Diagnostic[])result.getChildren().toArray(new Diagnostic[0]);
+ for (int i = 0; i < problems.length; i++)
+ {
+ if (problems[i] instanceof JET2TemplateStatus)
+ {
+ JET2TemplateStatus tStatus = (JET2TemplateStatus)problems[i];
+ String templatePath = tStatus.getTemplatePath();
+ IResource errorResource = templatePath != null ? project.findMember(templatePath) : project;
+
+ IMarker marker = errorResource.createMarker(JET2Compiler.RUNTIME_PROBLEM_MARKER);
+ if (tStatus.getSeverity() == IStatus.ERROR)
+ {
+ marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
+ }
+ else if (tStatus.getSeverity() == IStatus.WARNING)
+ {
+ marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_WARNING);
+ }
+ else if (tStatus.getSeverity() == IStatus.INFO)
+ {
+ marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO);
+ }
+ TagInfo td = tStatus.getTagInfo();
+ if (td != null)
+ {
+ marker.setAttribute(IMarker.LINE_NUMBER, td.getLine());
+ marker.setAttribute(IMarker.CHAR_START, td.getStart());
+ marker.setAttribute(IMarker.CHAR_END, td.getEnd());
+ }
+ if (tStatus.getMessage() != null)
+ {
+ marker.setAttribute(IMarker.MESSAGE, tStatus.getMessage());
+ }
+ else if (tStatus.getException() != null)
+ {
+ String message = tStatus.getException().getLocalizedMessage();
+ marker.setAttribute(IMarker.MESSAGE, message != null && message.length() > 0 ? message : tStatus.getException().toString());
+ }
+ }
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Template.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Template.java
new file mode 100644
index 0000000..91a4001
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Template.java
@@ -0,0 +1,35 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet;
+
+
+/**
+ * Interface to compiled JET2 templates.
+ *
+ */
+public interface JET2Template
+{
+
+ /**
+ * Execute the template against the input contained in the {@link JET2Context},
+ * and writing the result to the {@link JET2Writer}.
+ * @param context the input context. Cannot be <code>null</code>.
+ * @param out the output writer. Cannote be <code>null</code>.
+ */
+ public abstract void generate(JET2Context context, JET2Writer out);
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2TemplateLoader.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2TemplateLoader.java
new file mode 100644
index 0000000..a310854
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2TemplateLoader.java
@@ -0,0 +1,36 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.jet;
+
+/**
+ * A loader for templates within a transform.
+ */
+public interface JET2TemplateLoader
+{
+
+ /**
+ * Return an instance of the specified template, or <code>null</code>.
+ * <p>
+ * This class is not typically implemented by clients. The JET2 compiler will
+ * emit an instance of this class for each JET2 project.
+ * </p>
+ * @param templatePath a transform project relative path to the template.
+ * @return the template instance or <code>null</code> if the template cannot be found
+ */
+ public JET2Template getTemplate(String templatePath);
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Writer.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Writer.java
new file mode 100644
index 0000000..21395f7
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Writer.java
@@ -0,0 +1,199 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet;
+
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.Position;
+
+
+/**
+ * Define a JET2 output writer
+ *
+ */
+public interface JET2Writer
+{
+
+ /**
+ * Write the passed string.
+ * @param string a string value.
+ */
+ public abstract void write(String string);
+
+ /**
+ * Write the contents of the passed writer to this writer.
+ * @param bodyContent a writer
+ */
+ public abstract void write(JET2Writer bodyContent);
+
+ /**
+ * Write the passed boolean by calling {@link String#valueOf(boolean)}.
+ * @param b a boolean value
+ */
+ public abstract void write(boolean b);
+
+ /**
+ * Write the passed character by calling {@link String#valueOf(char)}.
+ * @param c a char value
+ */
+ public abstract void write(char c);
+
+ /**
+ * Write the passed character array by calling {@link String#valueOf(char[])}.
+ * @param data an array of characters
+ */
+ public abstract void write(char[] data);
+
+ /**
+ * Write the passed double value by calling {@link String#valueOf(double)}.
+ * @param d a double value
+ */
+ public abstract void write(double d);
+
+ /**
+ * Write the passed float value by calling {@link String#valueOf(float)}.
+ * @param f a float value
+ */
+ public abstract void write(float f);
+
+ /**
+ * Write the passed integer by calling {@link String#valueOf(int)}.
+ * @param i an integer value
+ */
+ public abstract void write(int i);
+
+ /**
+ * Write the passed long value calling {@link String#valueOf(long)}.
+ * @param l a long value.
+ */
+ public abstract void write(long l);
+
+ /**
+ * Write the pass object by calling {@link Object#toString()}.
+ * @param obj an object.
+ */
+ public abstract void write(Object obj);
+
+ /**
+ * Create a writer for handling nested content. The new writer will have access
+ * to all position handlers defined on the parent writer (and its parents)
+ * @return the nested content writer
+ */
+ public abstract JET2Writer newNestedContentWriter();
+
+ /**
+ * Return the parent of this writer, if it was created via {@link #newNestedContentWriter()}.
+ * @return the parent writer, or <code>null</code>.
+ */
+ public abstract JET2Writer getParentWriter();
+
+ /**
+ * Return the current length (in characters) of the output
+ * @return the current length
+ */
+ public abstract int getLength();
+
+ /**
+ * Return the backing IDocument for this writer. Use this method to do advanced
+ * writer processing, such as adding Positions for later re-writing of the document
+ * contents.
+ * @return the backing document
+ */
+ public abstract IDocument getDocument();
+
+ /**
+ * Finalize the writers contents. Once finalized, no more content may be written to the writer.
+ * Calls {@link IWriterListener#finalizeContent(JET2Writer, Object)} on all registered listeners.
+ * <p>
+ * The type of <code>file</code> varies depending on the context in which the content
+ * is finalized. The standard JET2 Workspace tags pass an org.eclipse.core.resources.IFile.
+ * </p>
+ * @param file the file object to which the finalized contents will be written.
+ * @see #addEventListener(String, IWriterListener)
+ */
+ public abstract void finalizeContent(Object file);
+
+ /**
+ * Inform listeners that the content has been committed to some permanent store.
+ * Calls {@link IWriterListener#postCommitContent(JET2Writer, Object)} on all registered listeners.
+ * <p>
+ * The type of <code>committedObject</code> varies, depending on the context in which the content
+ * is committed. The standard JET2 Workspace tags pass an org.eclipse.core.resources.IFile.
+ * </p>
+ * @param committedObject the committed object.
+ */
+ public abstract void contentCommitted(Object committedObject);
+
+ /**
+ * Add a listener to the writer life cycle events. The writer records one listener per
+ * category. Subsequent calls to this method with the same category value have no effect.
+ * If the listener was created view {@link #newNestedContentWriter()}, then the listener is added
+ * to the root writer, rather than the listener itself.
+ * @param category the listener category
+ * @param listener a listener
+ * @throws NullPointerException if listener is <code>null</code>.
+ */
+ public abstract void addEventListener(String category, IWriterListener listener);
+
+ /**
+ * Convenience method wrapping getDocument().addPositionCategory(String).
+ * @param category a Position Category
+ * @throws IllegalArgumentException wrapping a {@link org.eclipse.jface.text.BadPositionCategoryException}
+ * @see IDocument#addPositionCategory(java.lang.String)
+ */
+ public abstract void addPositionCategory(String category);
+
+ /**
+ * Convenience method wrapping getDocument().addPosition(String, Position).
+ * Any
+ * {@link org.eclipse.jface.text.BadPositionCategoryException} or
+ * {@link org.eclipse.jface.text.BadLocationException} is wrapped in a
+ * a runtime exception.
+ * @param category a position category
+ * @param position a position
+ * @throws WriterPositionException wrapping a {@link org.eclipse.jface.text.BadPositionCategoryException}
+ * or {@link org.eclipse.jface.text.BadLocationException}
+ * @see IDocument#addPosition(java.lang.String, org.eclipse.jface.text.Position)
+ */
+ public abstract void addPosition(String category, Position position);
+
+ /**
+ * Convenience method wrapping getDocument().getPositions(String).
+ * Any
+ * {@link org.eclipse.jface.text.BadPositionCategoryException}
+ * is wrapped in a runtime exception.
+ * @param category a position category
+ * @return an array of positions
+ * @throws WriterPositionException wrapping a {@link org.eclipse.jface.text.BadPositionCategoryException}
+ * @see IDocument#getPositions(java.lang.String)
+ */
+ public abstract Position[] getPositions(String category);
+
+ /**
+ * Convenience method wrapping getDocument().replace(int,int,String).
+ * Any
+ * {@link org.eclipse.jface.text.BadLocationException}
+ * is wrapped in a runtime exception.
+ * @param offset the offset of the text to replace
+ * @param length the length of the text to replace
+ * @param text the replacement text
+ * @throws WriterPositionException wrapping a {@link org.eclipse.jface.text.BadLocationException}
+ * @see IDocument#replace(int, int, java.lang.String)
+ */
+ public abstract void replace(int offset, int length, String text);
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/WriterPositionException.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/WriterPositionException.java
new file mode 100644
index 0000000..6fdd9d2
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/WriterPositionException.java
@@ -0,0 +1,43 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet;
+
+
+/**
+ * Runtime exception to wrap the rather inconvenient checked exception thrown by
+ * the org.eclipse.jface.text classes and methods.
+ *
+ */
+public class WriterPositionException extends RuntimeException
+{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -4660059269261007284L;
+
+ /**
+ * Create a WriterPostionException that wraps another exception
+ * @param e
+ */
+ public WriterPositionException(Throwable e)
+ {
+ super(e);
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/XPathContextExtender.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/XPathContextExtender.java
new file mode 100644
index 0000000..ed77b55
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/XPathContextExtender.java
@@ -0,0 +1,451 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet;
+
+
+import java.text.MessageFormat;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jet.internal.InternalJET2Platform;
+import org.eclipse.jet.internal.l10n.JET2Messages;
+import org.eclipse.jet.internal.xpath.AnnotationManagerImpl;
+import org.eclipse.jet.internal.xpath.functions.StringFunction;
+import org.eclipse.jet.taglib.JET2TagException;
+import org.eclipse.jet.xpath.DefaultXPathFunctionResolver;
+import org.eclipse.jet.xpath.IAnnotationManager;
+import org.eclipse.jet.xpath.XPath;
+import org.eclipse.jet.xpath.XPathException;
+import org.eclipse.jet.xpath.XPathExpression;
+import org.eclipse.jet.xpath.XPathFactory;
+import org.eclipse.jet.xpath.XPathFunctionMetaData;
+import org.eclipse.jet.xpath.XPathRuntimeException;
+import org.eclipse.jet.xpath.XPathVariableResolver;
+import org.eclipse.jet.xpath.inspector.AddElementException;
+import org.eclipse.jet.xpath.inspector.CopyElementException;
+import org.eclipse.jet.xpath.inspector.ExpandedName;
+import org.eclipse.jet.xpath.inspector.IElementInspector;
+import org.eclipse.jet.xpath.inspector.INodeInspector;
+import org.eclipse.jet.xpath.inspector.InspectorManager;
+import org.eclipse.jet.xpath.inspector.InvalidChildException;
+import org.eclipse.jet.xpath.inspector.SimpleElementRequiresValueException;
+import org.eclipse.jet.xpath.inspector.INodeInspector.NodeKind;
+
+
+/**
+ * Context Extender that understands XPath processing.
+ *
+ */
+public final class XPathContextExtender extends AbstractContextExtender implements XPathVariableResolver
+{
+
+ private static boolean DEBUG = InternalJET2Platform.getDefault().isDebugging()
+ && Boolean.valueOf(Platform.getDebugOption("org.eclipse.jet/debug/xpath/compilations")).booleanValue(); //$NON-NLS-1$
+
+ private static final class ContextData
+ {
+ private final IAnnotationManager annotationManager = new AnnotationManagerImpl();
+
+ private DefaultXPathFunctionResolver customFunctionResolver = null;
+
+ private final Map knownXPathExpressions = new HashMap();
+ }
+
+ /**
+ * @param context
+ */
+ public XPathContextExtender(JET2Context context)
+ {
+ super(context);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jet.AbstractContextExtender#createExtendedData(org.eclipse.jet.JET2Context)
+ */
+ protected Object createExtendedData(JET2Context context)
+ {
+ final ContextData contextData = new ContextData();
+
+ XPath xp = XPathFactory.newInstance().newXPath(contextData.annotationManager);
+ // Add one a custom function resolver which delegates to the resolver installed by default.
+ contextData.customFunctionResolver = new DefaultXPathFunctionResolver(xp.getXPathFunctionResolver());
+
+ return contextData;
+ }
+
+ private ContextData getData()
+ {
+ return (ContextData)getExtendedData();
+ }
+
+ public Object resolveVariable(String name)
+ {
+ // return getData().xpathVariableMap.get(name);
+ if (getContext().hasVariable(name))
+ {
+ try
+ {
+ return getContext().getVariable(name);
+ }
+ catch (JET2TagException e)
+ {
+ // wont' happen, we checked to make sure its ok.;
+ return null;
+ }
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public String resolveAsString(Object xpathContextObject, String selectXPath) throws JET2TagException
+ {
+ try
+ {
+ XPathExpression expr = compileXPath(selectXPath);
+ return expr.evaluateAsString(xpathContextObject);
+ }
+ catch (XPathException e)
+ {
+ throw new JET2TagException(e);
+ }
+ }
+
+ public Object resolveSingle(Object xpathContextObject, String selectXPath) throws JET2TagException
+ {
+ try
+ {
+ XPathExpression expr = compileXPath(selectXPath);
+ return expr.evaluateAsSingleNode(xpathContextObject);
+ }
+ catch (XPathException e)
+ {
+ throw new JET2TagException(e);
+ }
+
+ }
+
+ /**
+ * @param selectXPath
+ * @return
+ * @throws XPathException
+ */
+ private XPathExpression compileXPath(String selectXPath) throws XPathException
+ {
+ Object result = getData().knownXPathExpressions.get(selectXPath);
+ if (result == null)
+ {
+ if(DEBUG) System.out.println("XPath compile of " + selectXPath); //$NON-NLS-1$
+ XPath xp = XPathFactory.newInstance().newXPath(getData().annotationManager);
+ // install the custom resolver.
+ xp.setXPathFunctionResolver(getData().customFunctionResolver);
+ xp.setXPathVariableResolver(this);
+ try
+ {
+ result = xp.compile(selectXPath);
+ if(DEBUG) System.out.println(" compiled to " + result); //$NON-NLS-1$
+ }
+ catch (XPathException e)
+ {
+ result = e;
+ if(DEBUG) System.out.println(" exception " + result); //$NON-NLS-1$
+ }
+ getData().knownXPathExpressions.put(selectXPath, result);
+ } else {
+ if(DEBUG) System.out.println("XPath cache hit on " + selectXPath); //$NON-NLS-1$
+ }
+
+ if(result instanceof XPathExpression) {
+ return (XPathExpression) result;
+ }
+ else
+ {
+ throw (XPathException) result;
+ }
+ }
+
+ public Object currentXPathContextObject()
+ {
+ return getContext().getSource();
+ }
+
+ public Object[] resolve(Object xpathContextObject, String selectXPath) throws JET2TagException
+ {
+ try
+ {
+ XPathExpression expr = compileXPath(selectXPath);
+ return expr.evaluateAsNodeSet(xpathContextObject).toArray();
+ }
+ catch (XPathException e)
+ {
+ throw new JET2TagException(e);
+ }
+ }
+
+ /**
+ * Resolve an xpath expression as a boolean result according to the
+ * XPath rules.
+ * <p>
+ * TODO Add link to XPath 1.0 spec for clarification
+ * </p>
+ * @param xpathContext the XPath context object
+ * @param testXPath the XPath expression
+ * @return <code>true</code> or <code>false</code>
+ * @throws JET2TagException if an error occurs in evaluating the expression.
+ */
+ public boolean resolveTest(Object xpathContext, String testXPath) throws JET2TagException
+ {
+ try
+ {
+ XPathExpression expr = compileXPath(testXPath);
+ return expr.evaluateAsBoolean(xpathContext);
+ }
+ catch (XPathException e)
+ {
+ throw new JET2TagException(e);
+ }
+ }
+
+ public boolean setAttribute(Object element, String name, String bodyContent) throws JET2TagException
+ {
+ IElementInspector elementInspector = getElementInspector(element);
+
+ boolean isSet = elementInspector.createAttribute(element, name, bodyContent);
+
+ if(!isSet && getData().annotationManager != null) {
+ Object annotation = getData().annotationManager.getAnnotationObject(element);
+ elementInspector = getElementInspector(annotation);
+ isSet = elementInspector.createAttribute(annotation, name, bodyContent);
+ }
+ return isSet;
+ }
+
+ /**
+ * Resolve dynamic XPath expressions {...} within the pass value
+ * @param value a string containing zero or more dynamic xpath expressions
+ * @return the string with all dynamic xpath expressions resolved
+ * @throws JET2TagException if an Xpath evaluation error occurs
+ */
+ public String resolveDynamic(String value) throws JET2TagException
+ {
+ Object context = currentXPathContextObject();
+ Pattern dynXpathPattern = Pattern.compile("\\{(.*?)}"); // look for a sequence of characters between { and } //$NON-NLS-1$
+ StringBuffer buffer = new StringBuffer(value);
+ Matcher matcher = dynXpathPattern.matcher(buffer);
+ int i = 0;
+ while (i < buffer.length() && matcher.find(i))
+ {
+ String xpath = matcher.group(1);
+ String resolved = resolveAsString(context, xpath);
+ if (resolved == null)
+ {
+ String msg = JET2Messages.XPath_DynamicExpressionIsNull;
+ throw new JET2TagException(MessageFormat.format(msg, new Object []{ xpath }));
+ }
+ buffer.replace(matcher.start(), matcher.end(), resolved);
+ // next scan starts at end of this match, adjusted for the size difference between
+ // the replacement text (resolved.length()) and the replaced text xpath.length() + 2 (for { & }).
+ i = matcher.end() + resolved.length() - (xpath.length() + 2);
+ }
+ return buffer.toString();
+ }
+
+ private IElementInspector getElementInspector(Object element) throws JET2TagException
+ {
+ final INodeInspector inspector = InspectorManager.getInstance().getInspector(element);
+ if (inspector == null || inspector.getNodeKind(element) != NodeKind.ELEMENT || !(inspector instanceof IElementInspector))
+ {
+ throw new JET2TagException(JET2Messages.XPath_NotAnElement);
+ }
+ return (IElementInspector)inspector;
+ }
+
+ public Object addElement(Object parent, String name) throws JET2TagException
+ {
+ IElementInspector inspector = getElementInspector(parent);
+
+ try
+ {
+ return inspector.addElement(parent, new ExpandedName(name), null);
+ }
+ catch (SimpleElementRequiresValueException e)
+ {
+ throw new JET2TagException(JET2Messages.XPath_UseAddTextElement);
+ }
+ catch (InvalidChildException e)
+ {
+ // cannot happend, as we're passing null as the third argument;
+ throw new JET2TagException(e);
+ }
+ }
+
+ public void removeElement(Object element) throws JET2TagException
+ {
+ IElementInspector inspector = getElementInspector(element);
+
+ inspector.removeElement(element);
+
+ }
+
+ /**
+ * Copy <code>srcElement</code> as a new element with the specified name under <code>tgtParent</code>.
+ * If <code>recursive</code> is <code>true</code>, then all the contained children of <code>srcElement</code>
+ * are copied, otherwise, only the element and its attributes are copied.
+ * @param srcElement the element to copy
+ * @param tgtParent the parent element that will contain the copy
+ * @param name the name of the copied element
+ * @param recursive <code>true</code> if contained chidren are to be copied, too.
+ * @return the newly copied element
+ * @throws JET2TagException an error occurs
+ */
+ public Object copyElement(Object srcElement, Object tgtParent, String name, boolean recursive) throws JET2TagException
+ {
+ IElementInspector inspector = getElementInspector(tgtParent);
+
+ try
+ {
+ return inspector.copyElement(tgtParent, srcElement, name, recursive);
+ }
+ catch (CopyElementException e)
+ {
+ throw new JET2TagException(e.getLocalizedMessage(), e);
+ }
+ }
+
+ /**
+ * Create a new text (simple) element whose content is set to <code>bodyContent</code>.
+ * @param parentElement the parent of the new element.
+ * @param name the name of the new element.
+ * @param bodyContent the content.
+ * @return the new Element.
+ * @throws JET2TagException if the element cannot be added.
+ */
+ public Object addTextElement(Object parentElement, String name, String bodyContent) throws JET2TagException
+ {
+ return addTextElement(parentElement, name, bodyContent, false);
+ }
+
+ /**
+ * Create a new text (simple) element whose content is set to <code>bodyContent</code>.
+ * @param parentElement the parent of the new element.
+ * @param name the name of the new element.
+ * @param bodyContent the content.
+ * @param asCData if <code>true</code>, create the element as a CDATA section, of possible
+ * @return the new element.
+ * @throws JET2TagException if the element cannot be added.
+ */
+ public Object addTextElement(Object parentElement, String name, String bodyContent, boolean asCData) throws JET2TagException
+ {
+ IElementInspector inspector = getElementInspector(parentElement);
+
+ try
+ {
+ return inspector.addTextElement(parentElement, name, bodyContent, asCData);
+ }
+ catch (AddElementException e)
+ {
+ throw new JET2TagException(e.getLocalizedMessage(), e);
+ }
+
+ }
+ /**
+ * Resolve the XPath expression, returning an object. Unlike the other resolve methods, this
+ * method performs no type conversions on the XPath results.
+ * @param contextObject the context object to which the XPath expression is relative.
+ * @param selectXPath the XPath expression
+ * @return the result of the expression evaluation.
+ * @throws JET2TagException if an error occurs.
+ */
+ public Object resolveAsObject(Object contextObject, String selectXPath) throws JET2TagException
+ {
+ try
+ {
+ XPathExpression expr = compileXPath(selectXPath);
+ return expr.evaluate(contextObject);
+ }
+ catch (XPathException e)
+ {
+ throw new JET2TagException(e.getMessage(), e);
+ }
+ catch(XPathRuntimeException e) {
+ throw new JET2TagException(e.getMessage(), e);
+ }
+ }
+
+ /**
+ * Return the value of the named attribute on the passed element.
+ * @param element the element containing the attribute
+ * @param attributeName the attribute name
+ * @return the attribute value
+ * @throws JET2TagException
+ */
+ public Object getAttributeValue(Object element, String attributeName) throws JET2TagException
+ {
+ IElementInspector inspector = getElementInspector(element);
+
+ final Object namedAttribute = inspector.getNamedAttribute(element, new ExpandedName(attributeName));
+ INodeInspector attrInspector = InspectorManager.getInstance().getInspector(namedAttribute);
+ if(attrInspector != null) {
+ return attrInspector.stringValueOf(namedAttribute);
+ } else {
+ throw new JET2TagException(MessageFormat.format(JET2Messages.XPath_NoValueForAttribute, new Object[] {attributeName}));
+ }
+ }
+
+ /**
+ * Remove the named attribute from the specified element.
+ * @param element the element containing the attribute
+ * @param attributeName the attribute to remove
+ * @throws JET2TagException if the attribute cannot be removed (because it is required),
+ * or if <code>element</code> is not a recognized element.
+ */
+ public void removeAttribute(Object element, String attributeName) throws JET2TagException
+ {
+ IElementInspector inspector = getElementInspector(element);
+ inspector.removeAttribute(element, attributeName);
+
+ }
+
+ /**
+ * Return the string value of the passed object. This equivalent to calling the XPath string() function
+ * on the passed object.
+ * @param object the object to examine.
+ * @return the string value.
+ * @throws JET2TagException if an error occurs.
+ */
+ public String getContent(Object object) throws JET2TagException {
+ return StringFunction.evaluate(object);
+ }
+
+ /**
+ * Add the passed list of XPath function definitions to the XPath processor.
+ * @param functionData possible empty array of {@link XPathFunctionMetaData} instances.
+ */
+ public void addCustomFunctions(XPathFunctionMetaData functionData[])
+ {
+ final DefaultXPathFunctionResolver resolver = getData().customFunctionResolver;
+ for (int i = 0; i < functionData.length; i++)
+ {
+ resolver.addFunction(functionData[i]);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/ASTCompilerParseListener.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/ASTCompilerParseListener.java
new file mode 100644
index 0000000..34265e8
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/ASTCompilerParseListener.java
@@ -0,0 +1,494 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.compiler;
+
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.jet.internal.l10n.JET2Messages;
+import org.eclipse.jet.internal.parser.JETMark;
+import org.eclipse.jet.internal.parser.JETParseEventListener2;
+import org.eclipse.jet.internal.parser.JETReader;
+import org.eclipse.jet.internal.parser.ParseProblemSeverity;
+import org.eclipse.jet.taglib.TagDefinition;
+import org.eclipse.jet.taglib.TagLibraryManager;
+
+
+/**
+ * JET Parser Listener used by the JET2 Compiler
+ *
+ */
+class ASTCompilerParseListener implements JETParseEventListener2
+{
+
+ private static final String ID__ATTR = "id"; //$NON-NLS-1$
+
+ private static final String PREFIX__ATTR = "prefix"; //$NON-NLS-1$
+
+ private static final String TAGLIB__DIRECTIVE = "taglib"; //$NON-NLS-1$
+
+ private final static class ElementStack
+ {
+
+ private final List stack = new ArrayList();
+
+ /**
+ *
+ */
+ public ElementStack()
+ {
+ super();
+ }
+
+ /**
+ * Push an XML element on the active element stack
+ * @param element
+ */
+ public void push(XMLBodyElement element)
+ {
+ stack.add(element);
+ }
+
+ /**
+ * Remove an XML element from the active element stack
+ * @return the popped element
+ * @throws IllegalStateException if the stack is empty
+ */
+ public XMLBodyElement pop()
+ {
+ if (stack.size() == 0)
+ {
+ throw new IllegalStateException("stack is empty"); //$NON-NLS-1$
+ }
+ return (XMLBodyElement)stack.remove(stack.size() - 1);
+ }
+
+ /**
+ * Return the top element on the active element statkc
+ * @return the top element
+ * @throws IllegalStateException if the stack is empty
+ */
+ public XMLBodyElement peek()
+ {
+ if (stack.size() == 0)
+ {
+ throw new IllegalStateException("stack is empty"); //$NON-NLS-1$
+ }
+ return (XMLBodyElement)stack.get(stack.size() - 1);
+
+ }
+
+ /**
+ * Test if the stack is empty
+ * @return <code>true</code> if empty, <code>false</code> otherwise
+ */
+ public boolean isEmpty()
+ {
+ return stack.size() == 0;
+ }
+
+ /**
+ * Find the index of the element with the specified name that is closest to the top of the stack.
+ * @param name the element name to search for
+ * @return the found element's index or -1 if not found
+ */
+ public int findElementIndex(String name)
+ {
+ for (int i = stack.size() - 1; i >= 0; i--)
+ {
+ XMLBodyElement element = get(i);
+ if (element.getName().equalsIgnoreCase(name))
+ {
+ return i;
+ }
+ }
+
+ return -1;
+ }
+
+ /**
+ * Test if the passed index is that of the top-most element in the active element stack.
+ * @param index the test index
+ * @return <code>true</code> if the index represents the top-most element, <code>false</code> otherwise.
+ * @throws IllegalArgumentException if the index is less than 0 or larger than the stack size.
+ */
+ public boolean isAtTop(int index)
+ {
+ if (index < 0 || index >= stack.size())
+ {
+ throw new IllegalArgumentException();
+ }
+ return index == stack.size() - 1;
+ }
+
+ /**
+ * Return the element at the specified index
+ * @param index
+ * @return the element
+ * @throws IllegalArgumentException if the index is less than 0 or larger than the stack size.
+ *
+ */
+ public XMLBodyElement get(int index)
+ {
+ if (index < 0 || index >= stack.size())
+ {
+ throw new IllegalArgumentException();
+ }
+ return (XMLBodyElement)stack.get(index);
+ }
+ }
+
+ /**
+ * Stack of elements waiting for end tags.
+ */
+ private final ElementStack elementStack = new ElementStack();
+
+ private JET2CompilationUnit compilationUnit;
+
+ private JET2AST ast;
+
+ private final TagLibraryUsageManager tagLibManager;
+
+ private final JETReader reader;
+
+ public ASTCompilerParseListener(JET2CompilationUnit unit, JETReader reader)
+ {
+ compilationUnit = unit;
+ ast = compilationUnit.getAst();
+ this.reader = reader;
+ tagLibManager = new TagLibraryUsageManager();
+ }
+
+ /**
+ * @see org.eclipse.jet.internal.parser.JETParseEventListener#beginPageProcessing()
+ */
+ public void beginPageProcessing()
+ {
+ // nothing to do
+ }
+
+ /**
+ * @see org.eclipse.jet.internal.parser.JETParseEventListener#handleDirective(java.lang.String, org.eclipse.jet.internal.parser.JETMark, org.eclipse.jet.internal.parser.JETMark, java.util.Map)
+ */
+ public void handleDirective(String directive, JETMark start, JETMark stop, Map attributes)
+ {
+ JET2Directive directiveImpl = ast.createDirective(start.getLine(), start.getCursor(), stop.getCursor() + 1, directive, attributes);
+
+ // although a directive may appear nested, it really isn't. Add it to the compilation unit.
+ // TODO Does this work for @start and @end? Probably NOT.
+ compilationUnit.getInternalBodyElements().addBodyElement(directiveImpl);
+
+ if (TAGLIB__DIRECTIVE.equalsIgnoreCase(directive))
+ {
+ String prefix = ((String)attributes.get(PREFIX__ATTR)).trim().toLowerCase();
+ String id = (String)attributes.get(ID__ATTR);
+
+ if (id == null)
+ {
+ compilationUnit.createProblem(
+ ParseProblemSeverity.ERROR,
+ Problem.MissingRequiredAttribute,
+ JET2Messages.JET2Compiler_MissingDirectiveAttribute,
+ new Object []{ TAGLIB__DIRECTIVE, ID__ATTR },
+ start.getCursor(),
+ stop.getCursor(),
+ start.getLine());
+ }
+ else if (prefix == null)
+ {
+ compilationUnit.createProblem(
+ ParseProblemSeverity.ERROR,
+ Problem.MissingRequiredAttribute,
+ JET2Messages.JET2Compiler_MissingDirectiveAttribute,
+ new Object []{ TAGLIB__DIRECTIVE, PREFIX__ATTR },
+ start.getCursor(),
+ stop.getCursor(),
+ start.getLine());
+ }
+ else if (tagLibManager.isPrefixDefined(prefix))
+ {
+ compilationUnit.createProblem(
+ ParseProblemSeverity.ERROR,
+ Problem.DuplicateXMLNamespacePrefix,
+ JET2Messages.JET2Compiler_PrefixAlreadyAssigned,
+ new Object []{ prefix, tagLibManager.getLibaryIdFromPrefix(prefix) },
+ start.getCursor(),
+ stop.getCursor(),
+ start.getLine());
+ }
+ else if (TagLibraryManager.getInstance().getTagLibrary(id) == null)
+ {
+ compilationUnit.createProblem(
+ ParseProblemSeverity.ERROR,
+ Problem.UnknownTagLibrary,
+ JET2Messages.JET2Compiler_UnknownTagLibrary,
+ new Object []{ id },
+ start.getCursor(),
+ stop.getCursor(),
+ start.getLine());
+ }
+ else
+ {
+ tagLibManager.add(prefix, id);
+ }
+ }
+
+ }
+
+ /**
+ * @see org.eclipse.jet.internal.parser.JETParseEventListener#handleExpression(org.eclipse.jet.internal.parser.JETMark, org.eclipse.jet.internal.parser.JETMark, java.util.Map)
+ */
+ public void handleExpression(JETMark start, JETMark stop, Map attributes)
+ {
+ JET2Expression expression = ast.createExpression(
+ start.getLine(),
+ start.getCursor() - 3,
+ stop.getCursor() + 2,
+ start.getCursor(),
+ stop.getCursor(),
+ reader.getChars(start, stop));
+
+ if (elementStack.isEmpty())
+ {
+ compilationUnit.getInternalBodyElements().addBodyElement(expression);
+ }
+ else
+ {
+ XMLBodyElement topElement = elementStack.peek();
+
+ topElement.getInternalBodyElements().addBodyElement(expression);
+ }
+
+ }
+
+ /**
+ * @see org.eclipse.jet.internal.parser.JETParseEventListener#handleCharData(char[])
+ */
+ public void handleCharData(char[] chars)
+ {
+ TextElement text = ast.createTextElement(chars);
+
+ if (elementStack.isEmpty())
+ {
+ compilationUnit.getInternalBodyElements().addBodyElement(text);
+ }
+ else
+ {
+ XMLBodyElement topElement = elementStack.peek();
+
+ topElement.getInternalBodyElements().addBodyElement(text);
+ }
+
+ }
+
+ /**
+ * @see org.eclipse.jet.internal.parser.JETParseEventListener#endPageProcessing()
+ */
+ public void endPageProcessing()
+ {
+ while (!elementStack.isEmpty())
+ {
+ XMLBodyElement element = elementStack.pop();
+ compilationUnit.createProblem(
+ ParseProblemSeverity.ERROR,
+ Problem.MissingXmlEndTag,
+ JET2Messages.JET2Compiler_MissingEndTag,
+ new Object []{ element.getName() },
+ element.getStart(),
+ element.getEnd(),
+ element.getLine());
+ }
+
+ }
+
+ /**
+ * @see org.eclipse.jet.internal.parser.JETParseEventListener#handleScriptlet(org.eclipse.jet.internal.parser.JETMark, org.eclipse.jet.internal.parser.JETMark, java.util.Map)
+ */
+ public void handleScriptlet(JETMark start, JETMark stop, Map attributes)
+ {
+ JET2Scriptlet scriplet = ast.createScriplet(
+ start.getLine(),
+ start.getCursor() - 3,
+ stop.getCursor() + 2,
+ start.getCursor(),
+ stop.getCursor(),
+ reader.getChars(start, stop));
+
+ if (elementStack.isEmpty())
+ {
+ compilationUnit.getInternalBodyElements().addBodyElement(scriplet);
+ }
+ else
+ {
+ XMLBodyElement topElement = elementStack.peek();
+
+ topElement.getInternalBodyElements().addBodyElement(scriplet);
+ }
+
+ }
+
+ /**
+ * @see org.eclipse.jet.internal.parser.JETParseEventListener2#handleComment(org.eclipse.jet.internal.parser.JETMark, org.eclipse.jet.internal.parser.JETMark)
+ */
+ public void handleComment(JETMark start, JETMark stop)
+ {
+ Comment comment = ast.createComment(
+ start.getLine(),
+ start.getCursor() - 4,
+ stop.getCursor() + 4,
+ start.getCursor(),
+ stop.getCursor(),
+ reader.getChars(start, stop));
+ if (elementStack.isEmpty())
+ {
+ compilationUnit.getInternalBodyElements().addBodyElement(comment);
+ }
+ else
+ {
+ XMLBodyElement topElement = elementStack.peek();
+
+ topElement.getInternalBodyElements().addBodyElement(comment);
+ }
+ }
+
+ /**
+ * @see org.eclipse.jet.internal.parser.JETParseEventListener2#handleDeclaration(org.eclipse.jet.internal.parser.JETMark, org.eclipse.jet.internal.parser.JETMark)
+ */
+ public void handleDeclaration(JETMark start, JETMark stop)
+ {
+ JET2Declaration decl = ast.createDeclaration(
+ start.getLine(),
+ start.getCursor() - 3,
+ stop.getCursor() + 2,
+ start.getCursor(),
+ stop.getCursor(),
+ reader.getChars(start, stop));
+
+ compilationUnit.getInternalBodyElements().addBodyElement(decl);
+ }
+
+ /**
+ * @see org.eclipse.jet.internal.parser.JETParseEventListener2#handleXMLEndTag(java.lang.String, org.eclipse.jet.internal.parser.JETMark, org.eclipse.jet.internal.parser.JETMark)
+ */
+ public void handleXMLEndTag(String tagName, JETMark start, JETMark stop)
+ {
+ int tagIndex = elementStack.findElementIndex(tagName);
+ if (tagIndex == -1)
+ {
+ compilationUnit.createProblem(
+ ParseProblemSeverity.ERROR,
+ Problem.MissingXmlStartTag,
+ JET2Messages.JET2Compiler_MissingStartTag,
+ new Object []{ tagName },
+ start.getCursor(),
+ stop.getCursor(),
+ start.getLine());
+ }
+ else
+ {
+ while (!elementStack.isAtTop(tagIndex))
+ {
+ XMLBodyElement top = elementStack.pop();
+ compilationUnit.createProblem(
+ ParseProblemSeverity.ERROR,
+ Problem.MissingXmlEndTag,
+ JET2Messages.JET2Compiler_MissingEndTag,
+ new Object []{ top.getName() },
+ start.getCursor(),
+ stop.getCursor(),
+ start.getLine());
+ }
+ XMLBodyElement topElement = elementStack.pop();
+ topElement.setEndTagStart(start.getCursor());
+ topElement.setEndTagEnd((stop.getCursor()));
+ }
+ }
+
+ /**
+ * @see org.eclipse.jet.internal.parser.JETParseEventListener2#handleXMLEmptyTag(java.lang.String, org.eclipse.jet.internal.parser.JETMark, org.eclipse.jet.internal.parser.JETMark, java.util.Map)
+ */
+ public void handleXMLEmptyTag(String tagName, JETMark start, JETMark stop, Map attributeMap)
+ {
+ TagDefinition td = tagLibManager.getTagDefinition(tagName);
+
+ XMLEmptyElement decl = ast.createXMLEmptyElement(start.getLine(), start.getCursor(), stop.getCursor(), tagName, attributeMap, td);
+
+ if (elementStack.isEmpty())
+ {
+ compilationUnit.getInternalBodyElements().addBodyElement(decl);
+ }
+ else
+ {
+ XMLBodyElement topElement = (XMLBodyElement)elementStack.peek();
+
+ topElement.getInternalBodyElements().addBodyElement(decl);
+ }
+ }
+
+ /**
+ * @see org.eclipse.jet.internal.parser.JETParseEventListener2#handleXMLStartTag(java.lang.String, org.eclipse.jet.internal.parser.JETMark, org.eclipse.jet.internal.parser.JETMark, java.util.Map)
+ */
+ public void handleXMLStartTag(String tagName, JETMark start, JETMark stop, Map attributeMap)
+ {
+
+ TagDefinition td = tagLibManager.getTagDefinition(tagName);
+
+ XMLBodyElement decl = ast.createXMLBodyElement(start.getLine(), start.getCursor(), stop.getCursor(), tagName, attributeMap, td);
+
+ if (elementStack.isEmpty())
+ {
+ compilationUnit.getInternalBodyElements().addBodyElement(decl);
+ }
+ else
+ {
+ XMLBodyElement topElement = elementStack.peek();
+
+ topElement.getInternalBodyElements().addBodyElement(decl);
+ }
+
+ elementStack.push(decl);
+ }
+
+ /**
+ * @see org.eclipse.jet.internal.parser.JETParseEventListener2#isKnownTag(java.lang.String)
+ */
+ public boolean isKnownTag(String tagName)
+ {
+ return tagLibManager.isKnownTag(tagName);
+ }
+
+ /**
+ * Return the compilation unit created as a result of handling the JET2 parser events.
+ * @return compilation unit
+ */
+ public JET2CompilationUnit getCompilationUnit()
+ {
+ return compilationUnit;
+ }
+
+ /**
+ * @see org.eclipse.jet.internal.parser.JETParseEventListener2#recordProblem(org.eclipse.jet.compiler.Problem.ParseProblemSeverity, int, java.lang.String, java.lang.Object[], int, int, int)
+ */
+ public void recordProblem(ParseProblemSeverity severity, int problemId, String message, Object[] msgArgs, int start, int end, int line)
+ {
+ compilationUnit.createProblem(severity, problemId, message, msgArgs, start, end, line);
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/BodyElements.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/BodyElements.java
new file mode 100644
index 0000000..66a2c06
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/BodyElements.java
@@ -0,0 +1,139 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.jet.compiler;
+
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+
+/**
+ * Container class core JET2 AST elements contained in another AST elements in their body.
+ *
+ */
+class BodyElements
+{
+
+ private List bodyElements = new ArrayList();
+
+ private final JET2ASTElement owner;
+
+ /**
+ * Create a new instance
+ * @param owner The owner of the body elements
+ */
+ public BodyElements(JET2ASTElement owner)
+ {
+ super();
+ this.owner = owner;
+ }
+
+ /**
+ * Return a list of elements in the body
+ * @return a {@link List} of elements, the empty list if there are no elements.
+ */
+ public List getBodyElements()
+ {
+ return Collections.unmodifiableList(bodyElements);
+ }
+
+ /**
+ * Add a text element to the body
+ * @param text the text to add
+ */
+ public void addBodyElement(TextElement text)
+ {
+ bodyElements.add(text);
+ text.setParent(owner);
+ }
+
+ /**
+ * Add an XML element to the body
+ * @param xmlElement the xml element
+ */
+ public void addBodyElement(XMLElement xmlElement)
+ {
+ bodyElements.add(xmlElement);
+ xmlElement.setParent(owner);
+ }
+
+ /**
+ * Add a Java element to the body
+ * @param javaElement the Java element
+ */
+ public void addBodyElement(JavaElement javaElement)
+ {
+ bodyElements.add(javaElement);
+ javaElement.setParent(owner);
+ }
+
+ /**
+ * Add a JET2 Directive to the body
+ * @param directive the directive
+ */
+ public void addBodyElement(JET2Directive directive)
+ {
+ bodyElements.add(directive);
+ directive.setParent(owner);
+ }
+
+ /**
+ * Add a comment to the body.
+ * @param comment the comment.
+ */
+ public void addBodyElement(Comment comment)
+ {
+ bodyElements.add(comment);
+ comment.setParent(owner);
+ }
+
+ /**
+ * @return Returns the owner.
+ */
+ public final JET2ASTElement getOwner()
+ {
+ return owner;
+ }
+
+ /**
+ * Return the element after the passed element
+ * @param element an element in the list
+ * @return the next element or <code>null</code>
+ * @throws IllegalArgumentException if element is not in the body
+ */
+ public JET2ASTElement elementAfter(JET2ASTElement element)
+ {
+ JET2ASTElement nextElement = null;
+ if (bodyElements == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ int index = bodyElements.indexOf(element);
+ if (index == -1)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ if (index + 1 < bodyElements.size())
+ {
+ nextElement = (JET2ASTElement)bodyElements.get(index + 1);
+ }
+ return nextElement;
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/Comment.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/Comment.java
new file mode 100644
index 0000000..c95e140
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/Comment.java
@@ -0,0 +1,85 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.jet.compiler;
+
+
+/**
+ * An JET2 AST element representing a comment
+ *
+ */
+public class Comment extends JET2ASTElement
+{
+
+ private final int commentStart;
+
+ private final int commentEnd;
+
+ private final char[] comment;
+
+ /**
+ * Create a comment element
+ * @param ast the root AST object to to which the comment will be long
+ * @param line the start line of the comment
+ * @param start the start offset (doc relative) of the comment
+ * @param end the end offset of the comment
+ * @param commentStart the start offset of the comment text (doc relative)
+ * @param commentEnd the end offset of the comment text (doc relative)
+ * @param comment the comment text
+ */
+ Comment(JET2AST ast, int line, int start, int end, int commentStart, int commentEnd, char[] comment)
+ {
+ super(ast, line, start, end);
+ this.commentStart = commentStart;
+ this.commentEnd = commentEnd;
+ this.comment = comment;
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.JET2ASTElement#accept(org.eclipse.jet.compiler.JET2ASTVisitor)
+ */
+ public void accept(JET2ASTVisitor visitor)
+ {
+ visitor.visit(this);
+
+ }
+
+ /**
+ * @return Returns the commentEnd.
+ */
+ public int getCommentEnd()
+ {
+ return commentEnd;
+ }
+
+ /**
+ * @return Returns the commentStart.
+ */
+ public int getCommentStart()
+ {
+ return commentStart;
+ }
+
+ /**
+ * Return the comment text
+ * @return the comment text
+ */
+ public String getCommentText()
+ {
+ return new String(comment);
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/DefaultJET2ASTVisitor.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/DefaultJET2ASTVisitor.java
new file mode 100644
index 0000000..af64346
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/DefaultJET2ASTVisitor.java
@@ -0,0 +1,125 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.compiler;
+
+
+/**
+ * An implementation of the {@link org.eclipse.jet.compiler.JET2ASTVisitor} that does nothing.
+ * Override any of the visit or endVisit methods to create an operational visitor.
+ *
+ */
+public abstract class DefaultJET2ASTVisitor implements JET2ASTVisitor
+{
+
+ /**
+ *
+ */
+ public DefaultJET2ASTVisitor()
+ {
+ super();
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.JET2ASTVisitor#visit(org.eclipse.jet.compiler.JET2CompilationUnit)
+ */
+ public void visit(JET2CompilationUnit compilationUnit)
+ {
+ // do nothing
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.JET2ASTVisitor#endVisit(org.eclipse.jet.compiler.JET2CompilationUnit)
+ */
+ public void endVisit(JET2CompilationUnit compilationUnit)
+ {
+ // do nothing
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.JET2ASTVisitor#visit(org.eclipse.jet.compiler.JET2Declaration)
+ */
+ public void visit(JET2Declaration declaration)
+ {
+ // do nothing
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.JET2ASTVisitor#visit(org.eclipse.jet.compiler.JET2Directive)
+ */
+ public void visit(JET2Directive directive)
+ {
+ // do nothing
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.JET2ASTVisitor#visit(org.eclipse.jet.compiler.JET2Expression)
+ */
+ public void visit(JET2Expression expression)
+ {
+ // do nothing
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.JET2ASTVisitor#visit(org.eclipse.jet.compiler.JET2Scriptlet)
+ */
+ public void visit(JET2Scriptlet scriptlet)
+ {
+ // do nothing
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.JET2ASTVisitor#visit(org.eclipse.jet.compiler.TextElement)
+ */
+ public void visit(TextElement text)
+ {
+ // do nothing
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.JET2ASTVisitor#visit(org.eclipse.jet.compiler.XMLEmptyElement)
+ */
+ public void visit(XMLEmptyElement xmlEmptyElement)
+ {
+ // do nothing
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.JET2ASTVisitor#visit(org.eclipse.jet.compiler.XMLBodyElement)
+ */
+ public void visit(XMLBodyElement xmlBodyElement)
+ {
+ // do nothing
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.JET2ASTVisitor#endVisit(org.eclipse.jet.compiler.XMLBodyElement)
+ */
+ public void endVisit(XMLBodyElement xmlBodyElement)
+ {
+ // do nothing
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.JET2ASTVisitor#visit(org.eclipse.jet.compiler.Comment)
+ */
+ public void visit(Comment comment)
+ {
+ // do nothing
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2AST.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2AST.java
new file mode 100644
index 0000000..85a3ef3
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2AST.java
@@ -0,0 +1,154 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.jet.compiler;
+
+
+import java.util.Map;
+
+import org.eclipse.jet.taglib.TagDefinition;
+
+
+/**
+ * The root AST object
+ *
+ */
+class JET2AST
+{
+
+ /**
+ * Create an instance
+ */
+ public JET2AST()
+ {
+ // do nothing
+ }
+
+ /**
+ * Create a text element in the AST
+ * @param chars the text
+ * @return the new element
+ */
+ TextElement createTextElement(char[] chars)
+ {
+ return new TextElement(this, chars);
+ }
+
+ /**
+ * Create a new Directive element in the AST
+ * @param line the start line
+ * @param start the start offset (doc relative)
+ * @param end the end offset (doc relative)
+ * @param directiveName the directive name
+ * @param attributes a map off attribute names and values
+ * @return the new element
+ */
+ JET2Directive createDirective(int line, int start, int end, String directiveName, Map attributes)
+ {
+ return new JET2Directive(this, line, start, end, directiveName, attributes);
+ }
+
+ /**
+ * Create a new Java Expression element in the AST
+ * @param line the start line
+ * @param start the offset of the expression element (doc relative)
+ * @param end the end offset of the expression element (doc relative)
+ * @param javaStart the offset of the Java code (doc relative)
+ * @param javaEnd the end offset of the Java code
+ * @param javaContent the Java content
+ * @return the new element
+ */
+ JET2Expression createExpression(int line, int start, int end, int javaStart, int javaEnd, char[] javaContent)
+ {
+ return new JET2Expression(this, line, start, end, javaStart, javaEnd, javaContent);
+ }
+
+ /**
+ * Create a new Java Scriptlet element in the AST
+ * @param line the start line
+ * @param start the offset of the scriptlet element (doc relative)
+ * @param end the end offset of the scriplet element (doc relative)
+ * @param javaStart the offset of the Java code (doc relative)
+ * @param javaEnd the end offset of the Java code
+ * @param javaContent the Java content
+ * @return the new element
+ */
+ JET2Scriptlet createScriplet(int line, int start, int end, int javaStart, int javaEnd, char[] javaContent)
+ {
+ return new JET2Scriptlet(this, line, start, end, javaStart, javaEnd, javaContent);
+ }
+
+ /**
+ * Create a new Java Declaration element in the AST
+ * @param line the start line
+ * @param start the offset of the declaration element (doc relative)
+ * @param end the end offset of the declaration element (doc relative)
+ * @param javaStart the offset of the Java code (doc relative)
+ * @param javaEnd the end offset of the Java code
+ * @param javaContent the Java content
+ * @return the new element
+ */
+ JET2Declaration createDeclaration(int line, int start, int end, int javaStart, int javaEnd, char[] javaContent)
+ {
+ return new JET2Declaration(this, line, start, end, javaStart, javaEnd, javaContent);
+ }
+
+ /**
+ * Create a new empty XML element in the AST
+ * @param line the start line of the element
+ * @param start the start offset of the element (doc relative)
+ * @param end the end offset of the element (doc relative)
+ * @param tagName the QName of the element
+ * @param attributeMap a Map off element attribute names and values
+ * @param td the TagDefinition of the element
+ * @return the new element
+ */
+ XMLEmptyElement createXMLEmptyElement(int line, int start, int end, String tagName, Map attributeMap, TagDefinition td)
+ {
+ return new XMLEmptyElement(this, line, start, end, tagName, attributeMap, td);
+ }
+
+ /**
+ * Create a new XML element with body in the AST
+ * @param line the start line of the element
+ * @param start the start offset of the element (doc relative)
+ * @param end the end offset of the element (doc relative)
+ * @param tagName the QName of the element
+ * @param attributeMap a Map off element attribute names and values
+ * @param td the TagDefinition of the tag
+ * @return the new element
+ */
+ XMLBodyElement createXMLBodyElement(int line, int start, int end, String tagName, Map attributeMap, TagDefinition td)
+ {
+ return new XMLBodyElement(this, line, start, end, tagName, attributeMap, td);
+ }
+
+ /**
+ * Create a new Comment element in the AST
+ * @param line the start line of the element
+ * @param start the start offset of the element (doc relative)
+ * @param end the end offset of the element (doc relative)
+ * @param commentStart the start offset of the comment text (doc relative)
+ * @param commentEnd the end offset of the comment text (doc relative)
+ * @param comment the comment text
+ * @return the new element
+ */
+ Comment createComment(int line, int start, int end, int commentStart, int commentEnd, char[] comment)
+ {
+ return new Comment(this, line, start, end, commentStart, commentEnd, comment);
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2ASTElement.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2ASTElement.java
new file mode 100644
index 0000000..d2fb7e4
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2ASTElement.java
@@ -0,0 +1,136 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.jet.compiler;
+
+
+/**
+ * An abstract class representing common aspects of all JET2 AST elements.
+ *
+ */
+public abstract class JET2ASTElement
+{
+
+ private final int start;
+
+ private final int end;
+
+ private final JET2AST ast;
+
+ private final int line;
+
+ private JET2ASTElement parent = null;
+
+ /**
+ * @return Returns the parent.
+ */
+ public final JET2ASTElement getParent()
+ {
+ return parent;
+ }
+
+ /**
+ * Set the parent element
+ * @param parent The parent to set.
+ */
+ final void setParent(JET2ASTElement parent)
+ {
+ this.parent = parent;
+ }
+
+ /**
+ * Construct a new AST element
+ * @param ast the AST root
+ * @param line the line of the element
+ * @param start the start offset of the element
+ * @param end the end offset of the element
+ *
+ */
+ JET2ASTElement(JET2AST ast, int line, int start, int end)
+ {
+ super();
+ this.ast = ast;
+ // ugh! - JETMark seems to be feeding off-by-one line numbers. Fix it here?
+ this.line = line != -1 ? line + 1 : line;
+ this.start = start;
+ this.end = end;
+ }
+
+ /**
+ * The document relative offset of the start of the element.
+ * @return the start offset
+ */
+ public final int getStart()
+ {
+ return start;
+ }
+
+ /**
+ * The document relative offset of the first character after the element.
+ * @return the end offset
+ */
+ public final int getEnd()
+ {
+ return end;
+ }
+
+ /**
+ * Visit the AST and its contained elements.
+ * @param visitor
+ */
+ public abstract void accept(JET2ASTVisitor visitor);
+
+ /**
+ * Return the AST root object
+ * @return the AST root object
+ */
+ JET2AST getAst()
+ {
+ return ast;
+ }
+
+ /**
+ * Return the line the element starts on
+ * @return the line
+ */
+ public final int getLine()
+ {
+ return line;
+ }
+
+ public final JET2ASTElement getNextSibling()
+ {
+ JET2ASTElement next = null;
+ if (parent != null)
+ {
+ BodyElements bodyElements = null;
+ if (parent instanceof JET2CompilationUnit)
+ {
+ bodyElements = ((JET2CompilationUnit)parent).getInternalBodyElements();
+ }
+ else if (parent instanceof XMLBodyElement)
+ {
+ bodyElements = ((XMLBodyElement)parent).getInternalBodyElements();
+ }
+ if (bodyElements != null)
+ {
+ next = bodyElements.elementAfter(this);
+ }
+ }
+ return next;
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2ASTVisitor.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2ASTVisitor.java
new file mode 100644
index 0000000..58d104b
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2ASTVisitor.java
@@ -0,0 +1,94 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.compiler;
+
+
+/**
+ * Define a visitor to the JET2 AST tree.
+ *
+ */
+public interface JET2ASTVisitor
+{
+
+ /**
+ * Visit a JET2CompilationUnit element, prior to visiting its body elements.
+ * @param compilationUnit
+ */
+ public abstract void visit(JET2CompilationUnit compilationUnit);
+
+ /**
+ * Visit a JET2CompilationUnit element, after visiting its body elements.
+ * @param compilationUnit
+ */
+ public abstract void endVisit(JET2CompilationUnit compilationUnit);
+
+ /**
+ * Visit a JET2Declaration.
+ * @param declaration
+ */
+ public abstract void visit(JET2Declaration declaration);
+
+ /**
+ * Visit a JET2Directive.
+ * @param directive
+ */
+ public abstract void visit(JET2Directive directive);
+
+ /**
+ * Visit a JET2Expression.
+ * @param expression
+ */
+ public abstract void visit(JET2Expression expression);
+
+ /**
+ * Visit a JET2Scriptlet.
+ * @param scriptlet
+ */
+ public abstract void visit(JET2Scriptlet scriptlet);
+
+ /**
+ * Visit a TextElement.
+ * @param text
+ */
+ public abstract void visit(TextElement text);
+
+ /**
+ * Visit an XMLEmptyElement.
+ * @param xmlEmptyElement
+ */
+ public abstract void visit(XMLEmptyElement xmlEmptyElement);
+
+ /**
+ * Visit an XMLBodyElement, prior to visiting its body elements.
+ * @param xmlBodyElement
+ */
+ public abstract void visit(XMLBodyElement xmlBodyElement);
+
+ /**
+ * Visit an XMLBodyElement, after visiting its body elements.
+ * @param xmlBodyElement
+ */
+ public abstract void endVisit(XMLBodyElement xmlBodyElement);
+
+ /**
+ * Visit a Comment element.
+ * @param comment
+ */
+ public abstract void visit(Comment comment);
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2CompilationUnit.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2CompilationUnit.java
new file mode 100644
index 0000000..5af9892
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2CompilationUnit.java
@@ -0,0 +1,297 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.compiler;
+
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.codegen.jet.JETException;
+import org.eclipse.jet.internal.compiler.CommentElementDelegate;
+import org.eclipse.jet.internal.compiler.DeclarationElementDelegate;
+import org.eclipse.jet.internal.compiler.XMLElementDelegate;
+import org.eclipse.jet.internal.parser.JETCoreElement;
+import org.eclipse.jet.internal.parser.JETParser;
+import org.eclipse.jet.internal.parser.JETReader;
+import org.eclipse.jet.internal.parser.ParseProblemSeverity;
+
+
+/**
+ * Represent a compilation unit (a template) in the JET2 AST.
+ *
+ */
+public final class JET2CompilationUnit extends JET2ASTElement
+{
+
+ private BodyElements bodyElements = null;
+
+ private final List problems = new ArrayList();
+
+ private final String fileName;
+
+ private String outputJavaPackage = null; //"org.eclipse.jet.compiled";
+
+ private String outputJavaClassName;
+
+ private boolean errors = false;
+
+ private boolean warnings = false;
+
+ private final IFile file;
+
+ public JET2CompilationUnit()
+ {
+ super(new JET2AST(), -1, -1, -1);
+ this.fileName = ""; //$NON-NLS-1$
+ this.file = null;
+ }
+
+ public JET2CompilationUnit(IFile file)
+ {
+ super(new JET2AST(), -1, -1, -1);
+ this.file = file;
+ this.fileName = file.getFullPath().toString();
+ }
+
+ public void parse(String document)
+ {
+ final String ENCODING = "UTF-8"; //$NON-NLS-1$
+ try
+ {
+ InputStream is = new ByteArrayInputStream(document.getBytes(ENCODING));
+ internalParse(is, ENCODING);
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ // Should not happen
+ throw new RuntimeException("Should not have happened", e); //$NON-NLS-1$
+ }
+
+ }
+
+ public void parse() throws CoreException
+ {
+ if (file == null)
+ {
+ throw new IllegalStateException();
+ }
+
+ final InputStream contents = file.getContents();
+ final String charset = file.getCharset();
+ internalParse(contents, charset);
+
+ }
+
+ public void parse(InputStream contents, String charset)
+ {
+ internalParse(contents, charset);
+ }
+
+ /**
+ * @param contents
+ * @param charset
+ */
+ private void internalParse(final InputStream contents, final String charset)
+ {
+ // reset parse state...
+ problems.clear();
+ errors = false;
+ warnings = false;
+ bodyElements = null;
+ outputJavaPackage = null; // "org.eclipse.jet.compiled";
+ outputJavaClassName = null;
+
+ try
+ {
+ JETReader reader = new JETReader(fileName, contents, charset);
+ ASTCompilerParseListener listener = new ASTCompilerParseListener(this, reader);
+ JETParser.Directive directive = new JETParser.Directive();
+ directive.getDirectives().add("jet"); //$NON-NLS-1$
+ directive.getDirectives().add("taglib"); //$NON-NLS-1$
+ JETCoreElement[] coreElements = new JETCoreElement []{
+ directive,
+ new JETParser.Expression(),
+ new CommentElementDelegate(),
+ new DeclarationElementDelegate(),
+ new JETParser.Scriptlet(),
+ new XMLElementDelegate(), };
+ JETParser parser = new JETParser(reader, listener, coreElements);
+
+ listener.beginPageProcessing();
+ parser.parse();
+ listener.endPageProcessing();
+
+ return;
+ }
+ catch (JETException e)
+ {
+ // create a minimal compilation unit with the exeception recorded as the error.
+ this.createProblem(ParseProblemSeverity.ERROR, Problem.JETException, e.getLocalizedMessage(), null, -1, -1, -1);
+ }
+ finally
+ {
+ try
+ {
+ contents.close();
+ }
+ catch (IOException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /**
+ * Return the internal BodyElements object that gives access to an updateable
+ * list of AST elements the the compilation unit contains
+ * @return a BodyElements object
+ */
+ BodyElements getInternalBodyElements()
+ {
+ if (bodyElements == null)
+ {
+ bodyElements = new BodyElements(this);
+ }
+ return bodyElements;
+ }
+
+ /**
+ * Return a {@link List} of JET2 AST element (@link JET2ASTElement} instances.
+ * @return a List. The empty list of there are no body elements.
+ */
+ public final List getBodyElements()
+ {
+ if (bodyElements == null)
+ {
+ return Collections.EMPTY_LIST;
+ }
+ else
+ {
+ return bodyElements.getBodyElements();
+ }
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.JET2ASTElement#accept(org.eclipse.jet.compiler.JET2ASTVisitor)
+ */
+ public void accept(JET2ASTVisitor visitor)
+ {
+ visitor.visit(this);
+ for (Iterator i = getBodyElements().iterator(); i.hasNext();)
+ {
+ JET2ASTElement element = (JET2ASTElement)i.next();
+ element.accept(visitor);
+ }
+ visitor.endVisit(this);
+ }
+
+ /**
+ * Return a list of problems discovered in the compilation unit
+ * @return a List of {@link Problem} objects. The empty list is returned if no problems were found.
+ */
+ public List getProblems()
+ {
+ return Collections.unmodifiableList(problems);
+ }
+
+ /**
+ * Test if the compilation unit has any errors
+ * @return <code>true</code> if the compilation unit had errors, <code>false</code> otherwise.
+ */
+ public boolean hasErrors()
+ {
+ return errors;
+ }
+
+ /**
+ * Test if the compilation unit has any warnings
+ * @return <code>true</code> if the compilation unit had warnings, <code>false</code> otherwise.
+ */
+ public boolean hasWarnings()
+ {
+ return warnings;
+ }
+
+ /**
+ * Create a new problem on the compilation unit
+ * @param error the severity of the problem
+ * @param problemId the problem id. A value from {@link Problem} static files
+ * @param message an error message, with optional replacement tokens
+ * @param messageArgs the error message arguments
+ * @param start the start offset of the problem (doc relative)
+ * @param end the end offset of the problem (doc relative)
+ * @param line the line number of the problem (1 based)
+ */
+ public void createProblem(ParseProblemSeverity error, int problemId, String message, Object[] messageArgs, int start, int end, int line)
+ {
+ if (error == ParseProblemSeverity.ERROR)
+ {
+ errors = true;
+ }
+ else if (error == ParseProblemSeverity.WARNING)
+ {
+ warnings = true;
+ }
+ problems.add(new Problem(fileName, error, problemId, message, messageArgs, start, end, line));
+ }
+
+ /**
+ * Return the name of the Java package to which the compilation unit will be compiled.
+ * @return a string
+ */
+ public String getOutputJavaPackage()
+ {
+ return outputJavaPackage;
+ }
+
+ /**
+ * Return the unqualified name of the Java class into which the compilation unit will be compiled.
+ * @return Returns the outputJavaClassName.
+ */
+ public String getOutputJavaClassName()
+ {
+ return outputJavaClassName;
+ }
+
+ /**
+ * Set the unqualifeid name of the Java class into which the compilation unit will be compiled.
+ * @param outputJavaClassName The outputJavaClassName to set.
+ */
+ public void setOutputJavaClassName(String outputJavaClassName)
+ {
+ this.outputJavaClassName = outputJavaClassName;
+ }
+
+ /**
+ * Set the Java package into which the compilation unit will be compiled.
+ * @param outputJavaPackage The outputJavaPackage to set.
+ */
+ public void setOutputJavaPackage(String outputJavaPackage)
+ {
+ this.outputJavaPackage = outputJavaPackage;
+ }
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Compiler.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Compiler.java
new file mode 100644
index 0000000..c080c41
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Compiler.java
@@ -0,0 +1,496 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.compiler;
+
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.util.Iterator;
+import java.util.Properties;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jet.JET2Platform;
+import org.eclipse.jet.internal.InternalJET2Platform;
+import org.eclipse.jet.internal.compiler.JET2CompilerState;
+import org.eclipse.jet.internal.compiler.templates.JET2JavaGenerator;
+import org.eclipse.jet.internal.compiler.templates.JET2TransformGenerator;
+import org.eclipse.jet.internal.l10n.JET2Messages;
+import org.eclipse.jet.internal.parser.ParseProblemSeverity;
+
+
+/**
+ * The compiler that turns a JET2 sources files Java files in the Eclipse workspace.
+ *
+ */
+public class JET2Compiler
+{
+
+ public static final String RUNTIME_PROBLEM_MARKER = JET2Platform.PLUGIN_ID + ".runtimeProblem"; //$NON-NLS-1$
+
+ /**
+ * Compiler option specifying which extensions are recognized as extensions; value: "templateExt".
+ */
+ public static final String OPTION_TEMPLATE_EXT = "templateExt"; //$NON-NLS-1$
+
+ /**
+ * Compiler option specifying the package to which compiled templates are written; value: "compiledTemplatePackage".
+ */
+ public static final String OPTION_COMPILED_TEMPLATE_PACKAGE = "compiledTemplatePackage"; //$NON-NLS-1$
+
+ /**
+ * Compiler option specifying the name of the generated template loader class; value: "templateLoaderClass".
+ */
+ public static final String OPTION_TEMPLATE_LOADER_CLASS = "templateLoaderClass"; //$NON-NLS-1$
+
+ /**
+ * Compiler option specifying the package to which the generated template laoder class is written; value: "templateLoaderPackage".
+ */
+ public static final String OPTION_TEMPLATE_LOADER_PACKAGE = "templateLoaderPackage"; //$NON-NLS-1$
+
+ /**
+ * Compiler option specifying the Java project source directory to which compiled templates are written; value: "compiledTemplateSrcDir".
+ */
+ public static final String OPTION_COMPILED_TEMPLATE_SRC_DIR = "compiledTemplateSrcDir"; //$NON-NLS-1$
+
+ /**
+ * The default value of the {@link #OPTION_COMPILED_TEMPLATE_PACKAGE} option; value: "org.eclipse.jet2.internal.compiled".
+ */
+ public static final String DEFAULT_COMPILED_TEMPLATE_PACKAGE = "org.eclipse.jet.compiled"; //$NON-NLS-1$
+
+ /**
+ * The default value of the {@link #OPTION_TEMPLATE_EXT} option; value: "jet".
+ */
+ public static final String DEFAULT_TEMPLATE_EXT = "jet"; //$NON-NLS-1$
+
+ /**
+ * The default value of the {@link #OPTION_TEMPLATE_LOADER_CLASS} option; value: "_jet_transformation".
+ */
+ public static final String DEFAULT_TEMPLATE_LOADER_CLASS = "_jet_transformation"; //$NON-NLS-1$
+
+ /**
+ * The default value of the {@link #OPTION_TEMPLATE_LOADER_PACKAGE} option; value: "org.eclipse.jet.compiled".
+ */
+ public static final String DEFAULT_TEMPLATE_LOADER_PACKAGE = "org.eclipse.jet.compiled"; //$NON-NLS-1$
+
+ /**
+ * The default value of the {@link #OPTION_COMPILED_TEMPLATE_SRC_DIR} option; value: "jet2java".
+ */
+ public static final String DEFAULT_COMPILED_TEMPLATE_SRC_DIR = "jet2java"; //$NON-NLS-1$
+
+ /**
+ * The Marker created by the compiler on all identified problems.
+ */
+ public static final String COMPILE_PROBLEM_MARKER = JET2Platform.PLUGIN_ID + ".compileProblem"; //$NON-NLS-1$
+
+ private final IProgressMonitor monitor;
+
+ private final IProject project;
+
+ private JET2CompilerState compilerState;
+
+ private int noCompiles;
+
+ private final Properties options;
+
+ /**
+ * Create an instance
+ * @param project the project upon which the compiler will act
+ * @param monitor a progress monitor for compiler actions
+ * @param options TODO
+ *
+ */
+ public JET2Compiler(IProject project, IProgressMonitor monitor, Properties options)
+ {
+ super();
+ this.project = project;
+ this.monitor = monitor;
+ this.options = options == null ? new Properties() : options;
+ this.compilerState = InternalJET2Platform.getCompilerState(project);
+
+ this.noCompiles = 0;
+
+ }
+
+ /**
+ * Create the Template Loader class for the project
+ */
+ public void createTransformFiles()
+ {
+ createTemplateLoaderClass();
+ }
+
+ /**
+ * Create the Class that loads compiled templates.
+ */
+ private void createTemplateLoaderClass()
+ {
+ String src = new JET2TransformGenerator().generate(compilerState.getTemplateMap());
+
+ IPath targetPath = new Path(options.getProperty(OPTION_COMPILED_TEMPLATE_SRC_DIR, DEFAULT_COMPILED_TEMPLATE_SRC_DIR)).append(
+ options.getProperty(OPTION_TEMPLATE_LOADER_PACKAGE, DEFAULT_TEMPLATE_LOADER_PACKAGE).replace('.', '/')).append(
+ options.getProperty(OPTION_TEMPLATE_LOADER_CLASS, DEFAULT_TEMPLATE_LOADER_CLASS)).addFileExtension("java"); //$NON-NLS-1$
+
+ try
+ {
+ writeFile(src, project.getFile(targetPath));
+ }
+ catch (CoreException e)
+ {
+ InternalJET2Platform.logError(JET2Messages.JET2Compiler_ErrorWritingJava, e);
+ }
+ }
+
+ /**
+ * Test whether the supplied resource is a compilable JET2 source file.
+ * @param resource
+ * @return <code>true</code> if the identified resource is a jet2 source file
+ */
+ public boolean isJET2SourceFile(IResource resource)
+ {
+ String ext = resource.getFileExtension();
+ // TODO Figure out whether the resource is in a templates directory or not.
+
+ return resource.getType() == IResource.FILE && ext != null
+ && ext.endsWith(options.getProperty(OPTION_TEMPLATE_EXT, DEFAULT_TEMPLATE_EXT));
+ }
+
+ /**
+ * Compile the passed resource into a Java file. Does nothing if the passed resource
+ * is not a JET2 template.
+ * @param resource a project resource
+ */
+ public void compile(IResource resource)
+ {
+ if (!isJET2SourceFile(resource))
+ {
+ return; // ignore
+ }
+
+ ++noCompiles;
+
+ IFile file = (IFile)resource;
+
+ try
+ {
+ resource.deleteMarkers(COMPILE_PROBLEM_MARKER, false, IResource.DEPTH_INFINITE);
+ resource.deleteMarkers(RUNTIME_PROBLEM_MARKER, false, IResource.DEPTH_INFINITE);
+ }
+ catch (CoreException e)
+ {
+ InternalJET2Platform.logError(JET2Messages.JET2Compiler_ErrorRemovingMarkers, e);
+ }
+
+ JET2CompilationUnit cu = new JET2CompilationUnit(file);
+ try
+ {
+ cu.parse();
+
+ cu.accept(new TagValidationVisitor(cu));
+
+ markProblems(resource, cu);
+
+ if (!cu.hasErrors())
+ {
+ cu.accept(new TextRewritingVisitor());
+ writeCompiledOutput(file, cu);
+ }
+ }
+ catch (CoreException e)
+ {
+ // core exceptions represent problems reading the source file
+ createParseExceptionMarker(resource, e);
+ }
+
+ }
+
+ private void createParseExceptionMarker(IResource resource, CoreException e)
+ {
+ try
+ {
+ IMarker marker = resource.createMarker(COMPILE_PROBLEM_MARKER);
+ marker.setAttribute(IMarker.MESSAGE, e.getStatus().getMessage());
+ marker.setAttribute(IMarker.PRIORITY, IMarker.PRIORITY_HIGH);
+ marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
+ }
+ catch (CoreException ex)
+ {
+ InternalJET2Platform.logError(JET2Messages.JET2Compiler_ErrorCreatingMarkers, e);
+ }
+ }
+
+ /**
+ * Place problem markers on the passed resource for each problem recorded in the compilation unit.
+ * @param resource the resource to mark
+ * @param cu the compilation unit corresponding to the resource
+ */
+ private void markProblems(IResource resource, JET2CompilationUnit cu)
+ {
+ try
+ {
+ for (Iterator i = cu.getProblems().iterator(); i.hasNext();)
+ {
+ Problem problem = (Problem)i.next();
+ IMarker marker = resource.createMarker(COMPILE_PROBLEM_MARKER);
+ marker.setAttribute(IMarker.LINE_NUMBER, problem.getLineNumber());
+ marker.setAttribute(IMarker.CHAR_START, problem.getStart());
+ marker.setAttribute(IMarker.CHAR_END, problem.getEnd());
+ marker.setAttribute(IMarker.MESSAGE, problem.getMessage());
+ marker.setAttribute(IMarker.PRIORITY, IMarker.PRIORITY_HIGH);
+ if (problem.getSeverity() == ParseProblemSeverity.ERROR)
+ {
+ marker.setAttribute(IMarker.PRIORITY, IMarker.PRIORITY_HIGH);
+ marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
+ }
+ else if (problem.getSeverity() == ParseProblemSeverity.WARNING)
+ {
+ marker.setAttribute(IMarker.PRIORITY, IMarker.PRIORITY_NORMAL);
+ marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_WARNING);
+ }
+ else
+ {
+ marker.setAttribute(IMarker.PRIORITY, IMarker.PRIORITY_LOW);
+ marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO);
+ }
+ }
+ }
+ catch (CoreException e)
+ {
+ InternalJET2Platform.logError(JET2Messages.JET2Compiler_ErrorWritingJava, e);
+ }
+ }
+
+ /**
+ * @param file
+ * @param cu
+ */
+ private void writeCompiledOutput(IFile file, JET2CompilationUnit cu)
+ {
+
+ ensureJavaOutputSet(file, cu);
+
+ final String templatePath = file.getProjectRelativePath().toString();
+ final String qualifiedClassName = makeFullyQualifiedJavaName(cu.getOutputJavaPackage(), cu.getOutputJavaClassName());
+
+ if (templatePath.equals(compilerState.getTemplateFromClass(qualifiedClassName)))
+ {
+ cu.createProblem(
+ ParseProblemSeverity.ERROR,
+ Problem.MultipleTemplatesWithSameJavaClass,
+ JET2Messages.JET2Compiler_SameJavaClassAsOther,
+ new Object []{ qualifiedClassName, compilerState.getTemplateFromClass(qualifiedClassName), },
+ -1,
+ -1,
+ -1);
+ }
+
+ JET2JavaGenerator gen = new JET2JavaGenerator();
+ String javaSrc = gen.generate(cu);
+
+ IFile targetFile = file.getProject().getFile(javaClassProjectPath(qualifiedClassName));
+ try
+ {
+ // XXX: Temporarily restore .jet files that were set to derived by an earlier version of this compiler.
+ // XXX: Remove before shipping.
+ if (file.isDerived())
+ {
+ file.setDerived(false);
+ }
+ writeFile(javaSrc, targetFile);
+ targetFile.setDerived(true);
+ compilerState.mapTemplate(templatePath, qualifiedClassName);
+ }
+ catch (CoreException e)
+ {
+ InternalJET2Platform.logError(JET2Messages.JET2Compiler_ErrorWritingJava, e);
+ }
+ }
+
+ /**
+ * Ensure the the compilation unit has Java output package and class
+ * set. If not, generate names for these, taking into account that
+ * a name may have been generated for them already.
+ * @param file
+ * @param cu
+ */
+ private void ensureJavaOutputSet(IFile file, JET2CompilationUnit cu)
+ {
+ final String templatePath = file.getProjectRelativePath().toString();
+
+ // See if we already have a name for this...
+ final String existingQualifiedClass = (String)compilerState.getTemplateMap().get(templatePath);
+
+ if (existingQualifiedClass == null)
+ {
+ // we haven't generated a name before, do it now...
+ if (cu.getOutputJavaPackage() == null)
+ {
+ cu.setOutputJavaPackage(options.getProperty(OPTION_COMPILED_TEMPLATE_PACKAGE, DEFAULT_COMPILED_TEMPLATE_PACKAGE));
+ }
+ if (cu.getOutputJavaClassName() == null)
+ {
+ // check for conflicts because we have name mangled
+ // or for identically named files in different directories.
+ String baseClassName = makeJavaClassName(file.getFullPath().removeFileExtension().lastSegment());
+
+ String className = baseClassName;
+ String potentialQualifiedName = makeFullyQualifiedJavaName(cu.getOutputJavaPackage(), className);
+
+ for (int i = 0; compilerState.getTemplateFromClass(potentialQualifiedName) != null; i++)
+ {
+ className = baseClassName + "_" + i; //$NON-NLS-1$
+ potentialQualifiedName = makeFullyQualifiedJavaName(cu.getOutputJavaPackage(), className);
+ }
+
+ cu.setOutputJavaClassName(className);
+ }
+ }
+ else
+ {
+ int index = existingQualifiedClass.lastIndexOf('.');
+ String existingPackage = index == -1 ? "" : existingQualifiedClass.substring(0, index); //$NON-NLS-1$
+ String existingClass = index == -1 ? existingQualifiedClass : existingQualifiedClass.substring(index + 1);
+
+ if (cu.getOutputJavaPackage() == null)
+ {
+ cu.setOutputJavaPackage(existingPackage);
+ }
+ if (cu.getOutputJavaClassName() == null)
+ {
+ cu.setOutputJavaClassName(existingClass);
+ }
+ }
+
+ }
+
+ /**
+ * @param javaClassName
+ * @return the project relative path of the generated java file
+ */
+ private IPath javaClassProjectPath(String javaClassName)
+ {
+ IPath targetPath = new Path(DEFAULT_COMPILED_TEMPLATE_SRC_DIR).append(javaClassName.replace('.', '/')).addFileExtension("java"); //$NON-NLS-1$
+ return targetPath;
+ }
+
+ private String makeFullyQualifiedJavaName(String javaPackage, String javaClassName)
+ {
+ return javaPackage == null || javaPackage.trim().length() == 0 ? javaClassName : javaPackage + '.' + javaClassName;
+ }
+
+ /**
+ * @param javaSrc
+ * @param targetFile
+ * @throws CoreException
+ */
+ private void writeFile(String javaSrc, IFile targetFile) throws CoreException
+ {
+ ensureDirsExist(targetFile.getParent());
+
+ InputStream is = inputStreamForString(javaSrc, targetFile.getCharset());
+ if (targetFile.exists())
+ {
+ targetFile.setContents(is, true, true, monitor);
+ }
+ else
+ {
+ targetFile.create(is, true, monitor);
+ }
+ }
+
+ private InputStream inputStreamForString(String src, String charset) throws CoreException
+ {
+ try
+ {
+ return new ByteArrayInputStream(src.getBytes(charset));
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ throw new CoreException(new Status(IStatus.ERROR, JET2Platform.PLUGIN_ID, IStatus.OK, e.getMessage(), e));
+ }
+ }
+
+ private void ensureDirsExist(IContainer container) throws CoreException
+ {
+ if (container != null && !container.exists() && container.getType() == IResource.FOLDER)
+ {
+ ensureDirsExist(container.getParent());
+ ((IFolder)container).create(false, true, monitor);
+ }
+ }
+
+ private String makeJavaClassName(String name)
+ {
+ StringBuffer result = new StringBuffer("_jet_"); //$NON-NLS-1$
+ for (int i = 0; i < name.length(); i++)
+ {
+ char c = name.charAt(i);
+ if (Character.isJavaIdentifierPart(c))
+ {
+ result.append(c);
+ }
+ }
+ return result.toString();
+ }
+
+ /**
+ * Remove any derived resources for this resource
+ * @param resource
+ * @throws CoreException if a derived resource cannot be removed.
+ */
+ public void removeDerivedResources(IResource resource) throws CoreException
+ {
+ if (!isJET2SourceFile(resource))
+ {
+ return; // ignore
+ }
+
+ String javaClassName = (String)compilerState.getTemplateMap().get(resource.getProjectRelativePath().toString());
+ if (javaClassName != null)
+ {
+ compilerState.unmapTemplate(resource.getProjectRelativePath().toString());
+ IPath javaSrcFile = javaClassProjectPath(javaClassName);
+
+ IFile file = resource.getProject().getFile(javaSrcFile);
+ if (file.exists())
+ {
+ file.delete(true, monitor);
+ }
+ }
+
+ }
+
+ /**
+ * @return Returns the noCompiles.
+ */
+ public final int getNoCompiles()
+ {
+ return noCompiles;
+ }
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Declaration.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Declaration.java
new file mode 100644
index 0000000..df3f423
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Declaration.java
@@ -0,0 +1,51 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.compiler;
+
+
+/**
+ * Define a Java Declaration Element in the JET2 AST
+ *
+ */
+public final class JET2Declaration extends JavaElement
+{
+
+ /**
+ * Create an instance
+ * @param ast the owning AST
+ * @param line the start line of the element
+ * @param start the start offset of the element (doc relative)
+ * @param end the end offset of the element (doc relative)
+ * @param javaStart the start offset of the Java code (doc relative)
+ * @param javaEnd the end offset of the Java code (doc relative)
+ * @param javaContent the Java code
+ */
+ JET2Declaration(JET2AST ast, int line, int start, int end, int javaStart, int javaEnd, char[] javaContent)
+ {
+ super(ast, line, start, end, javaStart, javaEnd, javaContent);
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.JET2ASTElement#accept(org.eclipse.jet.compiler.JET2ASTVisitor)
+ */
+ public void accept(JET2ASTVisitor visitor)
+ {
+ visitor.visit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Directive.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Directive.java
new file mode 100644
index 0000000..f4b13f7
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Directive.java
@@ -0,0 +1,79 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.compiler;
+
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+
+/**
+ * Define a Directive Element in the JET2 AST
+ *
+ */
+public final class JET2Directive extends JET2ASTElement
+{
+
+ private final String name;
+
+ private final Map attributes;
+
+ /**
+ * Create an instance
+ * @param ast the owning JET2 AST
+ * @param line the start line of the directive
+ * @param start the start offset of the directive (doc relative)
+ * @param end the end offset of the directive (doc relative)
+ * @param name the directive name
+ * @param attributes a Map of attribute names to attribute values for the directive
+ */
+ JET2Directive(JET2AST ast, int line, int start, int end, String name, Map attributes)
+ {
+ super(ast, line, start, end);
+ this.name = name;
+ this.attributes = Collections.unmodifiableMap(new HashMap(attributes));
+ }
+
+ /**
+ * Return the directive name
+ * @return the directive name
+ */
+ public final String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Return a Map the directive attribute names to values
+ * @return a Map of the directive attributes (unmodifiable)
+ */
+ public final Map getAttributes()
+ {
+ return attributes;
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.JET2ASTElement#accept(org.eclipse.jet.compiler.JET2ASTVisitor)
+ */
+ public void accept(JET2ASTVisitor visitor)
+ {
+ visitor.visit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Expression.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Expression.java
new file mode 100644
index 0000000..75923ea
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Expression.java
@@ -0,0 +1,52 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.compiler;
+
+
+/**
+ * Define a Java Expression Element in the JET2 AST
+ *
+ */
+
+public final class JET2Expression extends JavaElement
+{
+
+ /**
+ * Create an instance
+ * @param ast the owning AST
+ * @param line the start line of the element
+ * @param start the start offset of the element (doc relative)
+ * @param end the end offset of the element (doc relative)
+ * @param javaStart the start offset of the Java code (doc relative)
+ * @param javaEnd the end offset of the Java code (doc relative)
+ * @param javaContent the Java code
+ */
+ JET2Expression(JET2AST ast, int line, int start, int end, int javaStart, int javaEnd, char[] javaContent)
+ {
+ super(ast, line, start, end, javaStart, javaEnd, javaContent);
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.JET2ASTElement#accept(org.eclipse.jet.compiler.JET2ASTVisitor)
+ */
+ public void accept(JET2ASTVisitor visitor)
+ {
+ visitor.visit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Scriptlet.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Scriptlet.java
new file mode 100644
index 0000000..bbb9c85
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Scriptlet.java
@@ -0,0 +1,51 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.compiler;
+
+
+/**
+ * Define a Java Scriptlet Element in the JET2 AST
+ *
+ */
+public final class JET2Scriptlet extends JavaElement
+{
+
+ /**
+ * Create an instance
+ * @param ast the owning AST
+ * @param line the start line of the element
+ * @param start the start offset of the element (doc relative)
+ * @param end the end offset of the element (doc relative)
+ * @param javaStart the start offset of the Java code (doc relative)
+ * @param javaEnd the end offset of the Java code (doc relative)
+ * @param javaContent the Java code
+ */
+ JET2Scriptlet(JET2AST ast, int line, int start, int end, int javaStart, int javaEnd, char[] javaContent)
+ {
+ super(ast, line, start, end, javaStart, javaEnd, javaContent);
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.JET2ASTElement#accept(org.eclipse.jet.compiler.JET2ASTVisitor)
+ */
+ public void accept(JET2ASTVisitor visitor)
+ {
+ visitor.visit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JavaElement.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JavaElement.java
new file mode 100644
index 0000000..c345da1
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JavaElement.java
@@ -0,0 +1,78 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.compiler;
+
+
+/**
+ * Abstract representation of JET2 AST elements that contain Java code
+ *
+ */
+public abstract class JavaElement extends JET2ASTElement
+{
+
+ private final int javaStart;
+
+ private final int javaEnd;
+
+ private final char[] javaContent;
+
+ /**
+ * Create a new instance
+ * @param ast the root AST to which the element belongs
+ * @param line the line in which the element begins
+ * @param start the offset at which the element starts (doc relative)
+ * @param end the offset at which the element ends (doc relative)
+ * @param javaStart the offset at which the Java code starts (doc relative)
+ * @param javaEnd the offset at which the Java code ends (doc relative)
+ * @param javaContent the java code
+ */
+ JavaElement(JET2AST ast, int line, int start, int end, int javaStart, int javaEnd, char[] javaContent)
+ {
+ super(ast, line, start, end);
+ this.javaStart = javaStart;
+ this.javaEnd = javaEnd;
+ this.javaContent = javaContent;
+ }
+
+ /**
+ * The document relative offset of the Java code within the element.
+ * @return the start offset
+ */
+ public final int getJavaStart()
+ {
+ return javaStart;
+ }
+
+ /**
+ * The document relative offset of the first character after the Java code.
+ * @return the end offset
+ */
+ public final int getJavaEnd()
+ {
+ return javaEnd;
+ }
+
+ /**
+ * Return the Java content of the element
+ * @return the Java content
+ */
+ public String getJavaContent()
+ {
+ return new String(javaContent);
+ }
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/Problem.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/Problem.java
new file mode 100644
index 0000000..46041bf
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/Problem.java
@@ -0,0 +1,220 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.compiler;
+
+
+import java.text.MessageFormat;
+
+import org.eclipse.jet.internal.parser.ParseProblemSeverity;
+
+
+/**
+ * Represent a compilation problem on a JET2 tempalte.
+ *
+ */
+public class Problem
+{
+
+ /**
+ * Error Id for an XML end tag that has no corresponding start tag.
+ * @see #getId()
+ */
+ public static final int MissingXmlStartTag = 1;
+
+ /**
+ * Error Id for an XML start tag that has no corresponding end tag.
+ * @see #getId()
+ */
+ public static final int MissingXmlEndTag = 2;
+
+ /**
+ * Error Id for an XML tag or JET directive that is missing a required attribute
+ * @see #getId()
+ */
+ public static final int MissingRequiredAttribute = 3;
+
+ /**
+ * Error Id for taglib directive that defines a prefix defined by a preceding taglib directive
+ * @see #getId()
+ */
+ public static final int DuplicateXMLNamespacePrefix = 4;
+
+ /**
+ * Error Id for taglib directive that defines references an unknown tag library id
+ * @see #getId()
+ */
+ public static final int UnknownTagLibrary = 5;
+
+ /**
+ * Error Id for an attribute that is not defined in the tag definition
+ */
+ public static final int UnknownAttributeInTag = 6;
+
+ /**
+ * Represent an unterminated XML Tag
+ */
+ public static final int UnterminatedXMLTag = 7;
+
+ /**
+ * Represent a duplicate attribute in an XML Tag;
+ */
+ public static final int DuplicateAttribute = 8;
+
+ /**
+ * An underlying JETException was thrown by the JET parser
+ */
+ public static final int JETException = 9;
+
+ /**
+ * Two templates specify that they compile to the same Java Class
+ */
+ public static final int MultipleTemplatesWithSameJavaClass = 10;
+
+ /**
+ * Use of an attribute that has been deprecated.
+ */
+ public static final int DeprecatedAttribute = 11;
+
+ /**
+ * Tag may not have a body - the tag must be of the form &lt;tagName/&gt;.
+ */
+ public static final int TagCannotHaveContent = 12;
+
+ /**
+ * Tag must have content - the tag must be of the form &lt;tagName&gt;xxx&lt;/tagName&gt;.
+ */
+ public static final int TagCannotBeEmpty = 13;
+
+ /**
+ * Use of the tag has been deprecated.
+ */
+ public static final int DeprecatedTag = 14;
+
+ private final String originatingFileName;
+
+ private final int id;
+
+ private final String message;
+
+ private final Object[] messageArgs;
+
+ private final int start;
+
+ private final int end;
+
+ private final int lineNumber;
+
+ private final ParseProblemSeverity severity;
+
+ /**
+ * Create an new instance
+ * @param originatingFileName the file name from which the problem originates
+ * @param severity the severity
+ * @param id the problem id. See static constants declared on this class
+ * @param message the error message in {@link MessageFormat} style
+ * @param messageArgs the error message arguments
+ * @param start the start offset of the problem (doc relative)
+ * @param end the end offset of the problem (doc relative)
+ * @param lineNumber the start line of the problem
+ */
+ public Problem(
+ String originatingFileName,
+ ParseProblemSeverity severity,
+ int id,
+ String message,
+ Object[] messageArgs,
+ int start,
+ int end,
+ int lineNumber)
+ {
+ super();
+ this.originatingFileName = originatingFileName;
+ this.severity = severity;
+ this.id = id;
+ this.message = messageArgs != null && messageArgs.length > 0 ? MessageFormat.format(message, messageArgs) : message;
+ this.messageArgs = messageArgs;
+ this.start = start;
+ this.end = end;
+ this.lineNumber = lineNumber;
+ }
+
+ /**
+ * @return Returns the end.
+ */
+ public int getEnd()
+ {
+ return end;
+ }
+
+ /**
+ * @return Returns the id.
+ */
+ public int getId()
+ {
+ return id;
+ }
+
+ /**
+ * @return Returns the lineNumber.
+ */
+ public int getLineNumber()
+ {
+ return lineNumber;
+ }
+
+ /**
+ * @return Returns the message.
+ */
+ public String getMessage()
+ {
+ return message;
+ }
+
+ /**
+ * @return Returns the messageArgs.
+ */
+ public Object[] getMessageArgs()
+ {
+ return messageArgs;
+ }
+
+ /**
+ * @return Returns the originatingFileName.
+ */
+ public String getOriginatingFileName()
+ {
+ return originatingFileName;
+ }
+
+ /**
+ * @return Returns the severity.
+ */
+ public ParseProblemSeverity getSeverity()
+ {
+ return severity;
+ }
+
+ /**
+ * @return Returns the start.
+ */
+ public int getStart()
+ {
+ return start;
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/TagLibraryUsageManager.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/TagLibraryUsageManager.java
new file mode 100644
index 0000000..8b6694a
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/TagLibraryUsageManager.java
@@ -0,0 +1,87 @@
+/**
+ *
+ */
+package org.eclipse.jet.compiler;
+
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.jet.taglib.TagDefinition;
+import org.eclipse.jet.taglib.TagLibrary;
+import org.eclipse.jet.taglib.TagLibraryManager;
+
+
+/**
+ * A class to manage usage of tag libraries in a JET2 template.
+ *
+ */
+public class TagLibraryUsageManager
+{
+
+ private final Map tagLibraries = new HashMap();
+
+ /**
+ *
+ */
+ public TagLibraryUsageManager()
+ {
+ super();
+ }
+
+ public boolean isPrefixDefined(String prefix)
+ {
+ return tagLibraries.containsKey(prefix);
+ }
+
+ public boolean isLibraryDefined(String libaryId)
+ {
+ return tagLibraries.containsValue(libaryId);
+ }
+
+ public String getLibaryIdFromPrefix(String prefix)
+ {
+ return (String)tagLibraries.get(prefix);
+ }
+
+ public void add(String prefix, String libraryId)
+ {
+ tagLibraries.put(prefix, libraryId);
+ }
+
+ /**
+ * Return the TagDefinition of the selected tag.
+ * @param tagName the QName of the tag
+ * @return the TagDefinition
+ */
+ public TagDefinition getTagDefinition(String tagName)
+ {
+ int sepIndex = tagName.indexOf(':');
+ String prefix = sepIndex == -1 ? "" : tagName.substring(0, sepIndex); //$NON-NLS-1$
+ String tagNCName = sepIndex == -1 ? tagName : tagName.substring(sepIndex + 1);
+ String id = (String)tagLibraries.get(prefix.toLowerCase());
+ TagLibrary tagLibrary = TagLibraryManager.getInstance().getTagLibrary(id);
+ return tagLibrary.getTagDefinition(tagNCName);
+ }
+
+ /**
+ * Test whether the tag name passed is know to this manager
+ * @return <code>true</code> if the tag matches one of the libraries, <code>false</code> otherwise.
+ */
+ public boolean isKnownTag(String tagName)
+ {
+ boolean knownTag = false;
+
+ int sepIndex = tagName.indexOf(':');
+ String prefix = sepIndex == -1 ? "" : tagName.substring(0, sepIndex); //$NON-NLS-1$
+ String tagNCName = sepIndex == -1 ? tagName : tagName.substring(sepIndex + 1);
+ String id = (String)tagLibraries.get(prefix.toLowerCase());
+ if (id != null)
+ {
+ TagLibrary tagLibrary = TagLibraryManager.getInstance().getTagLibrary(id);
+ knownTag = tagLibrary.hasTag(tagNCName);
+ }
+ return knownTag;
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/TagValidationVisitor.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/TagValidationVisitor.java
new file mode 100644
index 0000000..97b64a8
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/TagValidationVisitor.java
@@ -0,0 +1,157 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.compiler;
+
+
+import java.util.Iterator;
+
+import org.eclipse.jet.internal.l10n.JET2Messages;
+import org.eclipse.jet.internal.parser.ParseProblemSeverity;
+import org.eclipse.jet.taglib.TagAttributeDefinition;
+import org.eclipse.jet.taglib.TagDefinition;
+
+
+/**
+ * Validate tags and attributes found on tag declarations.
+ * <p>
+ * Types of attribute validation:
+ * <bl>
+ * <li>that required attributes are in the tag declaration.</li>
+ * <li>that all attributes correspond to a declared attribute.</li>
+ * <li>that warnings are generated for deprecated attribute access.</li>
+ * </bl>
+ * <p>
+ * Types of tag validation:
+ * <bl>
+ * <li>whether tag or tag library is deprecated</li>
+ * <li>whether the tag is permitted to be used as an empty tag</li>
+ * <li>whether the tag is permitted to be used as a content tag</li>
+ * </bl>
+ * </p>
+ */
+final class TagValidationVisitor extends DefaultJET2ASTVisitor implements JET2ASTVisitor
+{
+
+ private final JET2CompilationUnit cu;
+
+ /**
+ * @param cu
+ *
+ */
+ public TagValidationVisitor(JET2CompilationUnit cu)
+ {
+ super();
+ this.cu = cu;
+ }
+
+ public void visit(XMLBodyElement xmlBodyElement)
+ {
+ if (!xmlBodyElement.getTagDefinition().isContentAllowed())
+ {
+ cu.createProblem(
+ ParseProblemSeverity.ERROR,
+ Problem.TagCannotHaveContent,
+ JET2Messages.JET2Compiler_TagCannotHaveContent,
+ new Object [0],
+ xmlBodyElement.getStart(),
+ xmlBodyElement.getEnd(),
+ xmlBodyElement.getLine());
+ }
+ validateAttributes(xmlBodyElement);
+ }
+
+ private void validateAttributes(XMLElement xmlElement)
+ {
+ TagDefinition tagDefinition = xmlElement.getTagDefinition();
+
+ if (tagDefinition.isDeprecated() || tagDefinition.getTagLibrary().isDeprecated())
+ {
+ cu.createProblem(
+ ParseProblemSeverity.WARNING,
+ Problem.DeprecatedTag,
+ JET2Messages.JET2Compiler_DeprecatedTag,
+ new Object [0],
+ xmlElement.getStart(),
+ xmlElement.getEnd(),
+ xmlElement.getLine());
+ }
+
+ // Validate that every supplied attribute is in the tag definition
+ for (Iterator i = xmlElement.getAttributes().keySet().iterator(); i.hasNext();)
+ {
+ String attrName = (String)i.next();
+ if (tagDefinition.getAttributeDefinition(attrName) == null)
+ {
+ cu.createProblem(
+ ParseProblemSeverity.ERROR,
+ Problem.UnknownAttributeInTag,
+ JET2Messages.JET2Compiler_UnknownAttribute,
+ new Object []{ attrName },
+ xmlElement.getStart(),
+ xmlElement.getEnd(),
+ xmlElement.getLine());
+ }
+ }
+
+ // Validate that every required attribute is in the supplied attributes
+ for (Iterator i = tagDefinition.getAttributeDefinitions().iterator(); i.hasNext();)
+ {
+ TagAttributeDefinition tad = (TagAttributeDefinition)i.next();
+ final String attributeName = tad.getName();
+ if (tad.isRequired() && !xmlElement.getAttributes().containsKey(attributeName))
+ {
+ cu.createProblem(
+ ParseProblemSeverity.ERROR,
+ Problem.MissingRequiredAttribute,
+ JET2Messages.JET2Compiler_MissingRequiredAttribute,
+ new Object []{ attributeName },
+ xmlElement.getStart(),
+ xmlElement.getEnd(),
+ xmlElement.getLine());
+ }
+ if (tad.isDeprecated() && xmlElement.getAttributes().containsKey(attributeName))
+ {
+ cu.createProblem(
+ ParseProblemSeverity.WARNING,
+ Problem.DeprecatedAttribute,
+ JET2Messages.JET2Compiler_DeprecatedAttribute,
+ new Object []{ attributeName },
+ xmlElement.getStart(),
+ xmlElement.getEnd(),
+ xmlElement.getLine());
+ }
+ }
+ }
+
+ public void visit(XMLEmptyElement xmlEmptyElement)
+ {
+ if (!xmlEmptyElement.getTagDefinition().isEmptyTagAllowed())
+ {
+ cu.createProblem(
+ ParseProblemSeverity.ERROR,
+ Problem.TagCannotBeEmpty,
+ JET2Messages.JET2Compiler_TagRequiresContent,
+ new Object [0],
+ xmlEmptyElement.getStart(),
+ xmlEmptyElement.getEnd(),
+ xmlEmptyElement.getLine());
+ }
+ validateAttributes(xmlEmptyElement);
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/TextElement.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/TextElement.java
new file mode 100644
index 0000000..3dd3d36
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/TextElement.java
@@ -0,0 +1,84 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.jet.compiler;
+
+
+/**
+ * Define a Text Element in the JET2 AST
+ *
+ */
+public final class TextElement extends JET2ASTElement
+{
+
+ private static final String ESCAPED_JET_ELEMENT_START = "<\\%"; //$NON-NLS-1$
+
+ private char[] text;
+
+ /**
+ * Create an instance
+ * @param jet2ast the AST
+ * @param text the text
+ */
+ TextElement(JET2AST jet2ast, char[] text)
+ {
+ super(jet2ast, -1, 0, 0);
+ this.text = handleEscapes(text);
+ }
+
+ /**
+ * Remove any escape sequences in the raw text.
+ * The only escaped sequences handled are:
+ * <bl>
+ * <li>&lt;\% to &lt;%</li>
+ * </bl>
+ * @param originalText
+ * @return
+ */
+ private char[] handleEscapes(char[] originalText)
+ {
+ StringBuffer buffer = new StringBuffer(originalText.length);
+ buffer.append(originalText);
+ for (int i = buffer.indexOf(ESCAPED_JET_ELEMENT_START); i != -1; i = buffer.indexOf(ESCAPED_JET_ELEMENT_START, i))
+ {
+ buffer.replace(i, i + ESCAPED_JET_ELEMENT_START.length(), "<%"); //$NON-NLS-1$
+ }
+ return buffer.toString().toCharArray();
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.JET2ASTElement#accept(org.eclipse.jet.compiler.JET2ASTVisitor)
+ */
+ public void accept(JET2ASTVisitor visitor)
+ {
+ visitor.visit(this);
+ }
+
+ /**
+ * Return the text content
+ * @return the text
+ */
+ public char[] getText()
+ {
+ return text;
+ }
+
+ void setText(char[] newText)
+ {
+ text = newText;
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/TextRewritingVisitor.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/TextRewritingVisitor.java
new file mode 100644
index 0000000..4140027
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/TextRewritingVisitor.java
@@ -0,0 +1,210 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.compiler;
+
+
+import java.util.List;
+
+import org.eclipse.jet.taglib.CustomTagKind;
+
+
+/**
+ * @author pelder
+ *
+ */
+class TextRewritingVisitor extends DefaultJET2ASTVisitor implements JET2ASTVisitor
+{
+
+ private static final char[] NULL_CHAR_ARRAY = new char []{};
+
+ private boolean firstText;
+
+ /**
+ *
+ */
+ public TextRewritingVisitor()
+ {
+ super();
+ firstText = true;
+ }
+
+ /**
+ * Re-write text elements immediately preceding the body element's close tag, in order to strip final lines, if necessary.
+ * @param xmlBodyElement the XML body element being visited
+ */
+ public void endVisit(XMLBodyElement xmlBodyElement)
+ {
+ boolean needToStripLastNewLine = false;
+ TextElement text = null;
+
+ if (isTagRequiringStripping(xmlBodyElement))
+ {
+ needToStripLastNewLine = true;
+ List bodyElements = xmlBodyElement.getBodyElements();
+ if (bodyElements.size() > 0)
+ {
+ JET2ASTElement last = (JET2ASTElement)bodyElements.get(bodyElements.size() - 1);
+ if (last instanceof TextElement)
+ {
+ text = (TextElement)last;
+ }
+ }
+ }
+
+ if (needToStripLastNewLine && text != null)
+ {
+ text.setText(stripLastNewLineWithBlanks(text.getText()));
+ }
+ }
+
+ /**
+ * Test whether this element is an XML tag for which preceding blanks and NL should be stripped.
+ * @param xmlElement the element to test
+ * @return <code>true</code> if the text should be stripped, <code>false</code> otherwise.
+ */
+ private final boolean isTagRequiringStripping(XMLElement xmlElement)
+ {
+ CustomTagKind kind = xmlElement.getTagDefinition().getKind();
+ return kind == CustomTagKind.CONDITIONAL || kind == CustomTagKind.ITERATING || kind == CustomTagKind.CONTAINER;
+ }
+
+ /**
+ * Strip off an initial new line
+ * @param chars
+ * @return the rewritten char array
+ */
+ private final char[] stripFirstNewLine(char[] chars)
+ {
+ if (chars.length >= 2 && (chars[0] == '\n' && chars[1] == '\r' || chars[0] == '\r' && chars[1] == '\n'))
+ {
+ chars = subarray(chars, 2);
+
+ }
+ else if (chars.length == 1 && (chars[0] == '\n' || chars[0] == '\r'))
+ {
+ chars = subarray(chars, 1);
+ }
+ return chars;
+ }
+
+ private final char[] stripLastNewLineWithBlanks(char[] chars)
+ {
+ int i = chars.length - 1;
+ while (i > 0 && chars[i] == ' ')
+ {
+ --i;
+ }
+ if (i >= 0 && chars[i] == '\n')
+ {
+ if (i > 0 && chars[i - 1] == '\r')
+ {
+ --i;
+ }
+ if (i == 0)
+ {
+ return NULL_CHAR_ARRAY;
+ }
+ else
+ {
+ return subarray(chars, 0, i);
+ }
+ }
+ else
+ {
+ return chars;
+ }
+ }
+
+ /**
+ * char[] equivalent of {@link String#substring(int)}.
+ * @param chars the char array to subset
+ * @param start the start index of the subset
+ * @return a new char array containing the subset.
+ * @throws NullPointerException if <code>chars</code> is <code>null</code>.
+ * @throws IllegalArgumentException if start is negative, or if start
+ * is larger than the size of chars.
+ */
+ private char[] subarray(char[] chars, int start)
+ {
+ return subarray(chars, start, chars.length - start);
+ }
+
+ /**
+ * char[] equivalent of {@link String#substring(int,int)}.
+ *
+ * @param chars
+ * the char array to subset
+ * @param start
+ * the start index of the subset
+ * @param length
+ * the length of the subset
+ * @return a new char array containing the subset.
+ * @throws NullPointerException
+ * if <code>chars</code> is <code>null</code>.
+ * @throws IllegalArgumentException
+ * if start or length are negative, or if start+length is larger
+ * than the size of chars.
+ */
+ private char[] subarray(char[] chars, int start, int length)
+ {
+ if (chars == null)
+ {
+ throw new NullPointerException();
+ }
+ if (start < 0 || length < 0 || start > chars.length || start + length > chars.length)
+ {
+ throw new IllegalArgumentException();
+ }
+ char[] newchars = new char [length];
+ System.arraycopy(chars, start, newchars, 0, length);
+ chars = newchars;
+ return chars;
+ }
+
+ /**
+ * Implement new line stripping rules on text elements.
+ * @param a text element
+ */
+ public void visit(TextElement text)
+ {
+ if (firstText)
+ {
+ // first text processing
+ text.setText(stripFirstNewLine(text.getText()));
+ firstText = false;
+ }
+ JET2ASTElement next = text.getNextSibling();
+ boolean needToStripLastNewLine = false;
+
+ if (next instanceof JET2Declaration || next instanceof JET2Scriptlet || next instanceof JET2Directive)
+ {
+ needToStripLastNewLine = true;
+ }
+ else if (next instanceof XMLElement)
+ {
+ XMLElement nextXmlElement = (XMLElement)next;
+
+ needToStripLastNewLine = isTagRequiringStripping(nextXmlElement);
+ }
+
+ if (needToStripLastNewLine)
+ {
+ text.setText(stripLastNewLineWithBlanks(text.getText()));
+ }
+ }
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/XMLBodyElement.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/XMLBodyElement.java
new file mode 100644
index 0000000..6c8e9b1
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/XMLBodyElement.java
@@ -0,0 +1,137 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.compiler;
+
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.jet.taglib.TagDefinition;
+
+
+/**
+ * Define a JET2 XML Element that has a begin-tag and end-tag, and zero or more body elements.
+ *
+ */
+public final class XMLBodyElement extends XMLElement
+{
+
+ private int endTagStart;
+
+ private int endTagEnd;
+
+ private BodyElements bodyElements = null;
+
+ /**
+ * Create an instance
+ * @param ast the owning AST
+ * @param line the start line of the element
+ * @param start the start offset of the element (doc relative)
+ * @param end the end offset of the element (doc relative)
+ * @param name the QName of the element
+ * @param attributes a Map of attribute names to their values of the element
+ * @param td the TagDefinition
+ */
+ XMLBodyElement(JET2AST ast, int line, int start, int end, String name, Map attributes, TagDefinition td)
+ {
+ super(ast, line, start, end, name, attributes, td);
+ }
+
+ /**
+ * Return the start offset of the end tag (&lt;/<i>tag</i>&gt;)
+ * @return a doc relative index
+ */
+ public final int getEndTagStart()
+ {
+ return endTagStart;
+ }
+
+ /**
+ * Return the end offset of the end tag (&lt;/<i>tag</i>&gt;)
+ * @return a doc relative index
+ */
+ public final int getEndTagEnd()
+ {
+ return endTagEnd;
+ }
+
+ /**
+ * Return a object that allows writable access to the JET2 elements contained by this element.
+ * @return a BodyElements instance
+ */
+ BodyElements getInternalBodyElements()
+ {
+ if (bodyElements == null)
+ {
+ bodyElements = new BodyElements(this);
+ }
+ return bodyElements;
+ }
+
+ /**
+ * Return a read-only list of JET2 elements contained by this element.
+ * @return a List of {@link JET2ASTElement} instances. The empty list is returned if there are no elements.
+ */
+ public final List getBodyElements()
+ {
+ if (bodyElements == null)
+ {
+ return Collections.EMPTY_LIST;
+ }
+ else
+ {
+ return bodyElements.getBodyElements();
+ }
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.JET2ASTElement#accept(org.eclipse.jet.compiler.JET2ASTVisitor)
+ */
+ public void accept(JET2ASTVisitor visitor)
+ {
+ visitor.visit(this);
+ for (Iterator i = getBodyElements().iterator(); i.hasNext();)
+ {
+ JET2ASTElement element = (JET2ASTElement)i.next();
+ element.accept(visitor);
+ }
+ visitor.endVisit(this);
+
+ }
+
+ /**
+ * Set the start offset of the XML end tag (&lt;/...&gt;).
+ * @param endTagEnd a doc relative offset
+ */
+ void setEndTagEnd(int endTagEnd)
+ {
+ this.endTagEnd = endTagEnd;
+ }
+
+ /**
+ * Set the end offset of the XML end tag (&lt;/...&gt;).
+ * @param endTagStart a doc relative offset
+ */
+ void setEndTagStart(int endTagStart)
+ {
+ this.endTagStart = endTagStart;
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/XMLElement.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/XMLElement.java
new file mode 100644
index 0000000..7eaea94
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/XMLElement.java
@@ -0,0 +1,108 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.compiler;
+
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.jet.taglib.TagDefinition;
+
+
+/**
+ * An abstract implementation representing all XML-based elements in the JET2 AST
+ *
+ */
+public abstract class XMLElement extends JET2ASTElement
+{
+
+ private final String name;
+
+ private final Map attributes;
+
+ private final TagDefinition tagDefinition;
+
+ /**
+ * Create an instance
+ * @param ast the owning AST
+ * @param line the start line of the element
+ * @param start the start offset of the element (doc relative)
+ * @param end the end offset of the element (doc relative)
+ * @param name the QName of the element
+ * @param attributes a Map of attribute names to values for the element.
+ * @param td the TagDefinition
+ */
+ XMLElement(JET2AST ast, int line, int start, int end, String name, Map attributes, TagDefinition td)
+ {
+ super(ast, line, start, end);
+ this.name = name;
+ this.tagDefinition = td;
+ this.attributes = Collections.unmodifiableMap(new HashMap(attributes)); // defensive copy
+
+ }
+
+ /**
+ * Return the QName of the element
+ * @return a string
+ */
+ public final String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Return a read-only map of the attributes (name to value map)
+ * @return a Map with String keys (attribute name) and String values
+ */
+ public final Map getAttributes()
+ {
+ return attributes;
+ }
+
+ /**
+ * Return the NCName (unqualified name) of the element.
+ * @return the name with any XML namespace prefix (<i>prefix</i>:) removed
+ */
+ public String getTagNCName()
+ {
+ String qName = getName();
+ int sepIndex = qName.indexOf(':');
+ return sepIndex >= 0 ? qName.substring(sepIndex + 1) : qName;
+ }
+
+ /**
+ * Return the XML Namespace prefixe of the element
+ * @return the namespace prefix or the empty string if there is no namespace prefix.
+ */
+ public String getNSPrefix()
+ {
+ String qName = getName();
+ int sepIndex = qName.indexOf(':');
+ return sepIndex >= 0 ? qName.substring(0, sepIndex) : ""; //$NON-NLS-1$
+ }
+
+ /**
+ * @return Returns the td.
+ */
+ public final TagDefinition getTagDefinition()
+ {
+ return tagDefinition;
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/XMLEmptyElement.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/XMLEmptyElement.java
new file mode 100644
index 0000000..785aa72
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/XMLEmptyElement.java
@@ -0,0 +1,56 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.compiler;
+
+
+import java.util.Map;
+
+import org.eclipse.jet.taglib.TagDefinition;
+
+
+/**
+ * Define an empty XML element in the JET2 AST.
+ *
+ */
+public final class XMLEmptyElement extends XMLElement
+{
+
+ /**
+ * Create an instance
+ * @param ast the owning AST
+ * @param line the start line of the element
+ * @param start the start offset of the element (doc relative)
+ * @param end the end offset of the element (doc relative)
+ * @param name the QName of the element
+ * @param attributes a Map of attribute names to values for the element.
+ * @param td the TagDefinition
+ */
+ XMLEmptyElement(JET2AST ast, int line, int start, int end, String name, Map attributes, TagDefinition td)
+ {
+ super(ast, line, start, end, name, attributes, td);
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.JET2ASTElement#accept(org.eclipse.jet.compiler.JET2ASTVisitor)
+ */
+ public void accept(JET2ASTVisitor visitor)
+ {
+ visitor.visit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/package.html b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/package.html
new file mode 100644
index 0000000..074ac9f
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/package.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About org.eclipse.jet.compiler</title>
+</head>
+<body lang="EN-US">
+<p>
+Defines an AST for JET templates, and provides a compiler that generates an AST from a template source.
+</p>
+</body> \ No newline at end of file
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/InternalJET2Platform.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/InternalJET2Platform.java
new file mode 100644
index 0000000..d51eb11
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/InternalJET2Platform.java
@@ -0,0 +1,371 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.jet.internal;
+
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jet.JET2Platform;
+import org.eclipse.jet.internal.compiler.CompilerStateManager;
+import org.eclipse.jet.internal.compiler.JET2CompilerState;
+import org.eclipse.jet.internal.extensionpoints.XPathFunctionsManager;
+import org.eclipse.jet.internal.runtime.IJET2TemplateBundleDescriptor;
+import org.eclipse.jet.internal.runtime.IJET2TemplateBundleSupplier;
+import org.eclipse.jet.internal.runtime.PluginDeployedTemplateBundleSupplier;
+import org.eclipse.jet.internal.runtime.ProjectTemplateBundleSupplier;
+import org.eclipse.jet.internal.runtime.TemplateBundleManager;
+import org.eclipse.jet.internal.taglib.InternalTagLibManager;
+import org.eclipse.jet.taglib.TagLibrary;
+import org.eclipse.jet.transform.IJETBundle;
+import org.osgi.framework.BundleContext;
+
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class InternalJET2Platform extends Plugin
+{
+
+ //The shared instance.
+ private static InternalJET2Platform plugin;
+
+ private CompilerStateManager compilerStateManager;
+
+ private InternalTagLibManager tagLibManager = null;
+
+ private TemplateBundleManager transformBundleManager = null;
+
+ private ProjectTemplateBundleSupplier projectTemplateBundleSupplier = null;
+
+ private PluginDeployedTemplateBundleSupplier pluginTemplateBundleSupplier = null;
+
+ private XPathFunctionsManager xpathFunctionsManager = null;
+
+ /**
+ * A List of {@link org.eclipse.jet.internal.runtime.IJET2TemplateBundleSupplier} objects. The list order
+ * is the order in transform search order.
+ */
+ private List templateBundleSuppliers = new ArrayList();
+
+ /**
+ * Return the compiler state for the given project
+ * @param project an eclipse project
+ * @return the compiler state or <code>null</code> if the state cannot be found.
+ */
+ public static JET2CompilerState getCompilerState(IProject project)
+ {
+ return getDefault().compilerStateManager.getCompilerState(project);
+ }
+
+ /**
+ * Returns the shared instance.
+ * @return the plugin instance
+ */
+ public static InternalJET2Platform getDefault()
+ {
+ return plugin;
+ }
+
+ /**
+ * Write a message of the supplied severity to the Eclipse log
+ * @param severity
+ * @param msg
+ * @param e
+ */
+ private static void log(int severity, String msg, Exception e)
+ {
+ getDefault().getLog().log(newStatus(severity, msg, e));
+ }
+
+ /**
+ * Write an status object to the Eclipse error log.
+ * @param result
+ */
+ public static void log(IStatus result)
+ {
+ getDefault().getLog().log(result);
+
+ }
+
+ /**
+ * Write an error message to the Eclipse log
+ * @param msg
+ */
+ public static void logError(String msg)
+ {
+ logError(msg, null);
+ }
+
+ /**
+ * Write an error message to the Eclipse log
+ * @param msg
+ * @param e
+ */
+ public static void logError(String msg, Exception e)
+ {
+ log(IStatus.ERROR, msg, e);
+ }
+
+ /**
+ * Write an info message to the Eclipse log.
+ * @param msg
+ */
+ public static void logInfo(String msg)
+ {
+ logInfo(msg, null);
+ }
+
+ /**
+ * Write an info message to the Eclipse log
+ * @param msg
+ * @param e
+ */
+ public static void logInfo(String msg, Exception e)
+ {
+ log(IStatus.INFO, msg, e);
+ }
+
+ /**
+ * Write an error message to the Eclipse log
+ * @param msg
+ */
+ public static void logWarning(String msg)
+ {
+ logWarning(msg, null);
+ }
+
+ /**
+ * Log a warning message to the Eclipse log
+ * @param msg a message, may be <code>null</code>.
+ * @param e an exeception, may be <code>null</code>.
+ */
+ public static void logWarning(String msg, Exception e)
+ {
+ log(IStatus.WARNING, msg, e);
+ }
+
+ /**
+ * Create a new IStatus wrapping the passed exception & message. The status refers to the JET2 core
+ * plugin.
+ * @param severity one of the {@link IStatus} severity codes.
+ * @param msg the error message.
+ * @param e the exception, may be <code>null</code>.
+ * @return the new Status
+ */
+ public static IStatus newStatus(int severity, String msg, Exception e)
+ {
+ return new Status(severity, JET2Platform.PLUGIN_ID, IStatus.OK, msg == null ? "" : msg, e); //$NON-NLS-1$
+ }
+
+ /**
+ * Associate a compiler state (usually retreived from plugin state location) with
+ * a particular project
+ * @param project an Eclipse project with the JET2 nature
+ * @param compilerState the compiler state.
+ * @see CompilerStateManager
+ */
+ public static void setCompilerState(IProject project, JET2CompilerState compilerState)
+ {
+ getDefault().compilerStateManager.setCompilerState(project, compilerState);
+ }
+
+ /**
+ * The constructor.
+ */
+ public InternalJET2Platform()
+ {
+ plugin = this;
+
+ }
+
+ /**
+ * Return the location where the compiled bundles corresponding to JET2 workspace projects are stored.
+ * @return the location (absolute path) of the compiled bundles.
+ */
+ public IPath getCompiledBundleLocation()
+ {
+ IPath stateLocation = getStateLocation();
+ IPath compiledBundleLocation = stateLocation.append("compiledBundles"); //$NON-NLS-1$
+ compiledBundleLocation.toFile().mkdirs();
+ return compiledBundleLocation;
+ }
+
+ /**
+ * Return tag library meta information for the specified tag library id.
+ * @param id a tag library id (plugin id + "." + tag library id)
+ * @return the tab library data or <code>null</code> if the id was not found.
+ */
+ public TagLibrary getTagLibrary(String id)
+ {
+ return tagLibManager.getTagLibrary(id);
+ }
+
+ public IJETBundle getTemplateBundle(String id, IProgressMonitor monitor) throws CoreException
+ {
+ if (monitor == null)
+ {
+ monitor = new NullProgressMonitor();
+ }
+ IJETBundle bundle = null;
+ IJET2TemplateBundleDescriptor descriptor = null;
+
+ for (Iterator i = templateBundleSuppliers.iterator(); i.hasNext() && descriptor == null;)
+ {
+ IJET2TemplateBundleSupplier supplier = (IJET2TemplateBundleSupplier)i.next();
+ descriptor = supplier.findTemplateBundle(id);
+ }
+
+ if (descriptor != null)
+ {
+ bundle = descriptor.getTemplateBundle(monitor);
+ }
+ return bundle;
+ }
+
+ /**
+ * Return the manager of transform bundles (compiled JET2 tranformations).
+ * @return the transform bundle manager
+ */
+ public TemplateBundleManager getTransformBundleManager()
+ {
+ return transformBundleManager;
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ * @param context the OSGi bundle context
+ * @throws Exception if the plugin cannot start up
+ */
+ public void start(BundleContext context) throws Exception
+ {
+ super.start(context);
+
+ compilerStateManager = new CompilerStateManager();
+
+ tagLibManager = new InternalTagLibManager();
+ tagLibManager.startup();
+
+ transformBundleManager = new TemplateBundleManager();
+ transformBundleManager.startup(context);
+
+ projectTemplateBundleSupplier = new ProjectTemplateBundleSupplier();
+ projectTemplateBundleSupplier.startup();
+
+ pluginTemplateBundleSupplier = new PluginDeployedTemplateBundleSupplier();
+ pluginTemplateBundleSupplier.startup();
+
+ templateBundleSuppliers.add(projectTemplateBundleSupplier);
+ templateBundleSuppliers.add(pluginTemplateBundleSupplier);
+
+ xpathFunctionsManager = new XPathFunctionsManager();
+ xpathFunctionsManager.startup();
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ * @param context the OSGi bundle context
+ * @throws Exception if the plugin cannot shutdown
+ */
+ public void stop(BundleContext context) throws Exception
+ {
+ super.stop(context);
+ plugin = null;
+
+ compilerStateManager = null;
+
+ tagLibManager.shutdown();
+ tagLibManager = null;
+
+ templateBundleSuppliers.clear();
+
+ projectTemplateBundleSupplier.shutdown();
+ projectTemplateBundleSupplier = null;
+
+ pluginTemplateBundleSupplier.shutdown();
+ pluginTemplateBundleSupplier = null;
+
+ transformBundleManager.shutdown();
+ transformBundleManager = null;
+
+ xpathFunctionsManager.shutdown();
+ xpathFunctionsManager = null;
+ }
+
+ public IJET2TemplateBundleDescriptor getTemplateBundleDescriptor(String id)
+ {
+ IJET2TemplateBundleDescriptor descriptor = null;
+
+ for (Iterator i = templateBundleSuppliers.iterator(); i.hasNext() && descriptor == null;)
+ {
+ IJET2TemplateBundleSupplier supplier = (IJET2TemplateBundleSupplier)i.next();
+ descriptor = supplier.findTemplateBundle(id);
+ }
+ return descriptor;
+ }
+
+ /**
+ * Utility function for writing Debug output
+ * @param issuer the issuer of the message, usually <code>this</code>, but may
+ * also be a Class object.
+ * @param message the debug message.
+ */
+ public static void debugMessage(Object issuer, String message)
+ {
+ Class msgClass = null;
+ if (issuer instanceof Class)
+ {
+ msgClass = (Class)issuer;
+ }
+ else
+ {
+ msgClass = issuer.getClass();
+ }
+
+ System.err.println(msgClass.getName() + ": " + message); //$NON-NLS-1$
+ }
+
+ public String[] getKnownTagLibraryIds()
+ {
+ return tagLibManager.getKnownTagLibraryIds();
+ }
+
+ /**
+ * @return Returns the xpathFunctionsManager.
+ */
+ public final XPathFunctionsManager getXPathFunctionsManager()
+ {
+ return xpathFunctionsManager;
+ }
+
+ /**
+ * @return Returns the tagLibManager.
+ */
+ public final InternalTagLibManager getTagLibManager()
+ {
+ return tagLibManager;
+ }
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/BundleBuildParameters.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/BundleBuildParameters.java
new file mode 100644
index 0000000..8fbf0a0
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/BundleBuildParameters.java
@@ -0,0 +1,67 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.internal.builder;
+
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jet.internal.InternalJET2Platform;
+
+
+/**
+ * Parameters to the bundle Build
+ *
+ */
+public class BundleBuildParameters
+{
+
+ private final IProject jet2Project;
+
+ /**
+ * Construct the parameters for a bundle build
+ * @param jet2Project an Eclipse workspace project that is to be built into a JET2 bundle.
+ *
+ */
+ public BundleBuildParameters(IProject jet2Project)
+ {
+ super();
+ this.jet2Project = jet2Project;
+
+ }
+
+ /**
+ * Get the location of the built bundle
+ * @return a string representing the absoluate path of the bundle
+ */
+ public String getExportedBundleLocation()
+ {
+ IPath compiledBundleLocation = InternalJET2Platform.getDefault().getCompiledBundleLocation();
+
+ return compiledBundleLocation.append(jet2Project.getName()).addFileExtension("jar").toString(); //$NON-NLS-1$
+ }
+
+ /**
+ * Return the location (absolute path) of the project being built.
+ * @return the project location (absolute path) as a string.
+ */
+ public String getJET2ProjectLocation()
+ {
+ return jet2Project.getLocation().toString();
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2Builder.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2Builder.java
new file mode 100644
index 0000000..920f823
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2Builder.java
@@ -0,0 +1,254 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.internal.builder;
+
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jet.compiler.JET2Compiler;
+import org.eclipse.jet.internal.InternalJET2Platform;
+import org.eclipse.jet.internal.compiler.JET2CompilerState;
+import org.eclipse.jet.internal.l10n.JET2Messages;
+import org.eclipse.osgi.util.NLS;
+
+
+/**
+ * Implement the builder that compiles JET2 files into Java
+ *
+ */
+public class JET2Builder extends IncrementalProjectBuilder
+{
+
+ private static final String COMPILESTATE_FILE_NAME = "jet2BuilderState.tmp"; //$NON-NLS-1$
+
+ private static final String COMPILESTATE_PROJECT_DIR = "projects"; //$NON-NLS-1$
+
+ private IPath savedStatePath;
+
+ private int filesToCompileCount;
+
+ /**
+ *
+ */
+ public JET2Builder()
+ {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.resources.IncrementalProjectBuilder#build(int, java.util.Map, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException
+ {
+
+ if (kind == IncrementalProjectBuilder.FULL_BUILD)
+ {
+ fullBuild(monitor);
+ }
+ else
+ {
+ IResourceDelta delta = getDelta(getProject());
+ if (delta == null)
+ {
+ fullBuild(monitor);
+ }
+ else
+ {
+ incrementalBuild(delta, monitor);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Perform an incremental build
+ * @param mainDelta
+ * @param monitor
+ * @throws CoreException
+ */
+ private void incrementalBuild(IResourceDelta mainDelta, final IProgressMonitor monitor) throws CoreException
+ {
+ final JET2Compiler compiler = new JET2Compiler(getProject(), monitor, null);
+ filesToCompileCount = 0;
+ // figure out how much work we must do (for the progress monitor).
+ mainDelta.accept(new IResourceDeltaVisitor()
+ {
+ public boolean visit(IResourceDelta delta) throws CoreException
+ {
+ switch (delta.getKind())
+ {
+ case IResourceDelta.ADDED:
+ case IResourceDelta.CHANGED:
+ case IResourceDelta.REMOVED:
+ if (compiler.isJET2SourceFile(delta.getResource()))
+ {
+ filesToCompileCount++;
+ }
+ break;
+ }
+ return true;
+ }
+ });
+ monitor.beginTask(NLS.bind(JET2Messages.JET2Builder_CompilingChanged, getProject().getName()), filesToCompileCount);
+ try
+ {
+ mainDelta.accept(new IResourceDeltaVisitor()
+ {
+
+ public boolean visit(IResourceDelta delta) throws CoreException
+ {
+ switch (delta.getKind())
+ {
+ case IResourceDelta.ADDED:
+ case IResourceDelta.CHANGED:
+ monitor.subTask(NLS.bind(JET2Messages.JET2Builder_Compiling, delta.getResource().getProjectRelativePath()));
+ compiler.compile(delta.getResource());
+ monitor.worked(1);
+ break;
+ case IResourceDelta.REMOVED:
+ monitor.subTask(NLS.bind(JET2Messages.JET2Builder_Cleaning, delta.getResource().getProjectRelativePath()));
+ compiler.removeDerivedResources(delta.getResource());
+ monitor.worked(1);
+ break;
+ }
+ return true;
+ }
+ });
+ compiler.createTransformFiles();
+
+ }
+ catch (CoreException e)
+ {
+ InternalJET2Platform.getCompilerState(getProject()).clear();
+ forgetLastBuiltState();
+ throw e;
+ }
+ finally
+ {
+ monitor.done();
+ }
+
+ }
+
+ /**
+ * Perform a Full build
+ * @param monitor
+ * @throws CoreException
+ */
+ private void fullBuild(final IProgressMonitor monitor) throws CoreException
+ {
+ final JET2Compiler compiler = new JET2Compiler(getProject(), monitor, null);
+ filesToCompileCount = 0;
+ // figure out how much work we must do (for the progress monitor).
+ getProject().accept(new IResourceVisitor()
+ {
+ public boolean visit(IResource resource) throws CoreException
+ {
+ if (compiler.isJET2SourceFile(resource))
+ {
+ filesToCompileCount++;
+ }
+ return true;
+ }
+ });
+ monitor.beginTask(NLS.bind(JET2Messages.JET2Builder_CompilingAll, getProject().getName()), filesToCompileCount);
+ try
+ {
+ getProject().accept(new IResourceVisitor()
+ {
+
+ public boolean visit(IResource resource) throws CoreException
+ {
+ monitor.subTask(NLS.bind(JET2Messages.JET2Builder_Compiling, resource.getProjectRelativePath()));
+ compiler.compile(resource);
+ monitor.worked(1);
+ return true;
+ }
+ });
+ compiler.createTransformFiles();
+ // TODO Save compilation state upon successful build
+ }
+ catch (CoreException e)
+ {
+ InternalJET2Platform.getCompilerState(getProject()).clear();
+ forgetLastBuiltState();
+ throw e;
+ }
+ finally
+ {
+ monitor.done();
+ }
+ }
+
+ /*
+ * Load saved compiler state...
+ */
+ protected void startupOnInitialize()
+ {
+ super.startupOnInitialize();
+
+ savedStatePath = InternalJET2Platform.getDefault().getStateLocation().append(COMPILESTATE_PROJECT_DIR).append(getProject().getName()).append(
+ COMPILESTATE_FILE_NAME);
+ File savedStateFile = savedStatePath.toFile();
+ JET2CompilerState compilerState = null;
+ try
+ {
+ ObjectInputStream ois = new ObjectInputStream(new java.io.FileInputStream(savedStateFile));
+ compilerState = (JET2CompilerState)ois.readObject();
+ ois.close();
+ }
+ catch (FileNotFoundException e)
+ {
+ // nothing to do, the state was not saved for some reason.
+ }
+ catch (IOException e)
+ {
+ // error reading the file, assume state is unrecoverable.
+ // remove the state file.
+ savedStateFile.delete();
+ }
+ catch (ClassNotFoundException e)
+ {
+ // error in deserializing the file. This should not happen. Log an error, for the record...
+ InternalJET2Platform.logError("Could not deserialize JET2Builder State", e); //$NON-NLS-1$
+ }
+
+ if (compilerState != null)
+ {
+ InternalJET2Platform.setCompilerState(getProject(), compilerState);
+ }
+ else
+ {
+ // don't have the saved build state, force a full rebuild...
+ forgetLastBuiltState();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2BundleBuildTool.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2BundleBuildTool.java
new file mode 100644
index 0000000..fcdddfd
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2BundleBuildTool.java
@@ -0,0 +1,138 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.internal.builder;
+
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.eclipse.ant.core.AntRunner;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jet.JET2Platform;
+import org.eclipse.jet.internal.InternalJET2Platform;
+import org.eclipse.jet.internal.l10n.JET2Messages;
+
+
+/**
+ * Utility class for creating JET2 Bundles from a JET2 Project
+ *
+ */
+public class JET2BundleBuildTool
+{
+
+ private static final String BUNDLEBUILD_XML = "bundlebuild.xml"; //$NON-NLS-1$
+
+ /**
+ *
+ */
+ private JET2BundleBuildTool()
+ {
+ super();
+ }
+
+ /**
+ *
+ * @param jet2Project
+ * @param monitor
+ * @return the URL of the exported bundle
+ * @throws CoreException
+ */
+ public static URL bundleProject(IProject jet2Project, IProgressMonitor monitor) throws CoreException
+ {
+ try
+ {
+ // This builder always does a "full" build
+ monitor.beginTask(JET2Messages.JET2BundleBuildTool_CreatingBundle, 1);
+ BundleBuildParameters parms = new BundleBuildParameters(jet2Project);
+
+ String fileLocation = getAntBuildFile();
+
+ AntRunner runner = new AntRunner();
+ runner.setBuildFileLocation(fileLocation);
+ runner.setArguments(new String []{ "-DbundleJarFile=" + parms.getExportedBundleLocation(), //$NON-NLS-1$
+ "-Djet2Project=" + parms.getJET2ProjectLocation(), //$NON-NLS-1$
+ "-Dbasedir=" + parms.getJET2ProjectLocation(), //$NON-NLS-1$
+ });
+ monitor.subTask(JET2Messages.JET2BundleBuildTool_CreatingJar);
+ runner.run(new SubProgressMonitor(monitor, 1));
+ return new URL("file:/" + parms.getExportedBundleLocation()); //$NON-NLS-1$
+ }
+ catch (IOException e)
+ {
+ throw new CoreException(InternalJET2Platform.newStatus(IStatus.ERROR, "Error accessing bundle build file", e)); //$NON-NLS-1$
+ }
+ finally
+ {
+ monitor.done();
+ }
+ }
+
+ /**
+ * @return
+ * @throws MalformedURLException
+ * @throws IOException
+ * @throws FileNotFoundException
+ */
+ private static String getAntBuildFile() throws MalformedURLException, IOException, FileNotFoundException
+ {
+ // don't count on platform URLs resolving into file:// urls, they may
+ // not, especially when the plugin is packaged as a single JAR
+
+ InputStream contents = null;
+ FileOutputStream outputContents = null;
+ try
+ {
+ URL buildFileURL = new URL("platform:/plugin/" + JET2Platform.PLUGIN_ID + '/' + BUNDLEBUILD_XML); //$NON-NLS-1$
+ // instead, copy the contents to a temporary file.
+ contents = buildFileURL.openStream();
+
+ String fileLocation = InternalJET2Platform.getDefault().getStateLocation().append(BUNDLEBUILD_XML).toString();
+ outputContents = new FileOutputStream(new File(fileLocation));
+ byte[] buffer = new byte [1024];
+ int bytesRead = 0;
+ while ((bytesRead = contents.read(buffer)) >= 0)
+ {
+ outputContents.write(buffer, 0, bytesRead);
+ }
+ return fileLocation;
+
+ }
+ finally
+ {
+ if (contents != null)
+ {
+ contents.close();
+ }
+ if (outputContents != null)
+ {
+ outputContents.close();
+ }
+
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2TransformProjectNature.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2TransformProjectNature.java
new file mode 100644
index 0000000..9109bc5
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2TransformProjectNature.java
@@ -0,0 +1,78 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.internal.builder;
+
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectNature;
+import org.eclipse.core.runtime.CoreException;
+
+
+/**
+ * Implement the JET2 Project Nature
+ *
+ */
+public class JET2TransformProjectNature implements IProjectNature
+{
+
+ /**
+ *
+ */
+ public JET2TransformProjectNature()
+ {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.resources.IProjectNature#configure()
+ */
+ public void configure() throws CoreException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.resources.IProjectNature#deconfigure()
+ */
+ public void deconfigure() throws CoreException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.resources.IProjectNature#getProject()
+ */
+ public IProject getProject()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.resources.IProjectNature#setProject(org.eclipse.core.resources.IProject)
+ */
+ public void setProject(IProject project)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/CommentElementDelegate.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/CommentElementDelegate.java
new file mode 100644
index 0000000..a53a51d
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/CommentElementDelegate.java
@@ -0,0 +1,85 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.internal.compiler;
+
+
+import org.eclipse.emf.codegen.CodeGenPlugin;
+import org.eclipse.emf.codegen.jet.JETException;
+import org.eclipse.jet.internal.parser.JETCoreElement;
+import org.eclipse.jet.internal.parser.JETMark;
+import org.eclipse.jet.internal.parser.JETParseEventListener;
+import org.eclipse.jet.internal.parser.JETParseEventListener2;
+import org.eclipse.jet.internal.parser.JETParser;
+import org.eclipse.jet.internal.parser.JETReader;
+
+
+/**
+ * A JET Compiler delegate for handling JET2 comments (&lt;%-- ... --%&gt;).
+ *
+ */
+public class CommentElementDelegate implements JETCoreElement
+{
+
+ private static final String STD_COMMENT_CHARS = "--"; //$NON-NLS-1$
+
+ /**
+ * Create a new CommentElementDelegate
+ */
+ public CommentElementDelegate()
+ {
+ super();
+ }
+
+ /**
+ * Given the parser state (reader, parser), determine if the parser is currently located at
+ * a JET2 comment. If so, parse it, calling appropriate methods on <code>listener</code>.
+ * @param listener the JET parser event listener, to which comment events are dispatched if a comment is recognized
+ * @param reader the JET reader (lexer)
+ * @param parser the JET parser instance
+ * @return <code>true</code> a JET2 comment element was recognized, <code>false</code> otherwise
+ * @throws JETException if an error occurs
+ *
+ */
+ public boolean accept(JETParseEventListener listener, JETReader reader, JETParser parser) throws JETException
+ {
+ if (!(listener instanceof JETParseEventListener2))
+ {
+ return false;
+ }
+ JETParseEventListener2 jet2Listener = (JETParseEventListener2)listener;
+
+ String elementOpen = parser.getOpenScriptlet() + STD_COMMENT_CHARS;
+ String elementClose = STD_COMMENT_CHARS + parser.getCloseScriptlet();
+ if (!reader.matches(elementOpen))
+ {
+ return false;
+ }
+ reader.advance(elementOpen.length());
+
+ JETMark start = reader.mark();
+ JETMark stop = reader.skipUntil(elementClose);
+ if (stop == null)
+ {
+ throw new JETException(CodeGenPlugin.getPlugin().getString(
+ "jet.error.unterminated", new Object []{ elementOpen, reader.mark().toString() })); //$NON-NLS-1$
+ }
+ jet2Listener.handleComment(start, stop);
+ return true;
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/CompilerStateManager.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/CompilerStateManager.java
new file mode 100644
index 0000000..835167f
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/CompilerStateManager.java
@@ -0,0 +1,75 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.internal.compiler;
+
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+
+
+/**
+ * Manager compiler state stored in the workspace meta data.
+ *
+ */
+public class CompilerStateManager
+{
+
+ private final Map projectCache = Collections.synchronizedMap(new HashMap());
+
+ /**
+ *
+ */
+ public CompilerStateManager()
+ {
+ super();
+ }
+
+ /**
+ * Return the cached compiler state for the identified project.
+ * Create a compiler state if it does not exist.
+ * @param project
+ * @return the compiler state
+ */
+ public JET2CompilerState getCompilerState(IProject project)
+ {
+ JET2CompilerState compilerState = (JET2CompilerState)projectCache.get(project.getName());
+
+ if (compilerState == null)
+ {
+ compilerState = new JET2CompilerState();
+ compilerState.setProject(project);
+ projectCache.put(project.getName(), compilerState);
+ }
+
+ return compilerState;
+ }
+
+ /**
+ * Associate the compiler state with a JET2 project.
+ * @param project an Eclipse workspace project (containing a JET2 builder).
+ * @param compilerState the compiler state.
+ */
+ public void setCompilerState(IProject project, JET2CompilerState compilerState)
+ {
+ projectCache.put(project.getName(), compilerState);
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/DeclarationElementDelegate.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/DeclarationElementDelegate.java
new file mode 100644
index 0000000..ba1bc3a
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/DeclarationElementDelegate.java
@@ -0,0 +1,70 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.jet.internal.compiler;
+
+
+import org.eclipse.emf.codegen.CodeGenPlugin;
+import org.eclipse.emf.codegen.jet.JETException;
+import org.eclipse.jet.internal.parser.JETCoreElement;
+import org.eclipse.jet.internal.parser.JETMark;
+import org.eclipse.jet.internal.parser.JETParseEventListener;
+import org.eclipse.jet.internal.parser.JETParseEventListener2;
+import org.eclipse.jet.internal.parser.JETParser;
+import org.eclipse.jet.internal.parser.JETReader;
+
+
+/**
+ * Parser delegate for parsing a JET2 declaration &lt;%! ... %&gt;
+ */
+public class DeclarationElementDelegate implements JETCoreElement
+{
+
+ private static final String STD_DECL_CHARS = "!"; //$NON-NLS-1$
+
+ public DeclarationElementDelegate()
+ {
+ super();
+ }
+
+ public boolean accept(JETParseEventListener listener, JETReader reader, JETParser parser) throws JETException
+ {
+ if (!(listener instanceof JETParseEventListener2))
+ {
+ return false;
+ }
+ JETParseEventListener2 jet2Listener = (JETParseEventListener2)listener;
+
+ String declOpen = parser.getOpenScriptlet() + STD_DECL_CHARS;
+ String declClose = parser.getCloseScriptlet();
+ if (!reader.matches(declOpen))
+ {
+ return false;
+ }
+ reader.advance(declOpen.length());
+
+ JETMark start = reader.mark();
+ JETMark stop = reader.skipUntil(declClose);
+ if (stop == null)
+ {
+ throw new JETException(CodeGenPlugin.getPlugin().getString(
+ "jet.error.unterminated", new Object []{ declOpen, reader.mark().toString() })); //$NON-NLS-1$
+ }
+ jet2Listener.handleDeclaration(start, stop);
+ return true;
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/GenXMLElement.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/GenXMLElement.java
new file mode 100644
index 0000000..158109a
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/GenXMLElement.java
@@ -0,0 +1,94 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.internal.compiler;
+
+
+import java.util.Map;
+
+import org.eclipse.jet.compiler.XMLBodyElement;
+import org.eclipse.jet.compiler.XMLElement;
+
+
+/**
+ * A wrapper on XMLElement that provides some utility methods needed by the compiler JET templates.
+ *
+ */
+public class GenXMLElement
+{
+
+ private final XMLElement element;
+
+ private final String tagVariable;
+
+ private final String parentTagVariable;
+
+ private final String tagInfoVariableName;
+
+ public GenXMLElement(XMLElement element, String tagVariable, String tagInfoVariableName, String parentTagVariable)
+ {
+ this.element = element;
+ this.tagVariable = tagVariable;
+ this.tagInfoVariableName = tagInfoVariableName;
+ this.parentTagVariable = parentTagVariable;
+ }
+
+ public String getTagVariable()
+ {
+ return tagVariable;
+ }
+
+ public String getTagInfoVariable()
+ {
+ return tagInfoVariableName;
+ }
+
+ public String getName()
+ {
+ return element.getName();
+ }
+
+ public Map getAttributes()
+ {
+ return element.getAttributes();
+ }
+
+ public boolean hasBody()
+ {
+ return element instanceof XMLBodyElement;
+ }
+
+ public String getNSPrefix()
+ {
+ return element.getNSPrefix();
+ }
+
+ public String getTagNCName()
+ {
+ return element.getTagNCName();
+ }
+
+ public String getParentTagVariable()
+ {
+ return parentTagVariable;
+ }
+
+ public boolean requiresNewWriter()
+ {
+ return element.getTagDefinition().requiresNewWriter();
+ }
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/JET2CompilerState.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/JET2CompilerState.java
new file mode 100644
index 0000000..fd34cf9
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/JET2CompilerState.java
@@ -0,0 +1,111 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.internal.compiler;
+
+
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+
+
+/**
+ * A holder for all project build state
+ *
+ */
+public class JET2CompilerState implements Serializable
+{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 3680891043515763347L;
+
+ private transient IProject project = null;
+
+ private final Map templateMap = new HashMap();
+
+ private final Map classNameToTemplatePath = new HashMap();
+
+ public JET2CompilerState()
+ {
+ // nothing to do
+ }
+
+ public boolean exists()
+ {
+ return project.exists();
+ }
+
+ /**
+ * @return Returns the project.
+ */
+ public IProject getProject()
+ {
+ return project;
+ }
+
+ public Map getTemplateMap()
+ {
+ return Collections.unmodifiableMap(templateMap);
+ }
+
+ public void mapTemplate(String templatePath, String outputJavaClassName)
+ {
+ if (templateMap.containsKey(templatePath))
+ {
+ unmapTemplate(templatePath);
+ }
+ templateMap.put(templatePath, outputJavaClassName);
+ classNameToTemplatePath.put(outputJavaClassName, templatePath);
+ }
+
+ /**
+ * @param project The project to set.
+ * @throws IllegalStateException if setProject has already been called on this instance
+ */
+ public void setProject(IProject project)
+ {
+ if (this.project != null)
+ {
+ throw new IllegalStateException();
+ }
+ this.project = project;
+ }
+
+ public void unmapTemplate(String templatePath)
+ {
+ String javaClass = (String)templateMap.get(templatePath);
+ templateMap.remove(templatePath);
+ classNameToTemplatePath.remove(javaClass);
+ }
+
+ public void clear()
+ {
+ templateMap.clear();
+ classNameToTemplatePath.clear();
+ }
+
+ public String getTemplateFromClass(String qualifiedName)
+ {
+ return (String)classNameToTemplatePath.get(qualifiedName);
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/MethodBodyCreator.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/MethodBodyCreator.java
new file mode 100644
index 0000000..64d3962
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/MethodBodyCreator.java
@@ -0,0 +1,198 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.internal.compiler;
+
+
+import org.eclipse.jet.compiler.DefaultJET2ASTVisitor;
+import org.eclipse.jet.compiler.JET2Expression;
+import org.eclipse.jet.compiler.JET2Scriptlet;
+import org.eclipse.jet.compiler.TextElement;
+import org.eclipse.jet.compiler.XMLBodyElement;
+import org.eclipse.jet.compiler.XMLElement;
+import org.eclipse.jet.compiler.XMLEmptyElement;
+import org.eclipse.jet.internal.compiler.templates.XMLEndGenerator;
+import org.eclipse.jet.internal.compiler.templates.XMLStartGenerator;
+
+
+/**
+ * A JET2 AST visitor that creates the 'generate' method body for the AST.
+ *
+ */
+public class MethodBodyCreator extends DefaultJET2ASTVisitor
+{
+ private static final String WRITE_STMT_OPENING = "out.write("; //$NON-NLS-1$
+
+ private static final String WRITE_STMT_CLOSING = ");" + System.getProperty("line.separator"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ private static final String NULL_KEYWORD = "null"; //$NON-NLS-1$
+
+ private static final String UNDERSCORE = "_"; //$NON-NLS-1$
+
+ private static final String TAG_INFO_PREFIX = "_jettd_"; //$NON-NLS-1$
+
+ private static final String TAG_PREFIX = "_jettag_"; //$NON-NLS-1$
+
+ private XMLStartGenerator startGenerator = new XMLStartGenerator();
+
+ private XMLEndGenerator endGenerator = new XMLEndGenerator();
+
+ private java.util.Stack varStack = new java.util.Stack();
+
+ final StringBuffer buffer = new StringBuffer();
+
+ /**
+ * Return the name of a unique variable to refer to the passed element.
+ * @param element
+ * @return the variable name
+ */
+ public static String tagVariableName(XMLElement element)
+ {
+ return TAG_PREFIX + tagVariableSuffix(element);
+ }
+
+ /**
+ * Return the name of a unique variable to refer to the static information about the passed element.
+ * @param element
+ * @return the variable name
+ */
+ public static String tagInfoVariableName(XMLElement element)
+ {
+ return TAG_INFO_PREFIX + tagVariableSuffix(element);
+ }
+
+ /**
+ * Create a unique suffix of all variables that refer to the passed element
+ * @param element an XML Element
+ * @return the tag variable name
+ */
+ private static String tagVariableSuffix(XMLElement element)
+ {
+ return element.getNSPrefix() + UNDERSCORE + element.getTagNCName() + UNDERSCORE + element.getLine() + UNDERSCORE + element.getStart()
+ + UNDERSCORE + element.getEnd();
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.DefaultJET2ASTVisitor#visit(org.eclipse.jet.compiler.XMLBodyElement)
+ */
+ public void visit(XMLBodyElement element)
+ {
+ String tagVarName = tagVariableName(element);
+ String parentTagVar = varStack.empty() ? NULL_KEYWORD : (String)varStack.peek();
+ varStack.push(tagVarName);
+ buffer.append(startGenerator.generate(new GenXMLElement(element, tagVarName, tagInfoVariableName(element), parentTagVar)));
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.DefaultJET2ASTVisitor#endVisit(org.eclipse.jet.compiler.XMLBodyElement)
+ */
+ public void endVisit(XMLBodyElement element)
+ {
+ String tagVarName = (String)varStack.pop();
+ String parentTagVar = varStack.empty() ? NULL_KEYWORD : (String)varStack.peek();
+ buffer.append(endGenerator.generate(new GenXMLElement(element, tagVarName, tagInfoVariableName(element), parentTagVar)));
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.DefaultJET2ASTVisitor#visit(org.eclipse.jet.compiler.XMLEmptyElement)
+ */
+ public void visit(XMLEmptyElement element)
+ {
+ String tagVarName = tagVariableName(element);
+ String parentTagVar = varStack.empty() ? NULL_KEYWORD : (String)varStack.peek();
+ GenXMLElement genElement = new GenXMLElement(element, tagVarName, tagInfoVariableName(element), parentTagVar);
+ buffer.append(startGenerator.generate(genElement));
+ buffer.append(endGenerator.generate(genElement));
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.DefaultJET2ASTVisitor#visit(org.eclipse.jet.compiler.JET2Expression)
+ */
+ public void visit(JET2Expression expression)
+ {
+ buffer.append(WRITE_STMT_OPENING);
+ buffer.append(expression.getJavaContent());
+ buffer.append(WRITE_STMT_CLOSING);
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.DefaultJET2ASTVisitor#visit(org.eclipse.jet.compiler.JET2Scriptlet)
+ */
+ public void visit(JET2Scriptlet scriptlet)
+ {
+ buffer.append(scriptlet.getJavaContent());
+ }
+
+ /**
+ * @see org.eclipse.jet.compiler.DefaultJET2ASTVisitor#visit(org.eclipse.jet.compiler.TextElement)
+ */
+ public void visit(TextElement text)
+ {
+ buffer.append(WRITE_STMT_OPENING);
+ buffer.append(encodeJavaString(text.getText()));
+ buffer.append(WRITE_STMT_CLOSING);
+ }
+
+ public static String encodeJavaString(char[] text)
+ {
+ StringBuffer encoded = new StringBuffer(text.length + 2);
+ encoded.append('"');
+
+ for (int i = 0; i < text.length; i++)
+ {
+ switch (text[i])
+ {
+ case '\b':
+ encoded.append("\\b"); //$NON-NLS-1$
+ break;
+ case '\f':
+ encoded.append("\\f"); //$NON-NLS-1$
+ break;
+ case '\t':
+ encoded.append("\\t"); //$NON-NLS-1$
+ break;
+ case '\r':
+ encoded.append("\\r"); //$NON-NLS-1$
+ break;
+ case '\n':
+ encoded.append("\\n"); //$NON-NLS-1$
+ break;
+ case '"':
+ encoded.append("\\\""); //$NON-NLS-1$
+ break;
+ case '\\':
+ encoded.append("\\\\"); //$NON-NLS-1$
+ break;
+ default:
+ encoded.append(text[i]);
+ }
+ }
+
+ encoded.append('"');
+ return encoded.toString();
+ }
+
+ /**
+ * Return the underlying string buffer container the generated contents.
+ * @return the string buffer
+ */
+ public StringBuffer getBuffer()
+ {
+ return buffer;
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/XMLElementDelegate.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/XMLElementDelegate.java
new file mode 100644
index 0000000..b7ea7d3
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/XMLElementDelegate.java
@@ -0,0 +1,183 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.jet.internal.compiler;
+
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.emf.codegen.CodeGenPlugin;
+import org.eclipse.emf.codegen.jet.JETException;
+import org.eclipse.jet.compiler.Problem;
+import org.eclipse.jet.internal.l10n.JET2Messages;
+import org.eclipse.jet.internal.parser.JETCoreElement;
+import org.eclipse.jet.internal.parser.JETMark;
+import org.eclipse.jet.internal.parser.JETParseEventListener;
+import org.eclipse.jet.internal.parser.JETParseEventListener2;
+import org.eclipse.jet.internal.parser.JETParser;
+import org.eclipse.jet.internal.parser.JETReader;
+import org.eclipse.jet.internal.parser.ParseProblemSeverity;
+
+
+/**
+ * A JET Parser delegate that handles XML Elements.
+ */
+public class XMLElementDelegate implements JETCoreElement
+{
+
+ private static final String XML_TAG_CLOSE = ">"; //$NON-NLS-1$
+
+ private static final String SLASH = "/"; //$NON-NLS-1$
+
+ private static final String XML_CLOSE_TAG_OPEN = "</"; //$NON-NLS-1$
+
+ private static final String XML_TAG_OPEN = "<"; //$NON-NLS-1$
+
+ public XMLElementDelegate()
+ {
+ super();
+ }
+
+ public boolean accept(JETParseEventListener listener, JETReader reader, JETParser parser) throws JETException
+ {
+ if (!(listener instanceof JETParseEventListener2))
+ {
+ return false;
+ }
+ JETParseEventListener2 jet2Listener = (JETParseEventListener2)listener;
+
+ String elementOpen = XML_TAG_OPEN;
+ if (!reader.matches(elementOpen))
+ {
+ return false;
+ }
+ JETMark start = reader.mark();
+ reader.advance(elementOpen.length());
+
+ boolean isEndTag = false;
+ boolean isEmptyTag = false;
+ if (reader.matches(SLASH))
+ {
+ isEndTag = true;
+ reader.advance(1);
+ elementOpen = XML_CLOSE_TAG_OPEN;
+ }
+
+ String tagName = reader.parseToken(false, false /*don't skip spaces*/);
+
+ if (!jet2Listener.isKnownTag(tagName))
+ {
+ reader.reset(start);
+ return false;
+ }
+
+ JETMark interiorStartMark = reader.mark();
+ // check for the end position...
+ JETMark endTagMark = reader.skipUntil(XML_TAG_CLOSE);
+ if (endTagMark == null)
+ {
+ Object[] msgArgs = new Object []{ elementOpen, reader.mark().toString() };
+ String msg = CodeGenPlugin.getPlugin().getString("jet.error.unterminated", msgArgs); //$NON-NLS-1$
+ JETMark errorMark = reader.mark();
+ jet2Listener.recordProblem(
+ ParseProblemSeverity.ERROR,
+ Problem.UnterminatedXMLTag,
+ msg,
+ msgArgs,
+ start.getCursor(),
+ errorMark.getCursor(),
+ start.getLine());
+ return true;
+ }
+
+ // now reset to the tag interior for detailed parsing...
+ reader.reset(interiorStartMark);
+
+ Map attributeMap = Collections.EMPTY_MAP;
+ if (isEndTag)
+ {
+ reader.skipSpaces();
+ }
+ else
+ {
+ attributeMap = new HashMap();
+ reader.skipSpaces();
+ while (reader.peekChar() != '>' && reader.peekChar() != '/')
+ {
+ JETMark[] attrMarks = reader.parseXmlAttribute();
+ String name = new String(reader.getChars(attrMarks[0], attrMarks[1]));
+ String value = new String(reader.getChars(attrMarks[3], attrMarks[4]));
+ if (attributeMap.containsKey(name))
+ {
+ String msg = JET2Messages.XMLElementDelegate_DuplicateAttribute;
+ jet2Listener.recordProblem(
+ ParseProblemSeverity.ERROR,
+ Problem.DuplicateAttribute,
+ msg,
+ null,
+ attrMarks[0].getCursor(),
+ attrMarks[4].getCursor(),
+ attrMarks[0].getLine());
+ }
+ else
+ {
+ attributeMap.put(name, value.substring(1, value.length() - 1));
+ }
+ reader.skipSpaces();
+ }
+ // attributeMap = reader.parseTagAttributes();
+ }
+ // find the closing char...
+ if (reader.peekChar() == '/' && !isEndTag)
+ {
+ reader.nextChar();
+ isEmptyTag = true;
+ }
+ if (reader.peekChar() != '>')
+ {
+ // jet2Listener.recordProblem(Severity.ERROR, );
+ Object[] msgArgs = new Object []{ elementOpen, reader.mark().toString() };
+ String msg = CodeGenPlugin.getPlugin().getString("jet.error.unterminated", msgArgs); //$NON-NLS-1$
+ JETMark errorMark = reader.mark();
+ jet2Listener.recordProblem(
+ ParseProblemSeverity.ERROR,
+ Problem.UnterminatedXMLTag,
+ msg,
+ msgArgs,
+ start.getCursor(),
+ errorMark.getCursor(),
+ start.getLine());
+ }
+ reader.nextChar();
+ JETMark stop = reader.mark();
+ if (isEmptyTag)
+ {
+ jet2Listener.handleXMLEmptyTag(tagName, start, stop, attributeMap);
+ }
+ else if (isEndTag)
+ {
+ jet2Listener.handleXMLEndTag(tagName, start, stop);
+ }
+ else
+ {
+ jet2Listener.handleXMLStartTag(tagName, start, stop, attributeMap);
+ }
+ return true;
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/JET2JavaGenerator.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/JET2JavaGenerator.java
new file mode 100644
index 0000000..6839d89
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/JET2JavaGenerator.java
@@ -0,0 +1,111 @@
+package org.eclipse.jet.internal.compiler.templates;
+
+import org.eclipse.jet.internal.compiler.*;
+import org.eclipse.jet.compiler.*;
+import java.util.Iterator;
+
+public class JET2JavaGenerator
+{
+ protected static String nl;
+ public static synchronized JET2JavaGenerator create(String lineSeparator)
+ {
+ nl = lineSeparator;
+ JET2JavaGenerator result = new JET2JavaGenerator();
+ nl = null;
+ return result;
+ }
+
+ protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
+ protected final String TEXT_1 = "package ";
+ protected final String TEXT_2 = ";" + NL + "" + NL + "import org.eclipse.jet.JET2Context;" + NL + "import org.eclipse.jet.JET2Template;" + NL + "import org.eclipse.jet.JET2Writer;" + NL + "import org.eclipse.jet.taglib.RuntimeTagElement;" + NL + "import org.eclipse.jet.taglib.TagInfo;" + NL + "" + NL + "public class ";
+ protected final String TEXT_3 = " implements JET2Template {" + NL + "" + NL + "\t";
+ protected final String TEXT_4 = NL + NL + "\t";
+ protected final String TEXT_5 = NL + "\t" + NL + "\tpublic ";
+ protected final String TEXT_6 = "() {" + NL + "\t\tsuper();" + NL + "\t}" + NL + "" + NL + "\tpublic void generate(JET2Context context, JET2Writer out) {" + NL + "\t\t" + NL + "\t\t";
+ protected final String TEXT_7 = NL + NL + "\t\t";
+ protected final String TEXT_8 = NL + "\t}" + NL + "" + NL + "}";
+ protected final String TEXT_9 = NL + " ";
+
+ public String generate(Object argument)
+ {
+ StringBuffer stringBuffer = new StringBuffer();
+
+ JET2CompilationUnit cu = (JET2CompilationUnit)argument;
+
+ final StringBuffer declarations = new StringBuffer();
+ cu.accept(new DefaultJET2ASTVisitor() {
+ public void visit(JET2Declaration declaration) {
+ declarations.append(declaration.getJavaContent());
+ }
+ });
+
+ final StringBuffer tagNamespaceVariables = new StringBuffer();
+ cu.accept(new DefaultJET2ASTVisitor() {
+ public void visit(JET2Directive directive) {
+ if("taglib".equals(directive.getName())) {
+ tagNamespaceVariables.append("public static final String _jetns_")
+ .append(directive.getAttributes().get("prefix"))
+ .append(" = \"")
+ .append(directive.getAttributes().get("id"))
+ .append("\";")
+ .append("//$NON-NLS-1$")
+ .append(NL);
+ }
+ }
+ });
+
+ final StringBuffer tagDataDeclarations = new StringBuffer();
+ cu.accept(new DefaultJET2ASTVisitor() {
+ private void writeDecl(XMLElement element) {
+ tagDataDeclarations.append("final TagInfo ")
+ .append(MethodBodyCreator.tagInfoVariableName(element))
+ .append(" = new TagInfo( ")
+ .append('"').append(element.getName()).append("\", ")
+ .append(element.getLine()).append(", ")
+ .append(element.getStart()).append(", ")
+ .append(element.getEnd()).append(", ")
+ ;
+ tagDataDeclarations.append(" new String[] {");
+ for (Iterator i = element.getAttributes().keySet().iterator(); i.hasNext();) {
+ String attrName = (String) i.next();
+ tagDataDeclarations.append('"').append(attrName).append("\", ");
+ }
+ tagDataDeclarations.append("}, ");
+ tagDataDeclarations.append(" new String[] {");
+ for (Iterator i = element.getAttributes().values().iterator(); i.hasNext();) {
+ String attrValue = (String) i.next();
+ tagDataDeclarations.append(MethodBodyCreator.encodeJavaString(attrValue.toCharArray())).append(", ");
+ }
+ tagDataDeclarations.append("});").append(NL);
+ }
+
+ public void visit(XMLBodyElement element) {
+ writeDecl(element);
+ }
+
+ public void visit(XMLEmptyElement element) {
+ writeDecl(element);
+ }
+ });
+ MethodBodyCreator generatedBody = new MethodBodyCreator();
+ cu.accept(generatedBody);
+
+ stringBuffer.append(TEXT_1);
+ stringBuffer.append( cu.getOutputJavaPackage() );
+ stringBuffer.append(TEXT_2);
+ stringBuffer.append( cu.getOutputJavaClassName() );
+ stringBuffer.append(TEXT_3);
+ stringBuffer.append( tagNamespaceVariables );
+ stringBuffer.append(TEXT_4);
+ stringBuffer.append( declarations );
+ stringBuffer.append(TEXT_5);
+ stringBuffer.append( cu.getOutputJavaClassName() );
+ stringBuffer.append(TEXT_6);
+ stringBuffer.append( tagDataDeclarations );
+ stringBuffer.append(TEXT_7);
+ stringBuffer.append( generatedBody.getBuffer() );
+ stringBuffer.append(TEXT_8);
+ stringBuffer.append(TEXT_9);
+ return stringBuffer.toString();
+ }
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/JET2TransformGenerator.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/JET2TransformGenerator.java
new file mode 100644
index 0000000..1409337
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/JET2TransformGenerator.java
@@ -0,0 +1,48 @@
+package org.eclipse.jet.internal.compiler.templates;
+
+import java.util.Map;
+import java.util.Iterator;
+
+public class JET2TransformGenerator
+{
+ protected static String nl;
+ public static synchronized JET2TransformGenerator create(String lineSeparator)
+ {
+ nl = lineSeparator;
+ JET2TransformGenerator result = new JET2TransformGenerator();
+ nl = null;
+ return result;
+ }
+
+ protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;