/* 795 */ return marshalled;
/* */ }
/* */
/* */ private boolean marshalWildcard(ParticleBinding particle, boolean declareNs)
/* */ {
/* 800 */ WildcardBinding wildcard = (WildcardBinding)particle.getTerm();
/* 801 */ Object o = this.stack.peek();
/* 802 */ AbstractMarshaller.ClassMapping mapping = getClassMapping(o.getClass());
/* 803 */ if (mapping == null)
/* */ {
/* 806 */ QName autoType = SimpleTypeBindings.typeQName(o.getClass());
/* 807 */ if (autoType != null)
/* */ {
/* 809 */ String marshalled = SimpleTypeBindings.marshal(autoType.getLocalPart(), o, null);
/* 810 */ this.content.characters(marshalled.toCharArray(), 0, marshalled.length());
/* 811 */ return true;
/* */ }
/* */
/* 815 */ ObjectLocalMarshaller marshaller = wildcard.getUnresolvedMarshaller();
/* 816 */ if (marshaller != null)
/* */ {
/* 818 */ marshaller.marshal(this.ctx, o);
/* 819 */ return true;
/* */ }
/* */
/* 822 */ String msg = "Failed to marshal wildcard: neither class mapping was found for " + o.getClass() + "@" + o.hashCode() + " (toString: " + o + ") nor marshaller for unresolved classes was setup.";
/* */
/* 826 */ if (this.ignoreUnresolvedWildcard)
/* */ {
/* 828 */ this.log.warn(msg);
/* 829 */ return true;
/* */ }
/* */
/* 833 */ throw new JBossXBRuntimeException(msg);
/* */ }
/* */
/* 838 */ Object parentRoot = this.root;
/* 839 */ AbstractMarshaller.Stack parentStack = this.stack;
/* 840 */ SchemaBinding parentSchema = this.schema;
/* */
/* 842 */ this.root = o;
/* 843 */ this.stack = new AbstractMarshaller.StackImpl();
/* 844 */ this.schema = (mapping.schemaUrl == null ? this.schema : XsdBinder.bind(mapping.schemaUrl, this.schemaResolver));
/* */
/* 847 */ if (mapping.elementName != null)
/* */ {
/* 849 */ ParticleBinding element = this.schema.getElementParticle(mapping.elementName);
/* 850 */ if (element == null)
/* */ {
/* 852 */ throw new JBossXBRuntimeException("Element " + mapping.elementName + " is not declared in the schema.");
/* */ }
/* */
/* 855 */ ParticleBinding ctxParticle = this.ctx.particle;
/* 856 */ MarshallingContextImpl.access$102(this.ctx, element);
/* 857 */ boolean marshalled = marshalElementOccurence((ElementBinding)element.getTerm(), this.root, particle.getMinOccurs() == 0, declareNs);
/* 858 */ MarshallingContextImpl.access$102(this.ctx, ctxParticle);
/* */ }
/* 860 */ else if (mapping.typeName != null)
/* */ {
/* 862 */ TypeBinding typeDef = this.schema.getType(mapping.typeName);
/* 863 */ if (typeDef == null)
/* */ {
/* 865 */ throw new JBossXBRuntimeException("Type " + mapping.typeName + " is not defined in the schema.");
/* */ }
/* */
/* 871 */ if (wildcard.getQName() == null)
/* */ {
/* 873 */ throw new JBossXBRuntimeException("Expected the wildcard to have a non-null QName.");
/* */ }
/* */
/* 876 */ ElementBinding element = new ElementBinding(this.schema, wildcard.getQName(), typeDef);
/* 877 */ ParticleBinding ctxParticle = this.ctx.particle;
/* 878 */ MarshallingContextImpl.access$102(this.ctx, new ParticleBinding(element));
/* 879 */ boolean marshalled = marshalElementOccurence(element, this.root, particle.getMinOccurs() == 0, declareNs);
/* 880 */ MarshallingContextImpl.access$102(this.ctx, ctxParticle);
/* */ }