JeeWiz Home  
The Model-Driven System Builder

JeeWiz Architect's Guide
 
Contents  >   13.  'Java' Reference
 


13.6 Jar Object

DescriptionThe Java 'jar' meta-class is a grouping of reference types - interfaces, jwclasses and their derivatives.

When rendering to Java, this will create a Java jar file.
ImplementsClassIndexer
Contained
Lists
1
Name  referenceType
Type  referenceType
Indexed property  name
 
2
Name  jarGlobalImports
Type  String
Description  List of packages to import into the Jar.

The packages specified on this list are included in the import statement on *all* generated Java files in the Jar. The individual names on this list (e.g. "jeewiz.test") will have ".*" appended, so the import statement will be "import jeewiz.test.*;". The imports get put into 'import' statements in the *.java files (or 'using' in C#, maybe).

The complete list of imports put into a interface or class in a Jar is
  • the imports listed in the interface or class, plus
  • the Jar's jar-global-imports list, plus
  • all the packages (as 'package.*') from all the interfaces or classes in the jar, if the create-aggregate-imports is true (which is the default, as described above).
In the JeeWiz editor, multiple external classes or packages may be specified as the jar-global-imports property using a comma separated list.

In XML, you can use one or more nested elements as an alternative to the 'jarGlobalImports=' property.
Unique  false
Inherited
properties
template (base property)

jwpattern (base property)

 13.6.1  Property 'name'
 13.6.2  Property 'extraJavacProperties'
 13.6.3  Property 'extraJavacElements'
 13.6.4  Property 'extraJarProperties'
 13.6.5  Property 'createAggregateImports'
 13.6.6  Property 'description'
 13.6.7  Property 'headerComment'
 13.6.8  Property 'customerHeaderComment'
 13.6.9  Property 'package'
 13.6.10  Property 'text'
 13.6.11  Property 'generateLogLevel'

13.6.1  Property 'name'
DescriptionThe name of the jar (e.g. 'myjar.jar'). The output jar goes in the $projectDir/dest directory. No extension is added automatically, so if you want to create a jar you must add '.jar'.
TypeString
Defaultjar1

13.6.2  Property 'extraJavacProperties'
DescriptionExtra properties to be passed to the Ant Javac task.

You should not set the Ant 'destdir' as one of these extra properties: this is generated automatically. The generated destdir includes the classpath, which is necessary to compile in most cases.
TypeString

13.6.3  Property 'extraJavacElements'
DescriptionExtra nested elements to be passed to the Ant Javac task.

Note that this allows you to specify additional 'src' nested elements, which will be added to the sources generated by JeeWiz.
TypeString

13.6.4  Property 'extraJarProperties'
DescriptionExtra properties to be passed to the Ant Jar task.
TypeString

13.6.5  Property 'createAggregateImports'
Aliascreate-aggregate-using-statements
DescriptionWhen this flag is set, all the packages of the interfaces and classes defined in the jar are automatically added to the import lists of all files generated by JeeWiz for the Jar. If you have a jar constructed from multiple packages, you can set this and not have to worry about inter-package references.

The default is that this is true in Java.

See also jar-global-imports.
Typeboolean
Defaulttrue

13.6.6  Property 'description'
DescriptionOptional description.

Use this to
  1. document the meaning of a particular item
  2. specify functionality at the design stage for implementation later.
TypeString
Support Element Inputstrue

13.6.7  Property 'headerComment'
DescriptionOptional header comment. If present, this is placed in a comment at the top of the generated file.

This is typically used for a copyright statement.

This is a delegated property - it can be added to the jar (or the application if present) and will be used for all children.
TypeString
Delegatestrue
Support Element Inputstrue

13.6.8  Property 'customerHeaderComment'
DescriptionOptional customer header comment.

If present, this is placed in a comment at the top of generated files that will be maintained by the customer.

This is typically used for a customer copyright statement.

This is a delegated property - it can be added to the jar (or the application if present) and will be used for all children.
TypeString
Delegatestrue
Support Element Inputstrue

13.6.9  Property 'package'
Aliasnamespace
DescriptionThis is the package attribute: it declares the name of the package that this interface (or class, or entity, etc.) belongs to.

It can be used on

  • reference types (interfaces and classes) and all their derivatives
  • associations
  • assemblies of model-objects
  • containers of same, like jars.
It uses delegation of responsibility to search its parent chain. For example, in the J2EE realm, this means that the package can be specified on (working up the containment chain):

  • an entity,
  • or its ejb-jar,
  • or the application,
  • or in the assembly
  • or in the build properties '.jwp' file.
If none of these is specified the package will be null. Null packages are not recommended but legal for simple Java builds. For larger systems, null packages are not allowed.

The combination of the package and class name (i.e. the fully-qualified Java classname) must be unique across all reference types and their derivatives in a build.
TypeString
Delegatestrue

13.6.10  Property 'text'
TypeString
Hiddentrue

13.6.11  Property 'generateLogLevel'
DescriptionShould be a number for the trace level priority to generate code. Any lower priority traces will be filtered out at *generate* time. Most tracing mechanisms, such as log4j, can also filter traces at run-time.

The priorities are
  • 1 = Fatal
  • 2 = Error
  • 4 = Warning
  • 6 - Info
  • 8 - Debug (Fine)
  • 9 - DetailedDebug (Finest)
This is a delegated property.

The default can be set for builds by setting generateLogLevel in the build properties.
TypeString
Delegatestrue
 


Copyright (c) 2001-2008 New Technology/enterprise Ltd.