1 28 29 package org.jibx.binding.model; 30 31 import java.util.ArrayList ; 32 import java.util.Iterator ; 33 34 import org.jibx.binding.util.StringArray; 35 36 42 43 public abstract class NestingElementBase extends ElementBase 44 { 45 46 public static final StringArray s_allowedAttributes = 47 new StringArray(new String [] { "value-style" }); 48 49 50 private NestingAttributes m_nestingAttrs; 51 52 53 private DefinitionContext m_defContext; 54 55 56 private ArrayList m_children; 57 58 63 protected NestingElementBase(int type) { 64 super(type); 65 m_nestingAttrs = new NestingAttributes(); 66 m_children = new ArrayList (); 67 } 68 69 75 public final void addChild(Object child) { 76 m_children.add(child); 77 } 78 79 84 public final ArrayList children() { 85 return m_children; 86 } 87 88 93 public final Iterator childIterator() { 94 return m_children.iterator(); 95 } 96 97 103 public final DefinitionContext getDefinitions() { 104 return m_defContext; 105 } 106 107 112 void setDefinitions(DefinitionContext ctx) { 113 m_defContext = ctx; 114 } 115 116 119 124 public String getStyleName() { 125 return m_nestingAttrs.getStyleName(); 126 } 127 128 134 public int getStyle() { 135 return m_nestingAttrs.getStyle(); 136 } 137 138 144 public void setStyleName(String name) { 145 m_nestingAttrs.setStyleName(name); 146 } 147 148 155 public int getDefaultStyle() { 156 return m_nestingAttrs.getStyle(); 157 } 158 159 162 public void prevalidate(ValidationContext vctx) { 163 m_nestingAttrs.prevalidate(vctx); 164 super.prevalidate(vctx); 165 } 166 167 170 public void validate(ValidationContext vctx) { 171 m_nestingAttrs.validate(vctx); 172 super.validate(vctx); 173 } 174 } | Popular Tags |