Java 8 Document - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 Document class.

This code example shows how to use the following methods: createElement, createTextNode
 
public class ElementWarningsRenderer { 
    public void renderTo(DslElementDoc elementDoc, String type, Element parent) {
        if (elementDoc.isDeprecated()) {
            Document document = parent.getOwnerDocument();
            Element caution = document.createElement("caution");
            parent.appendChild(caution);
            Element para = document.createElement("para");
            caution.appendChild(para);
            para.appendChild(document.createTextNode(String.format("Note: This %s is ", type)));
            Element link = document.createElement("ulink");
            para.appendChild(link);
            link.setAttribute("url", "../userguide/feature_lifecycle.html");
            link.appendChild(document.createTextNode("deprecated"));
            para.appendChild(document.createTextNode(" and will be removed in the next major version of Gradle."));
        } 
        if (elementDoc.isIncubating()) {
            Document document = parent.getOwnerDocument();
            Element caution = document.createElement("caution");
            parent.appendChild(caution);
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getDocumentElement
                    null); 
            SignedInfo si = fac.newSignedInfo(fac.newCanonicalizationMethod(CanonicalizationMethod.INCLUSIVE,
                                                                            (C14NMethodParameterSpec) null), 
                                              fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null),
                                              Collections.singletonList(ref));
            DOMSignContext dsc = new DOMSignContext(privateKey, document.getDocumentElement());
            KeyValue keyValue = keyInfoFactory.newKeyValue(publicKey);
            KeyInfo ki = keyInfoFactory.newKeyInfo(Collections.singletonList(keyValue));
            XMLSignature signature = fac.newXMLSignature(si, ki);
            signature.sign(dsc);
        } catch (Exception e) {
            Logger.warn("Error while signing an XML document.", e);
        } 
 
        return document;
    } 
 
} 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getDocumentElement
	} 
	 
	/** Returns the current values of the schemaLocation attribute */ 
	public synchronized SchemaLocations getCurrentSchemaLocations() { 
		Document doc = getCurrentDocument();
		if (!this.schemaLocations.containsKey(doc)) {
			if (doc != null && doc.getDocumentElement() != null) {
				SchemaLocations schemaLocations = new SchemaLocations();
				schemaLocations.initSchemaLocations(doc.getDocumentElement().getAttributeNS(
						"http://www.w3.org/2001/XMLSchema-instance", "schemaLocation")); 
				this.schemaLocations.put(doc, schemaLocations);
			} 
		} 
		return this.schemaLocations.get(doc);
	} 
 
	/** Removes the first document from the stack */ 
	public Document popDocument() {
		if (!documents.isEmpty()) {
			return documents.pop();
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: createElement, createTextNode
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getDocumentElement
        } 
    } 
 
    @Override 
    protected void xmlModelChanged(Document xmlDoc) {
        Element rootElement = xmlDoc.getDocumentElement();
        if (rootElement != null) {
            mRootTag = rootElement.getTagName();
        } 
 
        initUiRootNode(false /*force*/); 
 
        if (mRootTag != null
                && !mRootTag.equals(mUiRootNode.getDescriptor().getXmlLocalName())) {
            AndroidTargetData data = getTargetData();
            if (data != null) {
                ElementDescriptor descriptor =
                    data.getDrawableDescriptors().getElementDescriptor(mRootTag);
                // Replace top level node now that we know the actual type 
 

7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Java 8 Document Questions & Answers:

Other Java 8 Document Examples

0:	public Document getDomElement(String xml){
1:			Document doc = null;
2:			DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
-
1:			Document doc = null;
2:			DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
3:			try {

Read More

8:	XMLParser parser = new XMLParser();
9:	String xml = parser.getXmlFromUrl(URL); // getting XML
10:	Document doc = parser.getDomElement(xml); // getting DOM element
11:	
12:	NodeList nl = doc.getElementsByTagName(KEY_ITEM);

Read More

66:					// parse the xml
67:					try {
68:						Document doc = this.getDomElement(rss_feed_xml);
69:						NodeList nodeList = doc.getElementsByTagName(TAG_CHANNEL);
70:						Element e = (Element) nodeList.item(0);
-
168:					org.jsoup.select.Elements links1 = doc
169:							.select("link[type=application/atom+xml]");
170:					if(links1.size() > 0){
171:						rss_url = links1.get(0).attr("href").toString();	
172:					}
-
169:							.select("link[type=application/atom+xml]");
170:					if(links1.size() > 0){
171:						rss_url = links1.get(0).attr("href").toString();	
172:					}
173:				}
-
177:			}
178:	
179:			// returing RSS url
180:			return rss_url;
181:		}

Read More

See Code Examples for Java 8 Document Methods: