private SerializedRootObject(XmlObject impl) { _xbeanClass = impl.schemaType().getJavaClass(); _impl = impl; }
private static XmlObject[] _typedArray(XmlObject[] input) { if (input.length == 0) return input; SchemaType commonType = input[0].schemaType(); if (commonType.equals(XmlObject.type) || commonType.isNoType()) return input; for (int i = 1; i < input.length; i++) { if (input[i].schemaType().isNoType()) return input; commonType = commonType.getCommonBaseType(input[i].schemaType()); if (commonType.equals(XmlObject.type)) return input; } Class desiredClass = commonType.getJavaClass(); while (desiredClass == null) { commonType = commonType.getBaseType(); if (XmlObject.type.equals(commonType)) return input; desiredClass = commonType.getJavaClass(); } XmlObject[] result = (XmlObject[])Array.newInstance(desiredClass, input.length); System.arraycopy(input, 0, result, 0, input.length); return result; }
private SerializedRootObject(XmlObject impl) { _xbeanClass = impl.schemaType().getJavaClass(); _impl = impl; }
private SerializedRootObject(XmlObject impl) { _xbeanClass = impl.schemaType().getJavaClass(); _impl = impl; }
private static XmlObject[] _typedArray(XmlObject[] input) { if (input.length == 0) return input; SchemaType commonType = input[0].schemaType(); if (commonType.equals(XmlObject.type) || commonType.isNoType()) return input; for (int i = 1; i < input.length; i++) { if (input[i].schemaType().isNoType()) return input; commonType = commonType.getCommonBaseType(input[i].schemaType()); if (commonType.equals(XmlObject.type)) return input; } Class desiredClass = commonType.getJavaClass(); while (desiredClass == null) { commonType = commonType.getBaseType(); if (XmlObject.type.equals(commonType)) return input; desiredClass = commonType.getJavaClass(); } XmlObject[] result = (XmlObject[])Array.newInstance(desiredClass, input.length); System.arraycopy(input, 0, result, 0, input.length); return result; }
private static XmlObject[] _typedArray(XmlObject[] input) { if (input.length == 0) return input; SchemaType commonType = input[0].schemaType(); if (commonType.equals(XmlObject.type) || commonType.isNoType()) return input; for (int i = 1; i < input.length; i++) { if (input[i].schemaType().isNoType()) return input; commonType = commonType.getCommonBaseType(input[i].schemaType()); if (commonType.equals(XmlObject.type)) return input; } Class desiredClass = commonType.getJavaClass(); while (desiredClass == null) { commonType = commonType.getBaseType(); if (XmlObject.type.equals(commonType)) return input; desiredClass = commonType.getJavaClass(); } XmlObject[] result = (XmlObject[])Array.newInstance(desiredClass, input.length); System.arraycopy(input, 0, result, 0, input.length); return result; }
private IDiscreteValueDomain<ITime> getTemporalDomain(final ObservationOfferingType xbObsOffering) { // TemporalDomain: final List<ITime> ocTimeList = new ArrayList<ITime>(); if (xbObsOffering.getTime() != null && xbObsOffering.getTime().getTimeGeometricPrimitive() != null) { final XmlObject xo = xbObsOffering.getTime().getTimeGeometricPrimitive().newCursor().getObject(); final SchemaType schemaType = xo.schemaType(); if (schemaType.getJavaClass().isAssignableFrom(TimeInstantType.class)) { final TimeInstantType xbTimeInstant = (TimeInstantType) xo; final String xbTimePos = xbTimeInstant.getTimePosition().getStringValue(); if ( !xbTimePos.equals("")) { ocTimeList.add(TimeFactory.createTime(xbTimePos)); } } else if (schemaType.getJavaClass().isAssignableFrom(TimePeriodType.class)) { final TimePeriodType xbTimePeriod = (TimePeriodType) xo; final String beginPos = xbTimePeriod.getBeginPosition().getStringValue(); final String endPos = xbTimePeriod.getEndPosition().getStringValue(); if ( !beginPos.equals("") && !endPos.equals("")) { final TimePeriod ocTimePeriod = new TimePeriod(beginPos, endPos); ocTimeList.add(ocTimePeriod); } } } final IDiscreteValueDomain<ITime> ocTemporalDomain = new TemporalValueDomain(ocTimeList); return ocTemporalDomain; }
public JType getType(GenerationContext context, QName concreteType, QName schemaType) throws GenerationException { SchemaType xst = loader.findDocumentType(concreteType); if (xst == null) { xst = loader.findDocumentType(schemaType); } if (xst != null) { return context.getCodeModel().ref(xst.getJavaClass()); } else { Class cls; Type type = tm.getType(schemaType); cls = (type != null) ? cls = type.getTypeClass() : XmlObject.class; return context.getCodeModel().ref(cls); } }
public XmlBeansType(SchemaType schemaType) { this.schemaType = schemaType; setTypeClass(schemaType.getJavaClass()); options.setDocumentType(schemaType); // Check to see if this is a <complexType> or global <element> if (schemaType.getContentModel() != null && schemaType.getContentModel().getParticleType() == SchemaParticle.ELEMENT) setAbstract(false); else setAbstract(true); if (!schemaType.isDocumentType() || isAbstract()) { setWriteOuter(true); } else { setWriteOuter(false); } }