Code example for LocatorImpl

Methods: setSystemId

0
    private SerializationHandler fSerializer = null;
 
    /** We do not need DOM2Helper since DOM Level 3 LS applies to DOM Level 2 or newer */ 
 
    /** Locator object for this TreeWalker          */ 
    private LocatorImpl fLocator = new LocatorImpl();
 
    /** ErrorHandler */ 
    private DOMErrorHandler fErrorHandler = null;
 
    /** LSSerializerFilter */ 
    private LSSerializerFilter fFilter = null;
 
    /** If the serializer is an instance of a LexicalHandler */ 
    private LexicalHandler fLexicalHandler = null;
 
    private int fWhatToShowFilter;
 
    /** New Line character to use in serialization */ 
    private String fNewLine = null;
 
    /** DOMConfiguration Properties */ 
    private Properties fDOMConfigProperties = null;
 
    /** Keeps track if we are in an entity reference when entities=true */ 
    private boolean fInEntityRef = false;
 
    /** Stores the version of the XML document to be serialize */ 
    private String fXMLVersion = null;
 
    /** XML Version, default 1.0 */ 
    private boolean fIsXMLVersion11 = false;
 
    /** Is the Node a Level 3 DOM node */ 
    private boolean fIsLevel3DOM = false;
 
    /** DOM Configuration Parameters */ 
    private int fFeatures = 0;
 
    /** Flag indicating whether following text to be processed is raw text          */ 
    boolean fNextIsRaw = false;
 
    //  
    private static final String XMLNS_URI = "http://www.w3.org/2000/xmlns/";
 
    // 
    private static final String XMLNS_PREFIX = "xmlns";
 
    //  
    private static final String XML_URI = "http://www.w3.org/XML/1998/namespace";
 
    //  
    private static final String XML_PREFIX = "xml";
 
    /** stores namespaces in scope */ 
    protected NamespaceSupport fNSBinder;
 
    /** stores all namespace bindings on the current element */ 
    protected NamespaceSupport fLocalNSBinder;
     
    /** stores the current element depth */ 
    private int fElementDepth = 0;
 
    // *********************************************************************** 
    // DOMConfiguration paramter settings  
    // *********************************************************************** 
    // Parameter canonical-form, true [optional] - NOT SUPPORTED  
    private final static int CANONICAL = 0x1 << 0;
 
    // Parameter cdata-sections, true [required] (default) 
    private final static int CDATA = 0x1 << 1;
 
    // Parameter check-character-normalization, true [optional] - NOT SUPPORTED  
    private final static int CHARNORMALIZE = 0x1 << 2;
 
    // Parameter comments, true [required] (default) 
    private final static int COMMENTS = 0x1 << 3;
 
    // Parameter datatype-normalization, true [optional] - NOT SUPPORTED 
    private final static int DTNORMALIZE = 0x1 << 4;
 
    // Parameter element-content-whitespace, true [required] (default) - value - false [optional] NOT SUPPORTED 
    private final static int ELEM_CONTENT_WHITESPACE = 0x1 << 5;
 
    // Parameter entities, true [required] (default) 
    private final static int ENTITIES = 0x1 << 6;
 
    // Parameter infoset, true [required] (default), false has no effect --> True has no effect for the serializer 
    private final static int INFOSET = 0x1 << 7;
 
    // Parameter namespaces, true [required] (default) 
    private final static int NAMESPACES = 0x1 << 8;
 
    // Parameter namespace-declarations, true [required] (default) 
    private final static int NAMESPACEDECLS = 0x1 << 9;
 
    // Parameter normalize-characters, true [optional] - NOT SUPPORTED 
    private final static int NORMALIZECHARS = 0x1 << 10;
 
    // Parameter split-cdata-sections, true [required] (default) 
    private final static int SPLITCDATA = 0x1 << 11;
 
    // Parameter validate, true [optional] - NOT SUPPORTED 
    private final static int VALIDATE = 0x1 << 12;
 
    // Parameter validate-if-schema, true [optional] - NOT SUPPORTED 
    private final static int SCHEMAVALIDATE = 0x1 << 13;
 
    // Parameter split-cdata-sections, true [required] (default) 
    private final static int WELLFORMED = 0x1 << 14;
 
    // Parameter discard-default-content, true [required] (default) 
    // Not sure how this will be used in level 2 Documents 
    private final static int DISCARDDEFAULT = 0x1 << 15;
 
    // Parameter format-pretty-print, true [optional]  
    private final static int PRETTY_PRINT = 0x1 << 16;
 
    // Parameter ignore-unknown-character-denormalizations, true [required] (default) 
    // We currently do not support XML 1.1 character normalization 
    private final static int IGNORE_CHAR_DENORMALIZE = 0x1 << 17;
 
    // Parameter discard-default-content, true [required] (default) 
    private final static int XMLDECL = 0x1 << 18;
 
    /** 
     * Constructor. 
     * @param   contentHandler serialHandler The implemention of the SerializationHandler interface 
     */ 
    DOM3TreeWalker( 
        SerializationHandler serialHandler,
        DOMErrorHandler errHandler,
        LSSerializerFilter filter,
        String newLine) {
        fSerializer = serialHandler;
        //fErrorHandler = errHandler == null ? new DOMErrorHandlerImpl() : errHandler; // Should we be using the default? 
        fErrorHandler = errHandler;
        fFilter = filter;
        fLexicalHandler = null;
        fNewLine = newLine;
 
        fNSBinder = new NamespaceSupport();
        fLocalNSBinder = new NamespaceSupport();
         
        fDOMConfigProperties = fSerializer.getOutputFormat();
        fSerializer.setDocumentLocator(fLocator);
        initProperties(fDOMConfigProperties);
         
        try { 
            // Bug see Bugzilla  26741 
            fLocator.setSystemId(
                System.getProperty("user.dir") + File.separator + "dummy.xsl");
        } catch (SecurityException se) { // user.dir not accessible from applet
 
        } 
    } 
Experience pair programming with AI  Get Codota for Java