1 28 29 package org.jibx.binding.model; 30 31 import org.jibx.binding.util.StringArray; 32 33 34 40 41 public class NameAttributes extends AttributeBase 42 { 43 44 public static final StringArray s_allowedAttributes = 45 new StringArray(new String [] { "name", "ns" }); 46 48 49 private String m_name; 50 51 52 private String m_uri; 53 54 55 private String m_prefix; 56 57 58 private boolean m_isAttribute; 59 60 61 private NamespaceElement m_namespace; 62 63 66 public NameAttributes() {} 67 68 76 public void setIsAttribute(boolean isattr) { 77 m_isAttribute = isattr; 78 } 79 80 86 public boolean isAttribute() { 87 return m_isAttribute; 88 } 89 90 95 public String getName() { 96 return m_name; 97 } 98 99 104 public void setName(String name) { 105 m_name = name; 106 } 107 108 113 public String getUri() { 114 return m_uri; 115 } 116 117 122 public void setUri(String uri) { 123 m_uri = uri; 124 } 125 126 131 public String getPrefix() { 132 return m_uri; 133 } 134 135 140 public void setPrefix(String prefix) { 141 m_prefix = prefix; 142 } 143 144 150 public NamespaceElement getNamespace() { 151 return m_namespace; 152 } 153 154 157 160 public void validate(ValidationContext vctx) { 161 if (m_name != null) { 162 DefinitionContext dctx = vctx.getDefinitions(); 163 if (m_isAttribute) { 164 m_namespace = dctx.getAttributeNamespace(this); 165 } else { 166 m_namespace = dctx.getElementNamespace(this); 167 } 168 } 169 super.validate(vctx); 170 } 171 } | Popular Tags |