protected XMLEventParserContext createParserContext(XMLEventReader reader)
        {
            this.parserContext = new BasicXMLEventParserContext(reader);
            this.parserContext.setDefaultNamespaceURI(this.getDefaultNamespaceURI());

            return(this.parserContext);
        }
        private void initialize()
        {
            this.parserContext = this.createParserContext(this.eventReader);

            SERVICE         = new QName(this.getNamespaceURI(), "Service");
            CAPABILITY      = new QName(this.getNamespaceURI(), "Capability");
            VERSION         = new QName(this.getNamespaceURI(), "version");
            UPDATE_SEQUENCE = new QName(this.getNamespaceURI(), "updateSequence");

            this.getParserContext().registerParser(SERVICE, new OGCServiceInformation(this.getNamespaceURI()));
            // Capability parser is registered by subclass.
        }
示例#3
0
        public XMLEventParser allocate(XMLEventParserContext ctx, XMLEvent event)
        {
            XMLEventParser defaultParser = null;

            XMLEventParser parser = super.allocate(ctx, event);

            if (parser != null)
            {
                return(parser);
            }

            if (ctx.isStartElement(event, LEGEND_URL))
        /** {@inheritDoc} */
        public XMLEventParser allocate(XMLEventParserContext ctx, XMLEvent event)
        {
            if (ctx == null)
            {
                String message = Logging.getMessage("nullValue.ParserContextIsNull");
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }

            XMLEventParser defaultParser = null;

            if (ctx.isStartElement(event, SERVICE))
            /**
             * Construct an instance for a specified list of mime types and a specified prototype parser.
             *
             * @param mimeTypes        the list of mime types for which to use the specified prototype parser context.
             * @param prototypeContext the prototype parser context to use for the specified mime types. This parser
             *                         context's class must provide a copy constructor, a constructor that takes an instance
             *                         of its class as its only argument.
             *
             * @throws ArgumentException if the mime type list is null or empty or the prototype context is null or
             *                                  has no copy constructor.
             */
            public ParserTableEntry(String[] mimeTypes, XMLEventParserContext prototypeContext)
            {
                foreach (String mimeType in mimeTypes)
                {
                    this.mimeTypes.add(mimeType);
                }

                this.prototypeParser = prototypeContext;

                // Ensure the prototype has a copy constructor
                try
                {
                    prototypeContext.GetType().getConstructor(prototypeContext.GetType());
                }
                catch (NoSuchMethodException e)
                {
                    String message = Logging.getMessage("XML.NoCopyConstructor");
                    Logging.logger().severe(message);
                    throw new ArgumentException(message);
                }
            }
        /** {@inheritDoc} */
        public object parse(XMLEventParserContext ctx, javax.xml.stream.events.XMLEvent inputEvent, params object[] args)
        {
            if (ctx == null)
            {
                string message = Logging.getMessage("nullValue.ParserContextIsNull");
                Logging.logger().severe(message);
                throw new System.ArgumentException(message);
            }

            if (inputEvent == null)
            {
                string message = Logging.getMessage("nullValue.EventIsNull");
                Logging.logger().severe(message);
                throw new System.ArgumentException(message);
            }

            try
            {
                // Parse this event's attributes
                this.doParseEventAttributes(ctx, inputEvent, args);

                // Build the symbol table
                string id = (string)this.getField("id");
                if (id != null)
                {
                    ctx.addId(id, this);
                }
            }
            catch (javax.xml.stream.XMLStreamException e)
            {
                ctx.firePropertyChange(new XMLParserNotification(ctx, XMLParserNotification.EXCEPTION, inputEvent,
                                                                 "XML.ExceptionParsingElement", null, e));
            }

            // Parse the event's subelements.
            for (XMLEvent event = ctx.nextEvent(); ctx.hasNext(); event = ctx.nextEvent())
示例#7
0
 public Object parse(XMLEventParserContext ctx, XMLEvent booleanEvent, Object...args) throws XMLStreamException
 public XMLEventParser allocate(XMLEventParserContext ctx, XMLEvent event)
 {
     if (ctx.isStartElement(event, LAYER))
 protected void doParseEventAttributes(XMLEventParserContext ctx, XMLEvent event, Object...args)
示例#10
0
        public XMLEventParser allocate(XMLEventParserContext ctx, XMLEvent event)
        {
            XMLEventParser defaultParser = null;

            if (ctx.isStartElement(event, ONLINE_RESOURCE))
示例#11
0
        public XMLEventParser allocate(XMLEventParserContext ctx, XMLEvent event)
        {
            XMLEventParser defaultParser = null;

            if (this.isRequestName(ctx, event.asStartElement().getName()))
示例#12
0
 protected void doAddEventAttribute(Attribute attr, XMLEventParserContext ctx, XMLEvent event, Object...args)
        public XMLEventParser allocate(XMLEventParserContext ctx, XMLEvent event)
        {
            XMLEventParser defaultParser = null;

            if (ctx.isStartElement(event, CONTACT_ADDRESS))
示例#14
0
 public Object parse(XMLEventParserContext context, XMLEvent event, Object...args) throws XMLStreamException
        public XMLEventParser allocate(XMLEventParserContext ctx, XMLEvent event)
        {
            XMLEventParser defaultParser = null;

            if (ctx.isStartElement(event, DCPTYPE))
示例#16
0
 protected void doAddEventContent(Object o, XMLEventParserContext ctx, XMLEvent event, Object...args)
 protected void doParseEventContent(XMLEventParserContext ctx, XMLEvent event, Object...args)
示例#18
0
 abstract protected bool isRequestName(XMLEventParserContext ctx, QName name);