org.hpccsystems.ws.client.wrappers.XRefMessageWrapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wsclient Show documentation
Show all versions of wsclient Show documentation
This project allows a user to interact with ESP services in a controlled manner. The API calls available under org.hpccsystems.ws.client.platform allow for a user to target ESP's across multiple environments running a range of hpccsystems-platform versions. There is no guarantee that if a user utilizes org.hpccsystems.ws.client.gen generated stub code from wsdl, that the calls will be backwards compatible with older hpccsystems-platform versions.
package org.hpccsystems.ws.client.wrappers;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
public class XRefMessageWrapper
{
private final static String TEXT_TAG = "text";
private final static String FILE_TAG = "file";
protected String text = null;
protected String file = null;
protected String type = null;
public XRefMessageWrapper (Node xrefnode)
{
populatemessage(xrefnode);
}
public void setText(String text)
{
this.text = text;
}
public void setFile(String file)
{
this.file = file;
}
public void setType(String type)
{
this.type = type;
}
public String getText()
{
return text;
}
public String getFile()
{
return file;
}
public String getType()
{
return type;
}
private void populatemessage (Node currentNode)
{
if (currentNode != null)
{
try
{
NodeList currentChildren = currentNode.getChildNodes();
setType(currentNode.getNodeName());
for (int childindex = 0; childindex < currentChildren.getLength(); childindex++)
{
Node childNode = currentChildren.item(childindex);
String tagName = childNode.getNodeName();
if (tagName.equalsIgnoreCase(TEXT_TAG))
{
setText(childNode.getTextContent());
}
else if (tagName.equalsIgnoreCase(FILE_TAG))
{
setFile(childNode.getTextContent());
}
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
@Override
public String toString()
{
return "Type: " + type + " File: " + file + " Text: " + text;
}
}