Generate or convert text, programs, documents, or reports of any format or language
What can you do with the universal text generator? What is UniT?
What are the advantages of using UniT? Advantages
Frequently asked questions FAQ
How to install and start UniT Installation
How to program templates with the universal text generator How to use it
How to use the UniT interpreter with Java API
Things that might come in near future To Do
I appreciate comments Guest book
Nice stuff Credits & Links
Read license & download here License

So, what is UniT exactly?

A unit has two facets:

  1. A unit is a text template. A text template is mainly a text - any text or text format, such as HTML or XML. Such a text template contains special tags that dynamically insert nice content in the right place or start complex actions.
  2. Experts know that there is no way to create such a flexible technology, which can do all of these things without a programming language. UniT is also a very small, easy, Java-like programming language that allows loops, conditionals (if-then-else), and full access to Java. But UniT is easier than existing programming languages because complicated, unnecessary things such as type, class-, field-, and method declarations are simply skipped.

A unit is a mixture of a text and a computer program. The following image gives you an overview.

Overview of text generation

What can you do with the programming language part?

In principle, most features are very similar to those features that are allowed within Java methods. This means that everything you can do in Java methods, you can do in UniT, too. You can:

  • do loops,
  • execute different parts depending on any logic/Boolean condition expression (if-then-else),
  • create any Java object,
  • declare references to any Java object (variables/identifiers),
  • access any object and class (fields and methods),
  • calculate any expression, and
  • handle errors.

Of course, you can also access data sources like files and databases, or even execute a graphical user interface. A UniT program could call any Java program and vice versa.

And how is it different to Java?

UniT is exclusively designed to easily generate text in any format. UniT and Java have distinct purposes and it was not the intention to allow complex program logic within UniT by declaring types and members. It is not needed within UniT. If you need to execute complex logic within UniT, then you can call a Java program (written by a Java programming expert). If you need to generate text within Java, then you can call a UniT program.

Other differences are that

  • UniT realizes dynamic type checking, and therefore no type casting is needed,
  • there is no switch-statement,
  • there are no import directives, therefore if you need to name a class, you must qualify it totally, exactly as in Java, and
  • UniT only knows the primitive types boolean and int. There is no byte, short, long, char, float and double. But nevertheless, all constructors and methods can be executed, even those that expect parameters of a primitive type. Simply use instances of the classes Byte, Short, Long, Character, Float and Double to pass parameters of the corresponding primitive type.

Is UniT a mature technology?

The implementation of UniT has been tested extensively. The repeatable regression test should execute nearly every statement. Did you find a bug? Contact me (see below).

Do you have examples?

Yes! This website is generated with UniT! You'll find it within the download file that contains an example directory. Just read the readme.txt and open the files ending with .unit with a text editor.

Do you have more examples, e.g. RTF?

Not, yet. Do you have any? I would like to collect and publish some more.

I would like to do html-forms with UniT?

Well, you can generate html-forms with UniT, even embedded within servlets, but you/a programming expert should do the business logic with java, not with UniT-templates! UniT is no "visual tool", yet ;-)

Download the unrestricted, non-commercial version of UniT now!
It's about 220 KB including this whole site and examples.
With the download you accept the license agreement.

Generated with UniT - the Universal Text Generator Version 1.0
Copyright © 2000 Thorsten van Ellen. All Rights Reserved.