本文整理汇总了Java中org.apache.xerces.dom.TextImpl类的典型用法代码示例。如果您正苦于以下问题:Java TextImpl类的具体用法?Java TextImpl怎么用?Java TextImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextImpl类属于org.apache.xerces.dom包,在下文中一共展示了TextImpl类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getText
import org.apache.xerces.dom.TextImpl; //导入依赖的package包/类
/**
* Gets the text string associated with a node
*
* @param root <code>Node</code> object from which text to be extracted.
*
* @return a string associated with the node
*/
public static String getText( Node root )
{
NodeList list = root.getChildNodes();
if( (list == null) || (list.getLength() == 0) )
{
String str = root.getNodeValue();
if( str == null )
{
str = "";
}
return str;
}
StringBuffer buf = new StringBuffer();
for( int i = 0; i < list.getLength(); i++ )
{
Node node = list.item(i);
if( node instanceof TextImpl )
{
String val = ((TextImpl) node).getNodeValue();
if( (val != null) && (val.length() > 0) )
{
buf.append(val);
}
}
}
return buf.toString();
}
开发者ID:neustar,项目名称:registrar_toolkit,代码行数:35,代码来源:EppUtil.java
示例2: reformataXml
import org.apache.xerces.dom.TextImpl; //导入依赖的package包/类
@Test
public void reformataXml() throws Exception {
DocumentImpl d = new DocumentImpl();
ElementImpl e = new ElementImpl(d, "servico");
e.appendChild(new TextImpl(d, "\n\nteste\n\tteste"));
d.appendChild(e);
assertThat(xml.formata(new DOMSource(d)),
is("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<servico>\n\nteste\n\tteste</servico>\n"));
}
开发者ID:servicosgovbr,项目名称:editor-de-servicos,代码行数:11,代码来源:ReformatadorXmlTest.java
示例3: initializeClassMembersResolverFactory
import org.apache.xerces.dom.TextImpl; //导入依赖的package包/类
@Override
protected ClassMembersResolverFactory initializeClassMembersResolverFactory() {
DefaultShutter explicitGrantShutter = new DefaultShutter();
explicitGrantShutter.addVisibleClass(HTMLElementImpl.class, true, false, false);
explicitGrantShutter.addVisibleClass(TextImpl.class, true, true, false);
//explicitGrantShutter.addVisibleClass(ConsString.class, true, true, false);
ClassMembersResolverFactory factory = new ScriptAnnotationClassMembersResolverFactory(this, explicitGrantShutter);
return factory;
}
开发者ID:ITman1,项目名称:ScriptBox,代码行数:10,代码来源:WindowJavaScriptEngine.java
示例4: characters
import org.apache.xerces.dom.TextImpl; //导入依赖的package包/类
public void characters( char[] text, int start, int length )
throws SAXException
{
if ( _current == null )
throw new SAXException( "HTM010 State error: character data found outside of root element." );
_current.appendChild( new TextImpl( _document, new String( text, start, length ) ) );
}
开发者ID:3dcitydb,项目名称:swingx-ws,代码行数:8,代码来源:HTMLBuilder.java
示例5: ignorableWhitespace
import org.apache.xerces.dom.TextImpl; //导入依赖的package包/类
public void ignorableWhitespace( char[] text, int start, int length )
throws SAXException
{
Node node;
if ( ! _ignoreWhitespace )
_current.appendChild( new TextImpl( _document, new String( text, start, length ) ) );
}
开发者ID:3dcitydb,项目名称:swingx-ws,代码行数:9,代码来源:HTMLBuilder.java
示例6: isIgnorableWhitespace
import org.apache.xerces.dom.TextImpl; //导入依赖的package包/类
public boolean isIgnorableWhitespace(Text text) {
return ((TextImpl)text).isIgnorableWhitespace();
}
开发者ID:BrainTech,项目名称:svarog,代码行数:4,代码来源:Xerces.java
示例7: setCharacterData
import org.apache.xerces.dom.TextImpl; //导入依赖的package包/类
protected void setCharacterData (boolean sawChars){
// handle character data
fFirstChunk = sawChars;
// if we have data in the buffer we must have created
// a text node already.
Node child = fCurrentNode.getLastChild ();
if (child != null) {
if (fStringBuffer.length () > 0) {
// REVISIT: should this check be performed?
if (child.getNodeType () == Node.TEXT_NODE) {
if (fDocumentImpl != null) {
((TextImpl)child).replaceData (fStringBuffer.toString ());
}
else {
((Text)child).setData (fStringBuffer.toString ());
}
}
// reset string buffer
fStringBuffer.setLength (0);
}
if (fDOMFilter !=null && !fInEntityRef) {
if ( (child.getNodeType () == Node.TEXT_NODE ) &&
((fDOMFilter.getWhatToShow () & NodeFilter.SHOW_TEXT)!= 0) ) {
short code = fDOMFilter.acceptNode (child);
switch (code) {
case LSParserFilter.FILTER_INTERRUPT:{
throw Abort.INSTANCE;
}
case LSParserFilter.FILTER_REJECT:{
// fall through to SKIP since Comment has no children.
}
case LSParserFilter.FILTER_SKIP: {
fCurrentNode.removeChild (child);
return;
}
default: {
// accept node -- do nothing
}
}
}
} // end-if fDOMFilter !=null
} // end-if child !=null
}
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:50,代码来源:AbstractDOMParser.java
示例8: isIgnorableWhitespace
import org.apache.xerces.dom.TextImpl; //导入依赖的package包/类
/**
* Returns true if the specified text node is ignorable whitespace.
*/
public boolean isIgnorableWhitespace(Text text) {
return ((TextImpl)text).isIgnorableWhitespace();
}
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:7,代码来源:Xerces.java
注:本文中的org.apache.xerces.dom.TextImpl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论