Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
Vaadin is a web application framework for Rich Internet Applications (RIA).
Vaadin enables easy development and maintenance of fast and
secure rich web
applications with a stunning look and feel and a wide browser support.
It features a server-side architecture with the majority of the logic
running
on the server. Ajax technology is used at the browser-side to ensure a
rich
and interactive user experience.
/*
* Copyright 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.google.gwt.dev.util.xml;
import com.google.gwt.core.ext.TreeLogger;
import com.google.gwt.core.ext.TreeLogger.Type;
import com.google.gwt.core.ext.UnableToCompleteException;
import com.google.gwt.util.tools.Utility;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler;
import java.io.IOException;
import java.io.Reader;
import java.util.Stack;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
/**
* Somewhat general-purpose SAX-style XML parser that uses reflection and calls
* into your "schema" classes. For example, the element
* <server-name> maps to the method
* server_name. Note that the mapping is one-way, hyphens become
* underscores, but then you don't really want to use underscores in XML tag
* names anyway, do you? Also, all mixed content text (that is, text inside
* elements) is ignored, so think attributes.
*/
public final class ReflectiveParser {
private static SAXParserFactory saxParserFactory;
private static synchronized SAXParser createNewSaxParser() throws ParserConfigurationException,
SAXException {
if (saxParserFactory == null) {
Thread currentThread = Thread.currentThread();
ClassLoader oldClassLoader = currentThread.getContextClassLoader();
try {
// use system ClassLoader to avoid using expensive GWT ClassLoader
currentThread.setContextClassLoader(ClassLoader.getSystemClassLoader());
saxParserFactory = SAXParserFactory.newInstance();
saxParserFactory.setFeature(
"http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
} finally {
currentThread.setContextClassLoader(oldClassLoader);
}
}
return saxParserFactory.newSAXParser();
}
private static final class Impl extends DefaultHandler {
private Locator locator;
private Reader reader;
private Stack schemaLevels = new Stack();
private Stack