本文整理汇总了Java中com.google.gwt.xml.client.Text类的典型用法代码示例。如果您正苦于以下问题:Java Text类的具体用法?Java Text怎么用?Java Text使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Text类属于com.google.gwt.xml.client包,在下文中一共展示了Text类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addVariableConstraint
import com.google.gwt.xml.client.Text; //导入依赖的package包/类
/**
* Adds a Constraint element of type 'variable' to the <args> section of the
* LASRequest. Constraints of type 'variable' contain dataset-variable xpath
* information as the left hand side.
*
* @param dataset
* @param variable
* @param op
* @param value
*/
public void addVariableConstraint(String dataset, String variable, String op, String value, String cid) {
Element constraint = document.createElement("constraint");
constraint.setAttribute("type", "variable");
if ( cid != null ) {
constraint.setAttribute("id", cid);
}
constraint.setAttribute("op", op);
Element link = makeLink(dataset, variable);
Element v = document.createElement("v");
Text text = document.createTextNode(value);
v.appendChild(text);
constraint.appendChild(link);
constraint.appendChild(v);
Element args = getArgsElement();
args.appendChild(constraint);
}
示例2: parseXmlDocumentAsBook
import com.google.gwt.xml.client.Text; //导入依赖的package包/类
private Book[] parseXmlDocumentAsBook(Document xml) {
final NodeList idNodes = xml.getElementsByTagName("id");
final NodeList titleNodes = xml.getElementsByTagName("title");
final NodeList authorNodes = xml.getElementsByTagName("author");
int length = idNodes.getLength();
Book[] books = new Book[length];
for (int i = 0; i < length; i++) {
String id = ((Text) idNodes.item(i).getFirstChild()).getData();
String title = ((Text) titleNodes.item(i).getFirstChild()).getData();
String author = ((Text) authorNodes.item(i).getFirstChild()).getData();
books[i] = new Book(Integer.valueOf(id), title, author);
}
return books;
}
示例3: parseXmlDocumentAsBook
import com.google.gwt.xml.client.Text; //导入依赖的package包/类
private Book[] parseXmlDocumentAsBook(Document xml) {
final NodeList idNodes = xml.getElementsByTagName("id");
final NodeList titleNodes = xml.getElementsByTagName("title");
final NodeList authorNodes = xml.getElementsByTagName("author");
final NodeList publicationDateNodes = xml.getElementsByTagName("publicationDate");
int length = idNodes.getLength();
Book[] books = new Book[length];
for (int i = 0; i < length; i++) {
String id = ((Text) idNodes.item(i).getFirstChild()).getData();
String title = ((Text) titleNodes.item(i).getFirstChild()).getData();
String author = ((Text) authorNodes.item(i).getFirstChild()).getData();
String publicationDate = ((Text) publicationDateNodes.item(i).getFirstChild()).getData();
books[i] = new Book(Integer.valueOf(id), title, author, new Date(Long.valueOf(publicationDate)));
}
return books;
}
示例4: addConstraint
import com.google.gwt.xml.client.Text; //导入依赖的package包/类
/**
* Add a constraint.
* @param lhs
* @param op
* @param rhs
*/
public void addConstraint(String lhs, String op, String rhs, String cid, String label) {
Element constraint = document.createElement("constraint");
constraint.setAttribute("type", "text");
if ( cid != null ) {
constraint.setAttribute("id", cid);
}
Element v1 = document.createElement("v");
Text lhsT = document.createTextNode(lhs);
Text opT = document.createTextNode(op);
Element v2 = document.createElement("v");
Text rhsT = document.createTextNode(rhs);
Element v3 = document.createElement("v");
v1.appendChild(lhsT);
v2.appendChild(opT);
v3.appendChild(rhsT);
constraint.appendChild(v1);
constraint.appendChild(v2);
constraint.appendChild(v3);
if ( label != null ) {
Element labelE = document.createElement("label");
Text labelText = document.createTextNode(label);
labelE.appendChild(labelText);
constraint.appendChild(labelE);
}
Element args = getArgsElement();
args.appendChild(constraint);
}
示例5: getDouble
import com.google.gwt.xml.client.Text; //导入依赖的package包/类
private double getDouble(Node firstChild) {
if (firstChild instanceof Text) {
Text content = (Text) firstChild;
String value = content.getData().toString().trim();
return Double.valueOf(value).doubleValue();
} else {
return -999.;
}
}
示例6: getElementValue
import com.google.gwt.xml.client.Text; //导入依赖的package包/类
private String getElementValue(String element, Document doc) {
NodeList results_y = doc.getElementsByTagName(element);
String value = null;
for (int n = 0; n < results_y.getLength(); n++) {
if (results_y.item(n) instanceof Element) {
Element result = (Element) results_y.item(n);
Node text = result.getFirstChild();
if (text instanceof Text) {
Text t = (Text) text;
value = t.getData();
}
}
}
return value;
}
示例7: getNumber
import com.google.gwt.xml.client.Text; //导入依赖的package包/类
private int getNumber(Node firstChild) {
if (firstChild instanceof Text) {
Text content = (Text) firstChild;
String value = content.getData().toString().trim();
return Double.valueOf(value).intValue();
} else {
return -999;
}
}
示例8: getString
import com.google.gwt.xml.client.Text; //导入依赖的package包/类
private String getString(Node firstChild) {
if (firstChild instanceof Text) {
Text content = (Text) firstChild;
String value = content.getData().toString().trim();
return value;
} else {
return "";
}
}
示例9: getNumber
import com.google.gwt.xml.client.Text; //导入依赖的package包/类
private int getNumber(Node firstChild) {
if (firstChild instanceof Text) {
Text content = (Text) firstChild;
String value = content.getData().toString().trim();
return Double.valueOf(value).intValue();
} else {
return -999;
}
}
示例10: getDouble
import com.google.gwt.xml.client.Text; //导入依赖的package包/类
private double getDouble(Node firstChild) {
if (firstChild instanceof Text) {
Text content = (Text) firstChild;
String value = content.getData().toString().trim();
return Double.valueOf(value).doubleValue();
} else {
return -999.;
}
}
示例11: getString
import com.google.gwt.xml.client.Text; //导入依赖的package包/类
private String getString(Node firstChild) {
String value = "";
if (firstChild instanceof Text) {
Text content = (Text) firstChild;
value = content.getData().toString().trim();
}
return value;
}