当前位置: 首页>>代码示例>>Java>>正文


Java Text类代码示例

本文整理汇总了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);
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:28,代码来源:LASRequest.java

示例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;
}
 
开发者ID:growbit,项目名称:turbogwt-http,代码行数:18,代码来源:BookXmlSerdes.java

示例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;
}
 
开发者ID:reinert,项目名称:requestor,代码行数:20,代码来源:BookXmlSerdes.java

示例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);
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:35,代码来源:LASRequest.java

示例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.;
    }
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:10,代码来源:OutputPanel.java

示例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;
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:16,代码来源:OutputPanel.java

示例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;
    }
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:10,代码来源:OutputPanel.java

示例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 "";
    }
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:10,代码来源:OutputPanel.java

示例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;
	}
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:10,代码来源:Correlation.java

示例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.;
	}
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:10,代码来源:Correlation.java

示例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;
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:9,代码来源:SimplePropPropViewer.java


注:本文中的com.google.gwt.xml.client.Text类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。