Package com.sun.xml.bind.v2.schemagen.xmlschema

Examples of com.sun.xml.bind.v2.schemagen.xmlschema.Particle


        byte [] value = null;
        if(reader.getEventType() == reader.CHARACTERS){
            if(reader instanceof XMLStreamReaderEx){
                CharSequence charSeq = ((XMLStreamReaderEx)reader).getPCDATA();
                if(charSeq instanceof Base64Data){
                    Base64Data bd = (Base64Data) ((XMLStreamReaderEx)reader).getPCDATA();
                    value = bd.getExact();
                    if(canonWriter != null){
                        String ev = Base64.encode(value);
                        canonWriter.writeCharacters(ev);
                    }
                }else{
View Full Code Here


        builtinBeanInfos = Collections.unmodifiableList(l);
    }

    private static byte[] decodeBase64(CharSequence text) {
        if (text instanceof Base64Data) {
            Base64Data base64Data = (Base64Data) text;
            return base64Data.getExact();
        } else {
            return DatatypeConverterImpl._parseBase64Binary(text.toString());
        }
    }
View Full Code Here

    }

    public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap<ChildLoader> handlers) {
        keyLoader = keyBeanInfo.getLoader(chain.context,true);
        valueLoader = valueBeanInfo.getLoader(chain.context,true);
        handlers.put(tagName,new ChildLoader(itemsLoader,null));
    }
View Full Code Here

            }
            if(t!=null) {
                assign(bean,t,context);
            } else {
                // try again later
                final LocatorEx loc = new LocatorEx.Snapshot(context.getLocator());
                context.addPatcher(new Patcher() {
                    public void run() throws SAXException {
                        try {
                            TargetT t = (TargetT)callable.call();
                            if(t==null) {
View Full Code Here

            if(t!=null) {
                assign(bean,t,context);
            } else {
                // try again later
                final LocatorEx loc = new LocatorEx.Snapshot(context.getLocator());
                context.addPatcher(new Patcher() {
                    public void run() throws SAXException {
                        try {
                            TargetT t = (TargetT)callable.call();
                            if(t==null) {
                                context.errorUnresolvedIDREF(bean,idref,loc);
View Full Code Here

    public Loader getLoader(JAXBContextImpl context, boolean typeSubstitutionCapable) {
        if(loader==null) {
            // these variables have to be set before they are initialized,
            // because the initialization may build other loaders and they may refer to this.
            StructureLoader sl = new StructureLoader(this);
            loader = sl;
            if(ci.hasSubClasses())
                loaderWithTypeSubst = new XsiTypeLoader(this);
            else
                // optimization. we know there can be no @xsi:type
                loaderWithTypeSubst = loader;


            sl.init(context,this,ci.getAttributeWildcard());
        }
        if(typeSubstitutionCapable)
            return loaderWithTypeSubst;
        else
            return loader;
View Full Code Here

    public MarshallerImpl createMarshaller() {
        return new MarshallerImpl(this,null);
    }

    public UnmarshallerImpl createUnmarshaller() {
        return new UnmarshallerImpl(this,null);
    }   
View Full Code Here

                acc.set(bean,t);
        }

        public void parse(final BeanT bean, CharSequence lexical) throws AccessorException, SAXException {
            final String idref = WhiteSpaceProcessor.trim(lexical).toString();
            final UnmarshallingContext context = UnmarshallingContext.getInstance();

            final Callable callable = context.getObjectFromId(idref,acc.valueType);
            if(callable==null) {
                // the IDResolver decided to abort it now
                context.errorUnresolvedIDREF(bean,idref,context.getLocator());
                return;
            }

            TargetT t;
            try {
                t = (TargetT)callable.call();
            } catch (SAXException e) {// from callable.call
                throw e;
            } catch (RuntimeException e) {// from callable.call
                throw e;
            } catch (Exception e) {// from callable.call
                throw new SAXException2(e);
            }
            if(t!=null) {
                assign(bean,t,context);
            } else {
                // try again later
                final LocatorEx loc = new LocatorEx.Snapshot(context.getLocator());
                context.addPatcher(new Patcher() {
                    public void run() throws SAXException {
                        try {
                            TargetT t = (TargetT)callable.call();
                            if(t==null) {
                                context.errorUnresolvedIDREF(bean,idref,loc);
                            } else {
                                assign(bean,t,context);
                            }
                        } catch (AccessorException e) {
                            context.handleError(e);
                        } catch (SAXException e) {// from callable.call
                            throw e;
                        } catch (RuntimeException e) {// from callable.call
                            throw e;
                        } catch (Exception e) {// from callable.call
View Full Code Here

            // these variables have to be set before they are initialized,
            // because the initialization may build other loaders and they may refer to this.
            StructureLoader sl = new StructureLoader(this);
            loader = sl;
            if(ci.hasSubClasses())
                loaderWithTypeSubst = new XsiTypeLoader(this);
            else
                // optimization. we know there can be no @xsi:type
                loaderWithTypeSubst = loader;

View Full Code Here

            String tns = wp.getName().getNamespaceURI();
            Schema xsd = xsds.get(tns);           
            Element e =  xsd._element(Element.class);
            e._attribute("name", wp.getName().getLocalPart());
            e.type(wp.getName());
            ComplexType ct =  xsd._element(ComplexType.class);
            ct._attribute("name", wp.getName().getLocalPart());
            ExplicitGroup sq = ct.sequence();           
            for (ParameterImpl p : wp.getWrapperChildren() ) if (p.getBinding().isBody()) addChild(sq, p);
        }
        for(Schema xsd: xsds.values()) xsd.commit();
    }
View Full Code Here

TOP

Related Classes of com.sun.xml.bind.v2.schemagen.xmlschema.Particle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.