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.
/**
* (C) Copyright 2016-2019 teecube
* (https://teecu.be) and others.
*
* 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 t3.xml;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.XMLWriter;
import org.xml.sax.SAXException;
import t3.xml.RootElementNamespaceFilter.NamespaceDeclaration;
import javax.xml.XMLConstants;
import javax.xml.bind.*;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.SchemaFactory;
import java.io.*;
import java.lang.reflect.ParameterizedType;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
*
* @author Mathieu Debove <[email protected]>
*
*/
public class XMLMarshall {
private Type object;
public Type getObject() {
return object;
}
private JAXBContext jaxbContext;
private File xmlFile;
private List> classesToBound;
protected String rootElementLocalName;
protected List namespaceDeclarationsToRemove;
private Pattern patternElement = Pattern.compile("(\\w+)(\\[([\\w- \\*\\.\\/?]*)\\])?");
private HashMap map = new HashMap();
private InputStream xsdStream;
public XMLMarshall(File xmlFile) throws JAXBException, SAXException {
this(xmlFile, Object.class);
}
public XMLMarshall(File xmlFile, InputStream xsdStream) throws JAXBException, SAXException {
this(xmlFile, xsdStream, Object.class);
}
@SuppressWarnings("unchecked")
private Class getActualFactoryClass() {
Class cls = (Class) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[1]; // WARN
return cls;
}
public XMLMarshall(File xmlFile, InputStream xsdStream, Class