/**
* Minimal standard attribute types that MUST be supported. All related classes
* belong to java.base and can be implicitly derived form a given
* <code>String<code>.
*/
/**
* Minimal standard attribute types that MUST be supported. All related classes
* belong to java.base and can be implicitly derived form a given
* <code>String<code>.
*/
BOOLEAN(Boolean.class, new BooleanFormatter()), //
INTEGER(Integer.class, new IntegerFormatter()), //
LONG(Long.class, new LongFormatter()), //
DOUBLE(Double.class, new DoubleFormatter()), //
// we do not support short and float, like recent additions to Java
// (e.g. optional primitives)
BOOLEAN(Boolean.class, new BooleanFormatter()), //
INTEGER(Integer.class, new IntegerFormatter()), //
LONG(Long.class, new LongFormatter()), //
DOUBLE(Double.class, new DoubleFormatter()), //
// we do not support short and float, like recent additions to Java
// (e.g. optional primitives)
private <T> CrAttributeType(Class<T> clss, AttributeFormatter<T> formatter) {
this.clss = clss;
this.formatter = formatter;
}
private <T> CrAttributeType(Class<T> clss, AttributeFormatter<T> formatter) {
this.clss = clss;
this.formatter = formatter;
}
+ @Override
+ public String getDefaultPrefix() {
+ if (equals(UUID))
+ return CrName.CR_DEFAULT_PREFIX;
+ else
+ return "xs";
+ }
+
+ @Override
+ public String getNamespaceURI() {
+ if (equals(UUID))
+ return CrName.CR_NAMESPACE_URI;
+ else
+ return XMLConstants.W3C_XML_SCHEMA_NS_URI;
+ }
+
public static Object parse(String str) {
if (str == null)
throw new IllegalArgumentException("String cannot be null");
public static Object parse(String str) {
if (str == null)
throw new IllegalArgumentException("String cannot be null");