com.sun.tools.xjc.reader.xmlschema.bindinfo.binding.rng Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jaxb-xjc Show documentation
Show all versions of jaxb-xjc Show documentation
JAXB Binding Compiler. Contains source code needed for binding customization files into java sources.
In other words: the *tool* to generate java classes for the given xml representation.
]>
import com.sun.codemodel.*;
import com.sun.tools.xjc.generator.bean.field.*;
import com.sun.tools.xjc.model.*;
import org.glassfish.jaxb.core.api.impl.NameConverter;
import org.glassfish.jaxb.core.v2.WellKnownNamespace;
import org.glassfish.jaxb.core.marshaller.SAX2DOMEx;
import com.sun.tools.xjc.reader.xmlschema.bindinfo.*;
import com.sun.tools.xjc.reader.Const;
import org.xml.sax.*;
import org.w3c.dom.Document;
import org.xml.sax.helpers.DefaultHandler;
import java.util.*;
import javax.xml.namespace.QName;
import javax.xml.parsers.ParserConfigurationException;
import java.io.StringWriter;
import org.glassfish.jaxb.core.marshaller.DataWriter;
// customization declarations
public BindInfo bi;
private StringWriter w;
private SAX2DOMEx sax2dom;
bi = new BindInfo($runtime.copyLocator());
$runtime.currentBindInfo = bi;
result =
bi.addDecl(result);
if($runtime.isExtensionURI($uri)) {
// parse this sub-tree as an extension
try {
sax2dom = new SAX2DOMEx();
} catch( ParserConfigurationException e ) {
throw new Error(e); // impossible
}
$runtime.redirectSubtree(sax2dom,$uri,$localName,$qname);
} else {
// ignore this sub-tree
sax2dom = null;
$runtime.redirectSubtree(new DefaultHandler(),$uri,$localName,$qname);
}
if(sax2dom!=null) {
bi.addDecl(new BIXPluginCustomization(((Document)sax2dom.getDOM()).getDocumentElement(),$runtime.copyLocator()));
}
msg =
bi.appendDocumentation($runtime.truncateDocComment(msg),true);
w = new StringWriter();
DataWriter xw = new DataWriter(w,"UTF-8");
xw.setXmlDecl(false);
$runtime.redirectSubtree(xw,$uri,$localName,$qname);
"+
$runtime.escapeMarkup($runtime.truncateDocComment(w.toString()))+
"
",
false );
w=null;
]]>