Package javax.xml.stream

Examples of javax.xml.stream.XMLStreamReader.require()


    void parse() throws IOException, XMLStreamException {
        InputStream in = new BufferedInputStream(new FileInputStream(inputFile));
        try {
            XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(in);
            reader.require(START_DOCUMENT, null, null);
            int type = reader.next();
            while (type != END_DOCUMENT) {
                System.out.println(formatType(type));
                if (type == START_ELEMENT) {
                    System.out.println(reader.getLocalName());
View Full Code Here


        try {
            XMLInputFactory factory = XMLInputFactory.newInstance();
            factory.setProperty(XMLInputFactory.IS_COALESCING, Boolean.FALSE);
            XMLStreamReader reader = factory.createXMLStreamReader(in);

            reader.require(START_DOCUMENT, null, null);
            Map<String, String> configAttributes = new HashMap<String, String>();
            configAttributes.put("default-supplement", null);
            ParsingUtils.getNextElement(reader, "config", configAttributes, false);
            extensionModule = ParsingUtils.getNextElement(reader, "extension-module", null, true);
            ParsingUtils.getNextElement(reader, "subsystem", null, false);
View Full Code Here

        try {
            XMLInputFactory factory = XMLInputFactory.newInstance();
            factory.setProperty(XMLInputFactory.IS_COALESCING, Boolean.FALSE);
            XMLStreamReader reader = factory.createXMLStreamReader(in);

            reader.require(START_DOCUMENT, null, null);
            ParsingUtils.getNextElement(reader, rootElementName, null, false);
            root = super.parseNode(reader, rootElementName);

        } finally {
            try {
View Full Code Here

    void parse() throws IOException, XMLStreamException {
        InputStream in = new BufferedInputStream(new FileInputStream(inputFile));
        try {
            XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(in);
            reader.require(START_DOCUMENT, null, null);
            boolean done = false;
            while (reader.hasNext()) {
                int type = reader.next();
                switch (type) {
                case START_ELEMENT:
View Full Code Here

      while(xmlr6.hasNext()) {
        //Get and check each SiteService for the right SiteServiceID
        xmlr6.next();
        if (xmlr6.isStartElement()) {
          if (xmlr6.getLocalName().equals("SiteService")) {
            xmlr6.require(XMLStreamConstants.START_ELEMENT, null, "SiteService");
            JAXBElement<SiteService> siteServiceJAXB = unmarshaller.unmarshal(xmlr6, SiteService.class);
            SiteService siteServiceElement = (SiteService)siteServiceJAXB.getValue();
            //Get the ServiceID from this Service
            if (siteServiceElement.getKey().equals(siteServiceID)) {
              serviceKey = siteServiceElement.getServiceID();
View Full Code Here

      while(xmlr7.hasNext()) {
        xmlr7.next();
        if (xmlr7.isStartElement()) {
          //System.out.println("local name is: " + xmlr.getLocalName());
          if (xmlr7.getLocalName().equals("SiteServiceParticipation")) {
            xmlr7.require(XMLStreamConstants.START_ELEMENT, null, "SiteServiceParticipation");
            JAXBElement<SiteServiceParticipation> siteServiceParticipationJAXB = unmarshaller.unmarshal(xmlr7, SiteServiceParticipation.class);
            SiteServiceParticipation siteServiceParticipationElement = (SiteServiceParticipation)siteServiceParticipationJAXB.getValue();
            //Get only this household's SiteServiceParticipations            
            try {
              String hhid = siteServiceParticipationElement.getHouseholdID().getIDStr();
View Full Code Here

      while(xmlr8.hasNext()) {
        xmlr8.next();
        if (xmlr8.isStartElement()) {
          //System.out.println("local name is: " + xmlr.getLocalName());
          if (xmlr8.getLocalName().equals("SiteServiceParticipation")) {
            xmlr8.require(XMLStreamConstants.START_ELEMENT, null, "SiteServiceParticipation");
            JAXBElement<SiteServiceParticipation> siteServiceParticipationJAXB = unmarshaller.unmarshal(xmlr8, SiteServiceParticipation.class);
            siteServiceParticipationElement = (SiteServiceParticipation)siteServiceParticipationJAXB.getValue();
            //Get only this household's SiteServiceParticipations            
            try {
              String hhid = siteServiceParticipationElement.getHouseholdID().getIDStr();
View Full Code Here

      while(xmlr8.hasNext()) {
        //Get and check each Person with the right Head of Household ID
        xmlr8.next();
        if (xmlr8.isStartElement()) {
          if (xmlr8.getLocalName().equals("Person")) {
            xmlr8.require(XMLStreamConstants.START_ELEMENT, null, "Person");
            JAXBElement<Person> personJAXB = unmarshaller.unmarshal(xmlr8, Person.class);
            Person person = (Person)personJAXB.getValue();
            //Get only the person with the same id as the head of household's id
            if (person.getPersonID().getIDNum().equals(household.getHeadOfHouseholdID().getIDNum())) {
              ssn = person.getSocialSecurityNumber().getUnhashed().getValue();
View Full Code Here

      while(xmlr9.hasNext()) {
        //Get and check each Person with the right Head of Household ID
        xmlr9.next();
        if (xmlr9.isStartElement()) {
          if (xmlr9.getLocalName().equals("Person")) {
            xmlr9.require(XMLStreamConstants.START_ELEMENT, null, "Person");
            JAXBElement<Person> personJAXB = unmarshaller.unmarshal(xmlr9, Person.class);
            Person person = (Person)personJAXB.getValue();
            //Get only the person with the same id as the head of household's id
            for (SiteServiceParticipation ssp2 : person.getSiteServiceParticipation()) {
              if (ssp2.getSiteServiceParticipationID().getIDNum().equals(sspID)) {
View Full Code Here

      while(xmlr10.hasNext()) {
        //Get and check each Person with the right Head of Household ID
        xmlr10.next();
        if (xmlr10.isStartElement()) {
          if (xmlr10.getLocalName().equals("Person")) {
            xmlr10.require(XMLStreamConstants.START_ELEMENT, null, "Person");
            JAXBElement<Person> personJAXB = unmarshaller.unmarshal(xmlr10, Person.class);
            Person person = (Person)personJAXB.getValue();
            //Get only the person with the same id as the head of household's id
            if (person.getPersonID().getIDNum().equals(member.getPersonID().getIDNum())) {
                personReturn = person;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.