01: /*
02: * Created on 22 Jul 2006
03: */
04: package uk.org.ponder.rsf.components.decorators;
05:
06: import uk.org.ponder.rsf.content.ContentTypeInfo;
07:
08: /** A decorator which allows customisation of IKAT's strategy for allocating
09: * the "id" attribute on a tag-by-tag basis. This will override the more
10: * general strategy declared for the content type in {@link ContentTypeInfo}.
11: *
12: * @author Antranig Basman (antranig@caret.cam.ac.uk)
13: *
14: */
15:
16: public class UIIDStrategyDecorator implements UIDecorator {
17: /** A special constant in addition to those in {@link ContentTypeInfo}, specifying
18: * that the ID of this element will be allocated to the value held in
19: * <code>ID</code>.
20: */
21: public static final String ID_MANUAL = "manual";
22:
23: public static final UIIDStrategyDecorator ID_FULL = new UIIDStrategyDecorator(
24: true, ContentTypeInfo.ID_FULL);
25:
26: public static final UIIDStrategyDecorator ID_NONE = new UIIDStrategyDecorator(
27: true, ContentTypeInfo.ID_NONE);
28:
29: public static final UIIDStrategyDecorator ID_RSF = new UIIDStrategyDecorator(
30: true, ContentTypeInfo.ID_RSF);
31:
32: public String IDStrategy;
33:
34: public String ID;
35:
36: /** Constructs a manual ID strategy setting the "id" attribute to the
37: * specified value.
38: */
39: public UIIDStrategyDecorator(String ID) {
40: this .ID = ID;
41: this .IDStrategy = ID_MANUAL;
42: }
43:
44: public UIIDStrategyDecorator(boolean builtin, String IDStrategy) {
45: this .IDStrategy = IDStrategy;
46: }
47:
48: public UIIDStrategyDecorator() {
49: }
50: }
|