From 098be2d41980ee7de79ff335d23489415c6b243e Mon Sep 17 00:00:00 2001 From: Felipe Barriga Richards Date: Mon, 6 Feb 2017 16:04:46 -0300 Subject: [PATCH] axmlrpc: Remove unused/dead code/imports. --- .../main/java/de/timroes/axmlrpc/XMLUtil.java | 99 ------------------- .../axmlrpc/serializer/ArraySerializer.java | 5 - .../axmlrpc/serializer/Base64Serializer.java | 2 - .../axmlrpc/serializer/BooleanSerializer.java | 2 - .../serializer/DateTimeSerializer.java | 3 - .../axmlrpc/serializer/DoubleSerializer.java | 2 - .../axmlrpc/serializer/IntSerializer.java | 2 - .../axmlrpc/serializer/LongSerializer.java | 2 - .../axmlrpc/serializer/NullSerializer.java | 2 - .../axmlrpc/serializer/Serializer.java | 2 - .../axmlrpc/serializer/SerializerHandler.java | 2 - .../axmlrpc/serializer/StringSerializer.java | 2 - .../axmlrpc/serializer/StructSerializer.java | 4 - 13 files changed, 129 deletions(-) diff --git a/app/src/main/java/de/timroes/axmlrpc/XMLUtil.java b/app/src/main/java/de/timroes/axmlrpc/XMLUtil.java index fb3b2cc6..7e444591 100644 --- a/app/src/main/java/de/timroes/axmlrpc/XMLUtil.java +++ b/app/src/main/java/de/timroes/axmlrpc/XMLUtil.java @@ -1,9 +1,6 @@ package de.timroes.axmlrpc; import de.timroes.axmlrpc.xmlcreator.XmlElement; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; /** * This class provides some utility methods for the use with the Java DOM parser. @@ -12,102 +9,6 @@ import org.w3c.dom.NodeList; */ public class XMLUtil { - /** - * Returns the only child element in a given NodeList. - * Will throw an error if there is more then one child element or any other - * child that is not an element or an empty text string (whitespace are normal). - * - * @param list A NodeList of children nodes. - * @return The only child element in the given node list. - * @throws XMLRPCException Will be thrown if there is more then one child element - * except empty text nodes. - */ - public static Element getOnlyChildElement(NodeList list) throws XMLRPCException { - - Element e = null; - Node n; - for(int i = 0; i < list.getLength(); i++) { - n = list.item(i); - // Strip only whitespace text elements and comments - if((n.getNodeType() == Node.TEXT_NODE - && n.getNodeValue().trim().length() <= 0) - || n.getNodeType() == Node.COMMENT_NODE) - continue; - - // Check if there is anything else than an element node. - if(n.getNodeType() != Node.ELEMENT_NODE) { - throw new XMLRPCException("Only element nodes allowed."); - } - - // If there was already an element, throw exception. - if(e != null) { - throw new XMLRPCException("Element has more than one children."); - } - - e = (Element)n; - - } - - return e; - - } - - /** - * Returns the text node from a given NodeList. If the list contains - * more then just text nodes, an exception will be thrown. - * - * @param list The given list of nodes. - * @return The text of the given node list. - * @throws XMLRPCException Will be thrown if there is more than just one - * text node within the list. - */ - public static String getOnlyTextContent(NodeList list) throws XMLRPCException { - - StringBuilder builder = new StringBuilder(); - Node n; - - for(int i = 0; i < list.getLength(); i++) { - n = list.item(i); - - // Skip comments inside text tag. - if(n.getNodeType() == Node.COMMENT_NODE) { - continue; - } - - if(n.getNodeType() != Node.TEXT_NODE) { - throw new XMLRPCException("Element must contain only text elements."); - } - - builder.append(n.getNodeValue()); - - } - - return builder.toString(); - - } - - /** - * Checks if the given {@link NodeList} contains a child element. - * - * @param list The {@link NodeList} to check. - * @return Whether the {@link NodeList} contains children. - */ - public static boolean hasChildElement(NodeList list) { - - Node n; - - for(int i = 0; i < list.getLength(); i++) { - n = list.item(i); - - if(n.getNodeType() == Node.ELEMENT_NODE) { - return true; - } - } - - return false; - - } - /** * Creates an xml tag with a given type and content. * diff --git a/app/src/main/java/de/timroes/axmlrpc/serializer/ArraySerializer.java b/app/src/main/java/de/timroes/axmlrpc/serializer/ArraySerializer.java index 3e48151c..d1b054fe 100644 --- a/app/src/main/java/de/timroes/axmlrpc/serializer/ArraySerializer.java +++ b/app/src/main/java/de/timroes/axmlrpc/serializer/ArraySerializer.java @@ -2,12 +2,7 @@ package de.timroes.axmlrpc.serializer; import de.timroes.axmlrpc.XMLRPCException; import de.timroes.axmlrpc.XMLRPCRuntimeException; -import de.timroes.axmlrpc.XMLUtil; import de.timroes.axmlrpc.xmlcreator.XmlElement; -import java.util.ArrayList; -import java.util.List; -import org.w3c.dom.Element; -import org.w3c.dom.Node; /** * diff --git a/app/src/main/java/de/timroes/axmlrpc/serializer/Base64Serializer.java b/app/src/main/java/de/timroes/axmlrpc/serializer/Base64Serializer.java index bffa40bb..699e7f75 100644 --- a/app/src/main/java/de/timroes/axmlrpc/serializer/Base64Serializer.java +++ b/app/src/main/java/de/timroes/axmlrpc/serializer/Base64Serializer.java @@ -1,10 +1,8 @@ package de.timroes.axmlrpc.serializer; -import de.timroes.axmlrpc.XMLRPCException; import de.timroes.axmlrpc.XMLUtil; import de.timroes.axmlrpc.xmlcreator.XmlElement; import de.timroes.base64.Base64; -import org.w3c.dom.Element; /** * diff --git a/app/src/main/java/de/timroes/axmlrpc/serializer/BooleanSerializer.java b/app/src/main/java/de/timroes/axmlrpc/serializer/BooleanSerializer.java index 74bf0fbe..f64a7f4e 100644 --- a/app/src/main/java/de/timroes/axmlrpc/serializer/BooleanSerializer.java +++ b/app/src/main/java/de/timroes/axmlrpc/serializer/BooleanSerializer.java @@ -1,9 +1,7 @@ package de.timroes.axmlrpc.serializer; -import de.timroes.axmlrpc.XMLRPCException; import de.timroes.axmlrpc.XMLUtil; import de.timroes.axmlrpc.xmlcreator.XmlElement; -import org.w3c.dom.Element; /** * diff --git a/app/src/main/java/de/timroes/axmlrpc/serializer/DateTimeSerializer.java b/app/src/main/java/de/timroes/axmlrpc/serializer/DateTimeSerializer.java index b55e4875..8c19f0f3 100644 --- a/app/src/main/java/de/timroes/axmlrpc/serializer/DateTimeSerializer.java +++ b/app/src/main/java/de/timroes/axmlrpc/serializer/DateTimeSerializer.java @@ -1,11 +1,8 @@ package de.timroes.axmlrpc.serializer; -import de.timroes.axmlrpc.XMLRPCException; import de.timroes.axmlrpc.XMLUtil; import de.timroes.axmlrpc.xmlcreator.XmlElement; -import java.text.ParseException; import java.text.SimpleDateFormat; -import org.w3c.dom.Element; /** * diff --git a/app/src/main/java/de/timroes/axmlrpc/serializer/DoubleSerializer.java b/app/src/main/java/de/timroes/axmlrpc/serializer/DoubleSerializer.java index 3f0b7941..528afcd8 100644 --- a/app/src/main/java/de/timroes/axmlrpc/serializer/DoubleSerializer.java +++ b/app/src/main/java/de/timroes/axmlrpc/serializer/DoubleSerializer.java @@ -1,10 +1,8 @@ package de.timroes.axmlrpc.serializer; -import de.timroes.axmlrpc.XMLRPCException; import de.timroes.axmlrpc.XMLUtil; import de.timroes.axmlrpc.xmlcreator.XmlElement; import java.math.BigDecimal; -import org.w3c.dom.Element; /** * This serializer is responsible for floating point numbers. diff --git a/app/src/main/java/de/timroes/axmlrpc/serializer/IntSerializer.java b/app/src/main/java/de/timroes/axmlrpc/serializer/IntSerializer.java index f8f48d7e..65d11aab 100644 --- a/app/src/main/java/de/timroes/axmlrpc/serializer/IntSerializer.java +++ b/app/src/main/java/de/timroes/axmlrpc/serializer/IntSerializer.java @@ -1,9 +1,7 @@ package de.timroes.axmlrpc.serializer; -import de.timroes.axmlrpc.XMLRPCException; import de.timroes.axmlrpc.XMLUtil; import de.timroes.axmlrpc.xmlcreator.XmlElement; -import org.w3c.dom.Element; /** * diff --git a/app/src/main/java/de/timroes/axmlrpc/serializer/LongSerializer.java b/app/src/main/java/de/timroes/axmlrpc/serializer/LongSerializer.java index 1952fb2e..59158d9c 100644 --- a/app/src/main/java/de/timroes/axmlrpc/serializer/LongSerializer.java +++ b/app/src/main/java/de/timroes/axmlrpc/serializer/LongSerializer.java @@ -1,9 +1,7 @@ package de.timroes.axmlrpc.serializer; -import de.timroes.axmlrpc.XMLRPCException; import de.timroes.axmlrpc.XMLUtil; import de.timroes.axmlrpc.xmlcreator.XmlElement; -import org.w3c.dom.Element; /** * diff --git a/app/src/main/java/de/timroes/axmlrpc/serializer/NullSerializer.java b/app/src/main/java/de/timroes/axmlrpc/serializer/NullSerializer.java index ae3424eb..df5f0f7f 100644 --- a/app/src/main/java/de/timroes/axmlrpc/serializer/NullSerializer.java +++ b/app/src/main/java/de/timroes/axmlrpc/serializer/NullSerializer.java @@ -1,8 +1,6 @@ package de.timroes.axmlrpc.serializer; -import de.timroes.axmlrpc.XMLRPCException; import de.timroes.axmlrpc.xmlcreator.XmlElement; -import org.w3c.dom.Element; /** * diff --git a/app/src/main/java/de/timroes/axmlrpc/serializer/Serializer.java b/app/src/main/java/de/timroes/axmlrpc/serializer/Serializer.java index 5a64c423..96914a2a 100644 --- a/app/src/main/java/de/timroes/axmlrpc/serializer/Serializer.java +++ b/app/src/main/java/de/timroes/axmlrpc/serializer/Serializer.java @@ -1,8 +1,6 @@ package de.timroes.axmlrpc.serializer; -import de.timroes.axmlrpc.XMLRPCException; import de.timroes.axmlrpc.xmlcreator.XmlElement; -import org.w3c.dom.Element; /** * A Serializer is responsible to serialize a specific type of data to diff --git a/app/src/main/java/de/timroes/axmlrpc/serializer/SerializerHandler.java b/app/src/main/java/de/timroes/axmlrpc/serializer/SerializerHandler.java index ab81c476..8666183e 100644 --- a/app/src/main/java/de/timroes/axmlrpc/serializer/SerializerHandler.java +++ b/app/src/main/java/de/timroes/axmlrpc/serializer/SerializerHandler.java @@ -3,7 +3,6 @@ package de.timroes.axmlrpc.serializer; import de.timroes.axmlrpc.XMLRPCClient; import de.timroes.axmlrpc.XMLRPCException; import de.timroes.axmlrpc.XMLRPCRuntimeException; -import de.timroes.axmlrpc.XMLUtil; import de.timroes.axmlrpc.xmlcreator.XmlElement; import java.io.BufferedReader; @@ -17,7 +16,6 @@ import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.List; -import java.util.Locale; import java.util.Map; import java.util.SimpleTimeZone; diff --git a/app/src/main/java/de/timroes/axmlrpc/serializer/StringSerializer.java b/app/src/main/java/de/timroes/axmlrpc/serializer/StringSerializer.java index 8712a486..823edad6 100644 --- a/app/src/main/java/de/timroes/axmlrpc/serializer/StringSerializer.java +++ b/app/src/main/java/de/timroes/axmlrpc/serializer/StringSerializer.java @@ -1,9 +1,7 @@ package de.timroes.axmlrpc.serializer; -import de.timroes.axmlrpc.XMLRPCException; import de.timroes.axmlrpc.XMLUtil; import de.timroes.axmlrpc.xmlcreator.XmlElement; -import org.w3c.dom.Element; /** * diff --git a/app/src/main/java/de/timroes/axmlrpc/serializer/StructSerializer.java b/app/src/main/java/de/timroes/axmlrpc/serializer/StructSerializer.java index 82333829..722f54a3 100644 --- a/app/src/main/java/de/timroes/axmlrpc/serializer/StructSerializer.java +++ b/app/src/main/java/de/timroes/axmlrpc/serializer/StructSerializer.java @@ -2,12 +2,8 @@ package de.timroes.axmlrpc.serializer; import de.timroes.axmlrpc.XMLRPCException; import de.timroes.axmlrpc.XMLRPCRuntimeException; -import de.timroes.axmlrpc.XMLUtil; import de.timroes.axmlrpc.xmlcreator.XmlElement; -import java.util.HashMap; import java.util.Map; -import org.w3c.dom.Element; -import org.w3c.dom.Node; /** *