alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Jetty example source code file (configure_6_0.dtd)

This example Jetty source code file (configure_6_0.dtd) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Jetty tags/keywords

arg, arg, attlist, call, call, element, element, item, new, put, set, the, this, this

The Jetty configure_6_0.dtd source code

<?xml version="1.0" encoding="ISO-8859-1"?>

<!--
This is the document type descriptor for the
org.mortbay.util.XmlConfiguration class.  It allows a java object to be
configured by with a sequence of Set, Put and Call elements.  These tags are 
mapped to methods on the object to be configured as follows:

  <Set  name="Test">value              ==  obj.setTest("value");
  <Put  name="Test">value              ==  obj.put("Test","value");
  <Call name="test">value  ==  obj.test("value");

Values themselves may be configured objects that are created with the
<New> tag or returned from a  tag.

Values are matched to arguments on a best effort approach, but types
my be specified if a match is not achieved.

$Id: configure_1_3.dtd,v 1.2 2005/10/26 20:48:48 gregwilkins Exp $
-->

<!ENTITY % CONFIG "Get|Set|Put|Call|New|Ref|Array|Property">
<!ENTITY % VALUE "#PCDATA|Call|New|Get|SystemProperty|Array|Ref|Property">

<!ENTITY % TYPEATTR "type CDATA #IMPLIED " > 
<!ENTITY % IMPLIEDCLASSATTR "class NMTOKEN #IMPLIED" >
<!ENTITY % CLASSATTR "class NMTOKEN #REQUIRED" >
<!ENTITY % NAMEATTR "name NMTOKEN #REQUIRED" >
<!ENTITY % DEFAULTATTR "default CDATA #IMPLIED" >
<!ENTITY % IDATTR "id NMTOKEN #IMPLIED" >
<!ENTITY % REQUIREDIDATTR "id NMTOKEN #REQUIRED" >
<!--
Configure Element.
This is the root element that specifies the class of object that
can be configured:

    <Configure class="com.acme.MyClass"> ... 

A Configure element can contain Set, Put or Call elements.
-->
<!ELEMENT Configure (%CONFIG;)* >
<!ATTLIST Configure %IMPLIEDCLASSATTR; %IDATTR; >


<!--
Set Element.
This element maps to a call to a set method on the current object.
The name and optional type attributes are used to select the set 
method. If the name given is xxx, then a setXxx method is used, or
the xxx field is used of setXxx cannot be found. 
A Set element can contain value text and/or the value elements Call,
New and SystemProperty. If no value type is specified, then white
space is trimmed out of the value. If it contains multiple value
elements they are added as strings before being converted to any
specified type.

A Set with a class attribute is treated as a static set method invocation.
-->
<!ELEMENT Set ( %VALUE; )* >
<!ATTLIST Set %NAMEATTR; %TYPEATTR; %IMPLIEDCLASSATTR; >


<!--
Get Element.
This element maps to a call to a get method or field on the current object.
The name attribute is used to select the get method.
If the name given is xxx, then a getXxx method is used, or
the xxx field is used of setXxx cannot be found. 
A Get element can contain Set, Put and/or Call elements which act on the object
returned by the get call.

A Get with a class attribute is treated as a static get method or field.
-->
<!ELEMENT Get (%CONFIG;)*>
<!ATTLIST Get %NAMEATTR; %IMPLIEDCLASSATTR; %IDATTR; >

<!--
Put Element.
This element maps to a call to a put method on the current object,
which must implement the Map interface. The name attribute is used 
as the put key and the optional type attribute can force the type 
of the value.

A Put element can contain value text and/or the value elements Call,
New and SystemProperty. If no value type is specified, then white
space is trimmed out of the value. If it contains multiple value
elements they are added as strings before being converted to any
specified type.
-->
<!ELEMENT Put ( %VALUE; )* >
<!ATTLIST Put %NAMEATTR; %TYPEATTR; >


<!--
Call Element.
This element maps to an arbitrary call to a method on the current object,
The name attribute and Arg elements are used to select the method.

A Call element can contain a sequence of Arg elements followed by
a sequence of Set, Put and/or Call elements which act on any object
returned by the original call:

 <Call name="test">value1Value2

This is equivalent to:

 Object o2 = o1.test("value1");
 o2.setTest("value2");

A Call with a class attribute is treated as a static call.

-->
<!ELEMENT Call (Arg*,(%CONFIG;)*)>
<!ATTLIST Call %NAMEATTR; %IMPLIEDCLASSATTR; %IDATTR;>


<!--
Arg Element.
This element defines a positional argument for the Call element.
The optional type attribute can force the type of the value.

An Arg element can contain value text and/or the value elements Call,
New and SystemProperty. If no value type is specified, then white
space is trimmed out of the value. If it contains multiple value
elements they are added as strings before being converted to any
specified type.
-->
<!ELEMENT Arg ( %VALUE; )* >
<!ATTLIST Arg %TYPEATTR; >



<!--
New Element.
This element allows the creation of a new object as part of a 
value of a Set, Put or Arg element. The class attribute determines
the type of the new object and the contained Arg elements 
are used to select the constructor for the new object.

A New element can contain a sequence of Arg elements followed by
a sequence of Set, Put and/or Call elements which act on the new object:

 <New class="com.acme.MyClass">
   <Arg>value1Value2
 </New>

This is equivalent to:

 Object o = new com.acme.MyClass("value1");
 o.setTest("value2");

-->
<!ELEMENT New (Arg*,(%CONFIG;)*)>
<!ATTLIST New %CLASSATTR; %IDATTR;>

<!--
Ref Element.
This element allows a previously created object to be reference by id.

A Ref element can contain a sequence of Set, Put and/or Call elements 
which act on the referenced object:

 <Ref id="myobject">
   <Set name="Test">Value2
 </New>

-->
<!ELEMENT Ref ((%CONFIG;)*)>
<!ATTLIST Ref %REQUIREDIDATTR;>

<!--
Array Element.
This element allows the creation of a new array as part of a 
value of a Set, Put or Arg element. The type attribute determines
the type of the new array and the contained Item elements 
are used for each element of the array

 <Array type="java.lang.String">
   <Item>value0
   <Item>value1
 </Array>

This is equivalent to:
 String[] a = new String[] { "value0", new String("value1") };

-->
<!ELEMENT Array (Item*)>
<!ATTLIST Array %TYPEATTR; %IDATTR; >

<!--
Map Element.
This element allows the creation of a new array as part of a 
value of a Set, Put or Arg element. The type attribute determines
the type of the new array and the contained Item elements 
are used for each element of the array

 <Map>
   <Entry>
     <Item>keyName
     <Item>value1
   </Entry>
 </Map>

This is equivalent to:
 String[] a = new String[] { "value0", new String("value1") };

-->
<!ELEMENT Map (Entry*)>
<!ATTLIST Map %IDATTR; >
<!ELEMENT Entry (Item,Item)>


<!--
Item Element.
This element defines an entry for the Array or Map Entry elements.
The optional type attribute can force the type of the value.

An Item element can contain value text and/or the value elements Call,
New and SystemProperty. If no value type is specified, then white
space is trimmed out of the value. If it contains multiple value
elements they are added as strings before being converted to any
specified type.
-->
<!ELEMENT Item ( %VALUE; )* >
<!ATTLIST Item %TYPEATTR; %IDATTR; >


<!--
System Property Element.
This element allows JVM System properties to be retrieved as
part of the value of a Set, Put or Arg element.
The name attribute specifies the property name and the optional
default argument provides a default value.

 <SystemProperty name="Test" default="value"/>

This is equivalent to:

 System.getProperty("Test","value");

-->
<!ELEMENT SystemProperty EMPTY>
<!ATTLIST SystemProperty %NAMEATTR; %DEFAULTATTR; %IDATTR;>

<!--
Property Element.
This element allows arbitrary properties to be retrieved as
part of the value of a Set, Put or Arg element.
The name attribute specifies the property name and the optional
default argument provides a default value.

   <Property name="Test" default="value"/>
-->
<!ELEMENT Property EMPTY>
<!ATTLIST Property %NAMEATTR; %DEFAULTATTR; %IDATTR;>



Other Jetty examples (source code examples)

Here is a short list of links related to this Jetty configure_6_0.dtd source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.