public String getStringValue() { if (isImmutable()) { if ((_flags & FLAG_NIL) != 0) return null; return compute_text(null); } // Since complex-content types don't have a "natural" string value, we // emit the deeply concatenated, tag-removed content of the tag. synchronized (monitor()) { if (_isComplexContent()) return get_store().fetch_text(TypeStore.WS_PRESERVE); check_dated(); if ((_flags & FLAG_NIL) != 0) return null; return compute_text(has_store() ? get_store() : null); } }
public XmlObject changeType(SchemaType type) { if (type == null) throw new IllegalArgumentException( "Invalid type (null)" ); if ((_flags & FLAG_STORE) == 0) { throw new IllegalStateException( "XML Value Objects cannot have thier type changed" ); } synchronized (monitor()) { check_orphaned(); return (XmlObject) get_store().change_type( type ); } }
public String xmlText (XmlOptions options) { XmlCursor cur = newCursorForce(); try { return cur.xmlText(makeInnerOptions(options)); } finally { cur.dispose(); } }
/** * True if the value is nilled. */ public final boolean isNil() { synchronized (monitor()) { check_dated(); return ((_flags & FLAG_NIL) != 0); } }
public int valueHashCode() { synchronized (monitor()) { return value_hash_code(); } }
setNil(); return; set( (XmlObject) o ); else if (o instanceof String) setStringValue( (String) o ); else if (o instanceof StringEnumAbstractBase) setEnumValue( (StringEnumAbstractBase) o ); else if (o instanceof BigInteger) setBigIntegerValue( (BigInteger) o ); else if (o instanceof BigDecimal) setBigDecimalValue( (BigDecimal) o ); else if (o instanceof Byte) setByteValue( ((Byte)o).byteValue() ); else if (o instanceof Short) setShortValue( ((Short)o).shortValue() ); else if (o instanceof Integer) setIntValue( ((Integer)o).intValue() ); else if (o instanceof Long) setLongValue( ((Long)o).longValue() ); else if (o instanceof Boolean) setBooleanValue( ((Boolean)o).booleanValue() ); else if (o instanceof Float) setFloatValue( ((Float)o).floatValue() ); else if (o instanceof Double) setDoubleValue( ((Double)o).doubleValue() ); else if (o instanceof Calendar) setCalendarValue( ((Calendar)o) ); else if (o instanceof Date)
if (isImmutable()) throw new IllegalStateException("Cannot set the value of an immutable XmlObject"); XmlObjectBase obj = underlying(src); setNil(); return this; if (obj.isImmutable()) setStringValue(obj.getStringValue()); else boolean noSyncThis = preCheck(); boolean noSyncObj = obj.preCheck(); if (monitor() == obj.monitor()) // both are in the same locale newObj = setterHelper( obj ); else // the locale is sync synchronized (monitor()) { newObj = setterHelper( obj ); newObj = setterHelper( obj ); synchronized (obj.monitor()) { newObj = setterHelper( obj ); synchronized (monitor()) {
/** * Same as set() but unsynchronized. * Warning: Using this method in mutithreaded environment can cause invalid states. */ public final XmlObject _set(XmlObject src) { if (isImmutable()) throw new IllegalStateException("Cannot set the value of an immutable XmlObject"); XmlObjectBase obj = underlying(src); TypeStoreUser newObj = this; if (obj == null) { setNil(); return this; } if (obj.isImmutable()) set(obj.stringValue()); else { check_orphaned(); obj.check_orphaned(); newObj = get_store().copy_contents_from( obj.get_store() ). get_store().change_type( obj.schemaType() ); } return (XmlObject) newObj; }
XmlObjectBase srcObj = underlying(src); synchronized (monitor()) XmlObjectBase target = getTargetForSetter(propName, index, kindSetterHelper); target.setNil(); return target; if (srcObj.isImmutable()) synchronized (monitor()) XmlObjectBase target = getTargetForSetter(propName, index, kindSetterHelper); target.setStringValue(srcObj.getStringValue()); return (XmlObject) target; boolean noSyncThis = preCheck(); boolean noSyncObj = srcObj.preCheck(); if (monitor() == srcObj.monitor()) // both are in the same locale return (XmlObject)objSetterHelper(srcObj, propName, index, kindSetterHelper); synchronized (monitor()) return (XmlObject)objSetterHelper(srcObj, propName, index, kindSetterHelper); return (XmlObject)objSetterHelper(srcObj, propName, index, kindSetterHelper);
public final void setBigIntegerValue(BigInteger obj) { if (obj == null) setNil(); else { synchronized (monitor()) { set_prepare(); set_BigInteger(obj); set_commit(); } } } public final void setBigDecimalValue(BigDecimal obj)
public final void setCalendarValue(Calendar obj) { if (obj == null) setNil(); else { synchronized (monitor()) { set_prepare(); set_Calendar(obj); set_commit(); } } } public final void setDateValue(Date obj)
public final void setGDurationValue(GDurationSpecification obj) { if (obj == null) setNil(); else { synchronized (monitor()) { set_prepare(); set_GDuration(obj); set_commit(); } } } public final void setQNameValue(QName obj)
public final void setByteArrayValue(byte[] obj) { if (obj == null) setNil(); else { synchronized (monitor()) { set_prepare(); set_ByteArray(obj); set_commit(); } } } public final void setEnumValue(StringEnumAbstractBase obj)
public XmlObject[] execQuery ( String queryExpr, XmlOptions options ) { synchronized (monitor()) { TypeStore typeStore = get_store(); if (typeStore == null) { throw new XmlRuntimeException( "Cannot do XQuery on XML Value Objects" ); } try { return _typedArray(typeStore.exec_query( queryExpr, options )); } catch (XmlException e) { throw new XmlRuntimeException( e ); } } }
String def = get_store().compute_default_text(); if (def == null) throw new XmlValueOutOfRangeException(); try { this.setStringValue(def); } finally { _flags &= ~FLAG_SETTINGDEFAULT; } _flags &= ~FLAG_NIL; set_text(v); _flags &= ~(FLAG_NIL | FLAG_ISDEFAULT);
/** * Same as copy() but unsynchronized. * If Locale.COPY_USE_NEW_LOCALE is set in the options, a new locale will be created for the copy. * Warning: Using this method in mutithreaded environment can cause invalid states. */ public final XmlObject _copy(XmlOptions xmlOptions) { // immutable objects don't get copied. They're immutable if (isImmutable()) return this; check_orphaned(); SchemaTypeLoader stl = get_store().get_schematypeloader(); XmlObject result = (XmlObject)get_store().copy(stl, schemaType(), xmlOptions); return result; }
private TypeStoreUser objSetterHelper(XmlObjectBase srcObj, QName propName, int index, short kindSetterHelper) { XmlObjectBase target = getTargetForSetter(propName, index, kindSetterHelper); target.check_orphaned(); srcObj.check_orphaned(); return target.get_store().copy_contents_from( srcObj.get_store() ). get_store().change_type( srcObj.schemaType() ); }
public final void setLongValue(long v) { synchronized (monitor()) { set_prepare(); set_long(v); set_commit(); } } public final void setFloatValue(float v)
public final void setFloatValue(float v) { synchronized (monitor()) { set_prepare(); set_float(v); set_commit(); } } public final void setDoubleValue(double v)