FileDocCategorySizeDatePackage
XSLTCSource.javaAPI DocJava SE 5 API4391Fri Aug 26 14:55:42 BST 2005com.sun.org.apache.xalan.internal.xsltc.trax

XSLTCSource

public final class XSLTCSource extends Object implements Source
author
Morten Jorgensen

Fields Summary
private String
_systemId
private Source
_source
private ThreadLocal
_dom
Constructors Summary
public XSLTCSource(String systemId)
Create a new XSLTC-specific source from a system ID


                   
       
    
        _systemId = systemId;
    
public XSLTCSource(Source source)
Create a new XSLTC-specific source from a JAXP Source

        _source = source;
    
Methods Summary
protected com.sun.org.apache.xalan.internal.xsltc.DOMgetDOM(com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager dtmManager, com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet translet)
Internal interface which returns a DOM for a given DTMManager and translet.

        SAXImpl idom = (SAXImpl)_dom.get();
                
        if (idom != null) {
            if (dtmManager != null) {
                idom.migrateTo(dtmManager);
            }
        }
        else {
            Source source = _source;
            if (source == null) {
                if (_systemId != null && _systemId.length() > 0) {
                    source = new StreamSource(_systemId);
                }
                else {
                    ErrorMsg err = new ErrorMsg(ErrorMsg.XSLTC_SOURCE_ERR);
                    throw new SAXException(err.toString());
                }
            }
            
            DOMWSFilter wsfilter = null;
            if (translet != null && translet instanceof StripFilter) {
                wsfilter = new DOMWSFilter(translet);
            }
                
            boolean hasIdCall = (translet != null) ? translet.hasIdCall() : false;
            
            if (dtmManager == null) {
                dtmManager = XSLTCDTMManager.newInstance();
            }
            
            idom = (SAXImpl)dtmManager.getDTM(source, true, wsfilter, false, false, hasIdCall);
            
            String systemId = getSystemId();
            if (systemId != null) {
                idom.setDocumentURI(systemId);
            }
            _dom.set(idom);
        }
        return idom;
    
public java.lang.StringgetSystemId()
Implements javax.xml.transform.Source.getSystemId() Get the system identifier that was set with setSystemId.

return
The system identifier that was set with setSystemId, or null if setSystemId was not called.

	if (_source != null) {
	    return _source.getSystemId();
	}
	else {
	    return(_systemId);
	}
    
public voidsetSystemId(java.lang.String systemId)
Implements javax.xml.transform.Source.setSystemId() Set the system identifier for this Source. This Source can get its input either directly from a file (in this case it will instanciate and use a JAXP parser) or it can receive it through ContentHandler/LexicalHandler interfaces.

param
systemId The system Id for this Source

        _systemId = systemId;
        if (_source != null) {
            _source.setSystemId(systemId);
        }