Source Code Cross Referenced for DOMSource.java in  » 6.0-JDK-Core » xml » javax » xml » transform » dom » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » xml » javax.xml.transform.dom 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001        /*
002         * Copyright 2000-2005 Sun Microsystems, Inc.  All Rights Reserved.
003         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004         *
005         * This code is free software; you can redistribute it and/or modify it
006         * under the terms of the GNU General Public License version 2 only, as
007         * published by the Free Software Foundation.  Sun designates this
008         * particular file as subject to the "Classpath" exception as provided
009         * by Sun in the LICENSE file that accompanied this code.
010         *
011         * This code is distributed in the hope that it will be useful, but WITHOUT
012         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014         * version 2 for more details (a copy is included in the LICENSE file that
015         * accompanied this code).
016         *
017         * You should have received a copy of the GNU General Public License version
018         * 2 along with this work; if not, write to the Free Software Foundation,
019         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020         *
021         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022         * CA 95054 USA or visit www.sun.com if you need additional information or
023         * have any questions.
024         */
025
026        package javax.xml.transform.dom;
027
028        import javax.xml.transform.Source;
029
030        import org.w3c.dom.Node;
031
032        /**
033         * <p>Acts as a holder for a transformation Source tree in the
034         * form of a Document Object Model (DOM) tree.</p>
035         * 
036         * <p>Note that XSLT requires namespace support. Attempting to transform a DOM
037         * that was not contructed with a namespace-aware parser may result in errors.
038         * Parsers can be made namespace aware by calling
039         * {@link javax.xml.parsers.DocumentBuilderFactory#setNamespaceAware(boolean awareness)}.</p>
040         * 
041         * @author <a href="Jeff.Suttor@Sun.com">Jeff Suttor</a>
042         * @version $Revision: 1.2 $, $Date: 2005/06/10 03:50:40 $
043         * @see <a href="http://www.w3.org/TR/DOM-Level-2">Document Object Model (DOM) Level 2 Specification</a>
044         */
045        public class DOMSource implements  Source {
046
047            /**
048             * <p><code>Node</code> to serve as DOM source.</p>
049             */
050            private Node node;
051
052            /**
053             * <p>The base ID (URL or system ID) from where URLs
054             * will be resolved.</p>
055             */
056            private String systemID;
057
058            /** If {@link javax.xml.transform.TransformerFactory#getFeature}
059             * returns true when passed this value as an argument,
060             * the Transformer supports Source input of this type.
061             */
062            public static final String FEATURE = "http://javax.xml.transform.dom.DOMSource/feature";
063
064            /**
065             * <p>Zero-argument default constructor.  If this constructor is used, and
066             * no DOM source is set using {@link #setNode(Node node)} , then the
067             * <code>Transformer</code> will
068             * create an empty source {@link org.w3c.dom.Document} using
069             * {@link javax.xml.parsers.DocumentBuilder#newDocument()}.</p>
070             *
071             * @see javax.xml.transform.Transformer#transform(Source xmlSource, Result outputTarget)
072             */
073            public DOMSource() {
074            }
075
076            /**
077             * Create a new input source with a DOM node.  The operation
078             * will be applied to the subtree rooted at this node.  In XSLT,
079             * a "/" pattern still means the root of the tree (not the subtree),
080             * and the evaluation of global variables and parameters is done
081             * from the root node also.
082             *
083             * @param n The DOM node that will contain the Source tree.
084             */
085            public DOMSource(Node n) {
086                setNode(n);
087            }
088
089            /**
090             * Create a new input source with a DOM node, and with the
091             * system ID also passed in as the base URI.
092             *
093             * @param node The DOM node that will contain the Source tree.
094             * @param systemID Specifies the base URI associated with node.
095             */
096            public DOMSource(Node node, String systemID) {
097                setNode(node);
098                setSystemId(systemID);
099            }
100
101            /**
102             * Set the node that will represents a Source DOM tree.
103             *
104             * @param node The node that is to be transformed.
105             */
106            public void setNode(Node node) {
107                this .node = node;
108            }
109
110            /**
111             * Get the node that represents a Source DOM tree.
112             *
113             * @return The node that is to be transformed.
114             */
115            public Node getNode() {
116                return node;
117            }
118
119            /**
120             * Set the base ID (URL or system ID) from where URLs
121             * will be resolved.
122             *
123             * @param systemID Base URL for this DOM tree.
124             */
125            public void setSystemId(String systemID) {
126                this .systemID = systemID;
127            }
128
129            /**
130             * Get the base ID (URL or system ID) from where URLs
131             * will be resolved.
132             *
133             * @return Base URL for this DOM tree.
134             */
135            public String getSystemId() {
136                return this.systemID;
137            }
138        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.