Package org.eclipse.persistence.internal.libraries.antlr.runtime.tree

Examples of org.eclipse.persistence.internal.libraries.antlr.runtime.tree.CommonTree


                charStream = new ANTLRInputStream(inputStream);
            }
            JSONLexer lexer = new JSONLexer(charStream);
            TokenRewriteStream tokens = new TokenRewriteStream(lexer);
            ExtendedJSONParser parser = new ExtendedJSONParser(tokens, input, getErrorHandler());                
            CommonTree commonTree = (CommonTree) parser.message().getTree();
            parseRoot(commonTree);
            if(null != inputStream) {
                inputStream.close();
            }
        } catch(RecognitionException e) {
View Full Code Here


        }
        if(includeRoot){
          parse((CommonTree) tree.getChild(0));
        }else{
          if(children == 1){
            CommonTree ct = (CommonTree) tree.getChild(0);
            if(ct != null && ct.getType() == JSONLexer.NULL){
              contentHandler.setNil(true);
            }
            contentHandler.startElement(XMLConstants.EMPTY_STRING, XMLConstants.EMPTY_STRING, null, attributes.setTree(tree, attributePrefix, namespaces, namespaceSeparator, namespaceAware));
            parse(ct);
            contentHandler.endElement(XMLConstants.EMPTY_STRING,XMLConstants.EMPTY_STRING, null);
View Full Code Here

              }
            }
            startCollection();
           
            if(size == 1){
        CommonTree ct = (CommonTree) tree.getChild(0);
        if(ct != null && ct.getType() == JSONLexer.NULL){
          contentHandler.setNil(true);
        }
        if(!isTextValue){
                  contentHandler.startElement(uri, parentLocalName, parentLocalName, attributes.setTree(ct, attributePrefix, namespaces, namespaceSeparator, namespaceAware));
                  }
                   parse(ct);
                   if(!isTextValue){
                      contentHandler.endElement(uri, parentLocalName, parentLocalName);
                   }
      }else{
           
      XPathFragment groupingXPathFragment = null;
      XPathFragment itemXPathFragment = null;
            if(contentHandler instanceof UnmarshalRecord) {
                UnmarshalRecord unmarshalRecord = (UnmarshalRecord) contentHandler;
                if(unmarshalRecord.getUnmarshaller().isWrapperAsCollectionName()) {
                    XPathNode unmarshalRecordXPathNode = unmarshalRecord.getXPathNode();
                    if(null != unmarshalRecordXPathNode) {
                        XPathFragment currentFragment = new XPathFragment();
                        currentFragment.setLocalName(parentLocalName);
                        currentFragment.setNamespaceURI(uri);
                        currentFragment.setNamespaceAware(namespaceAware);
                        XPathNode groupingXPathNode = unmarshalRecordXPathNode.getNonAttributeChildrenMap().get(currentFragment);
                        if(groupingXPathNode != null) {
                            if(groupingXPathNode.getUnmarshalNodeValue() instanceof CollectionGroupingElementNodeValue) {
                                groupingXPathFragment = groupingXPathNode.getXPathFragment();
                                contentHandler.startElement(uri, parentLocalName, parentLocalName, new AttributesImpl());
                                XPathNode itemXPathNode = groupingXPathNode.getNonAttributeChildren().get(0);
                                itemXPathFragment = itemXPathNode.getXPathFragment();
                            } else if(groupingXPathNode.getUnmarshalNodeValue() == null) {
                                XPathNode itemXPathNode = groupingXPathNode.getNonAttributeChildren().get(0);
                                if(itemXPathNode != null) {
                                    if(((MappingNodeValue)itemXPathNode.getUnmarshalNodeValue()).isContainerValue()) {
                                        groupingXPathFragment = groupingXPathNode.getXPathFragment();
                                        contentHandler.startElement(uri, parentLocalName, parentLocalName, new AttributesImpl());
                                         itemXPathFragment = itemXPathNode.getXPathFragment();
                                    }
                                }
                            }
                        }
                    }
                }
            }
            for(int x=0; x<size; x++) {
             CommonTree nextChildTree = (CommonTree) tree.getChild(x);
             if(nextChildTree.getType() == JSONLexer.NULL){
               ((UnmarshalRecord)contentHandler).setNil(true);
             }
             if(!isTextValue){
                 if(null != itemXPathFragment) {
                       contentHandler.startElement(itemXPathFragment.getNamespaceURI(), itemXPathFragment.getLocalName(), itemXPathFragment.getLocalName(), attributes.setTree(nextChildTree, attributePrefix, namespaces, namespaceSeparator, namespaceAware));
View Full Code Here

                          int size = childValueTree.getChildCount();
                          if(size == 0){                
                            attributesList.add(new Attribute(uri, attributeLocalName, attributeLocalName, ""));
                          }
                            for(int y=0; y<size; y++) {
                                CommonTree nextChildTree = (CommonTree) childValueTree.getChild(y);
                                addSimpleAttribute(attributesList, uri, attributeLocalName, nextChildTree);
                            }
                        }else{
                            addSimpleAttribute(attributesList, uri, attributeLocalName, childValueTree);
                        }
View Full Code Here

                charStream = new ANTLRInputStream(inputStream);
            }
            JSONLexer lexer = new JSONLexer(charStream);
            TokenRewriteStream tokens = new TokenRewriteStream(lexer);
            ExtendedJSONParser parser = new ExtendedJSONParser(tokens, input, getErrorHandler());                
            CommonTree commonTree = (CommonTree) parser.message().getTree();
            parseRoot(commonTree);
            if(null != inputStream) {
                inputStream.close();
            }
        } catch(RecognitionException e) {
View Full Code Here

        }
        if(includeRoot){
          parse((CommonTree) tree.getChild(0));
        }else{
          if(children == 1){
            CommonTree ct = (CommonTree) tree.getChild(0);
            if(ct != null && ct.getType() == JSONLexer.NULL){
              contentHandler.setNil(true);
            }
          contentHandler.startElement(Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, attributes.setTree(tree, attributePrefix, namespaces, namespaceSeparator, namespaceAware));
            parse(ct);
            contentHandler.endElement(Constants.EMPTY_STRING,Constants.EMPTY_STRING, null);
View Full Code Here

                        }
                    }
                }
            }
            for(int x=0; x<size; x++) {
             CommonTree nextChildTree = (CommonTree) tree.getChild(x);
             if(nextChildTree.getType() == JSONLexer.NULL){
               ((UnmarshalRecord)contentHandler).setNil(true);
             }
             if(!isTextValue){
                 if(null != itemXPathFragment) {
                       contentHandler.startElement(itemXPathFragment.getNamespaceURI(), itemXPathFragment.getLocalName(), itemXPathFragment.getLocalName(), attributes.setTree(nextChildTree, attributePrefix, namespaces, namespaceSeparator, namespaceAware));
View Full Code Here

                          int size = childValueTree.getChildCount();
                          if(size == 0){                
                            attributesList.add(new Attribute(uri, attributeLocalName, attributeLocalName, ""));
                          }
                            for(int y=0; y<size; y++) {
                                CommonTree nextChildTree = (CommonTree) childValueTree.getChild(y);
                                addSimpleAttribute(attributesList, uri, attributeLocalName, nextChildTree);
                            }
                        }else{
                            addSimpleAttribute(attributesList, uri, attributeLocalName, childValueTree);
                        }
View Full Code Here

                charStream = new ANTLRInputStream(inputStream);
            }
            JSONLexer lexer = new JSONLexer(charStream);
            TokenRewriteStream tokens = new TokenRewriteStream(lexer);
            ExtendedJSONParser parser = new ExtendedJSONParser(tokens, input, getErrorHandler());                
            CommonTree commonTree = (CommonTree) parser.message().getTree();
            parseRoot(commonTree);
            if(null != inputStream) {
                inputStream.close();
            }
        } catch(RecognitionException e) {
View Full Code Here

        }
        if(includeRoot){
          parse((CommonTree) tree.getChild(0));
        }else{
          if(children == 1){
            CommonTree ct = (CommonTree) tree.getChild(0);
            if(ct != null && ct.getType() == JSONLexer.NULL){
              contentHandler.setNil(true);
            }
          contentHandler.startElement(Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, attributes.setTree(tree, attributePrefix, namespaces, namespaceSeparator, namespaceAware));
            parse(ct);
            contentHandler.endElement(Constants.EMPTY_STRING,Constants.EMPTY_STRING, null);
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.internal.libraries.antlr.runtime.tree.CommonTree

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.