Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
Apache Ant Source Code Files
Apache Ant Source Code Files are inside the Apache Ant source package file like apache-ant-1.10.10-src.zip. Unzip the source package file and go to the "src/main" sub-directory, you will see source code files.
Here is the list of Java source code files of the Apache Ant 1.10.10 in \Users\fyicenter\apache-ant-1.10.10\src\main:
✍: FYIcenter.com
⏎ org/apache/tools/ant/util/XMLFragment.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You 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 * * https://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 org.apache.tools.ant.util; import org.apache.tools.ant.DynamicConfiguratorNS; import org.apache.tools.ant.DynamicElementNS; import org.apache.tools.ant.ProjectComponent; import org.w3c.dom.Document; import org.w3c.dom.DocumentFragment; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.Text; /** * Use this class as a nested element if you want to get a literal DOM * fragment of something nested into your task/type. * * <p>This is useful for tasks that want to deal with the "real" XML * from the build file instead of objects.</p> * * <p>Code heavily influenced by code written by Dominique Devienne.</p> * * @since Ant 1.7 */ public class XMLFragment extends ProjectComponent implements DynamicElementNS { private Document doc; private DocumentFragment fragment; /** * Constructor for XMLFragment object. */ public XMLFragment() { doc = JAXPUtils.getDocumentBuilder().newDocument(); fragment = doc.createDocumentFragment(); } /** * @return the DocumentFragment that corresponds to the nested * structure. */ public DocumentFragment getFragment() { return fragment; } /** * Add nested text, expanding properties as we go * @param s the text to add */ public void addText(String s) { addText(fragment, s); } /** * Creates a nested element. * @param uri the uri of the nested element * @param name the localname of the nested element * @param qName the qualified name of the nested element * @return an object that the element is applied to */ @Override public Object createDynamicElement(String uri, String name, String qName) { Element e; if (uri.isEmpty()) { e = doc.createElement(name); } else { e = doc.createElementNS(uri, qName); } fragment.appendChild(e); return new Child(e); } /** * Add text to a node. * @param n node * @param s value */ private void addText(Node n, String s) { s = getProject().replaceProperties(s); //only text nodes that are non null after property expansion are added if (s != null && !s.trim().isEmpty()) { Text t = doc.createTextNode(s.trim()); n.appendChild(t); } } /** * An object to handle (recursively) nested elements. */ public class Child implements DynamicConfiguratorNS { private Element e; Child(Element e) { this.e = e; } /** * Add nested text. * @param s the text to add */ public void addText(String s) { XMLFragment.this.addText(e, s); } /** * Sets the attribute * @param uri the uri of the attribute * @param name the localname of the attribute * @param qName the qualified name of the attribute * @param value the value of the attribute */ @Override public void setDynamicAttribute( String uri, String name, String qName, String value) { if (uri.isEmpty()) { e.setAttribute(name, value); } else { e.setAttributeNS(uri, qName, value); } } /** * Creates a nested element. * @param uri the uri of the nested element * @param name the localname of the nested element * @param qName the qualified name of the nested element * @return an object that the element is applied to */ @Override public Object createDynamicElement(String uri, String name, String qName) { Element e2 = null; if (uri.isEmpty()) { e2 = doc.createElement(name); } else { e2 = doc.createElementNS(uri, qName); } e.appendChild(e2); return new Child(e2); } } }
⏎ org/apache/tools/ant/util/XMLFragment.java
Or download all of them as a single archive file:
File name: apache-ant-1.10.10-fyi.zip File size: 2392938 bytes Release date: 2021-04-17 Download
⇐ Download Apache Ant Source Package
2021-07-10, 111025👍, 0💬
Popular Posts:
What Is log4j-1.2.15.jar? I got the JAR file from apache-log4j-1.2.15.zip. log4j-1.2.15.jar is the v...
io.jar is a component in iText Java library to provide input/output functionalities. iText Java libr...
commons-io-1.4.jar is the JAR file for Commons IO 1.4, which is a library of utilities to assist wit...
JRE 8 rt.jar is the JAR file for JRE 8 RT (Runtime) libraries. JRE (Java Runtime) 8 is the runtime e...
What Is HttpComponents httpclient-4.2.2.jar? HttpComponents httpclient-4.2.2.jar is the JAR file for...