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


Java XmlObject.xmlText方法代码示例

本文整理汇总了Java中org.apache.xmlbeans.XmlObject.xmlText方法的典型用法代码示例。如果您正苦于以下问题:Java XmlObject.xmlText方法的具体用法?Java XmlObject.xmlText怎么用?Java XmlObject.xmlText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.xmlbeans.XmlObject的用法示例。


在下文中一共展示了XmlObject.xmlText方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createSample

import org.apache.xmlbeans.XmlObject; //导入方法依赖的package包/类
public String createSample( SchemaType sType )
{
	XmlObject object = XmlObject.Factory.newInstance();
	XmlCursor cursor = object.newCursor();
	// Skip the document node
	cursor.toNextToken();
	// Using the type and the cursor, call the utility method to get a
	// sample XML payload for that Schema element
	createSampleForType( sType, cursor );
	// Cursor now contains the sample payload
	// Pretty print the result. Note that the cursor is positioned at the
	// end of the doc so we use the original xml object that the cursor was
	// created upon to do the xmlText() against.

	cursor.dispose();

	XmlOptions options = new XmlOptions();
	options.put( XmlOptions.SAVE_PRETTY_PRINT );
	options.put( XmlOptions.SAVE_PRETTY_PRINT_INDENT, 3 );
	options.put( XmlOptions.SAVE_AGGRESSIVE_NAMESPACES );
	options.setSaveOuter();
	String result = object.xmlText( options );

	return result;
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:26,代码来源:SampleXmlUtil.java

示例2: createSampleForElement

import org.apache.xmlbeans.XmlObject; //导入方法依赖的package包/类
public static String createSampleForElement( SchemaGlobalElement element )
{
	XmlObject xml = XmlObject.Factory.newInstance();

	XmlCursor c = xml.newCursor();
	c.toNextToken();
	c.beginElement( element.getName() );

	new SampleXmlUtil( false ).createSampleForType( element.getType(), c );

	c.dispose();

	XmlOptions options = new XmlOptions();
	options.put( XmlOptions.SAVE_PRETTY_PRINT );
	options.put( XmlOptions.SAVE_PRETTY_PRINT_INDENT, 3 );
	options.put( XmlOptions.SAVE_AGGRESSIVE_NAMESPACES );
	options.setSaveOuter();
	String result = xml.xmlText( options );

	return result;
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:22,代码来源:SampleXmlUtil.java

示例3: createSampleForType

import org.apache.xmlbeans.XmlObject; //导入方法依赖的package包/类
public static String createSampleForType( SchemaType sType )
{
	XmlObject object = XmlObject.Factory.newInstance();
	XmlCursor cursor = object.newCursor();
	// Skip the document node
	cursor.toNextToken();
	// Using the type and the cursor, call the utility method to get a
	// sample XML payload for that Schema element
	new SampleXmlUtil( false ).createSampleForType( sType, cursor );
	// Cursor now contains the sample payload
	// Pretty print the result. Note that the cursor is positioned at the
	// end of the doc so we use the original xml object that the cursor was
	// created upon to do the xmlText() against.

	cursor.dispose();
	XmlOptions options = new XmlOptions();
	options.put( XmlOptions.SAVE_PRETTY_PRINT );
	options.put( XmlOptions.SAVE_PRETTY_PRINT_INDENT, 3 );
	options.put( XmlOptions.SAVE_AGGRESSIVE_NAMESPACES );
	options.setSaveOuter();
	String result = object.xmlText( options );

	return result;
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:25,代码来源:SampleXmlUtil.java

示例4: determineNotificationTypeFromXmlBeansDocument

import org.apache.xmlbeans.XmlObject; //导入方法依赖的package包/类
public static NotificationTypeEnum determineNotificationTypeFromXmlBeansDocument(XmlObject document, Integer flog) {
    String document_string = document.xmlText();
    if(document_string.contains("addAgentAgentRelationship")){
        return ADD_AGENT_AGENT_RELATION;
    } else if (document_string.contains("addAgentActivityRelationship")){
        return ADD_AGENT_ACTIVITY_RELATION;
    } else if (document_string.contains("addActivityActivityRelationship")){
        return ADD_ACTIVITY_ACTIVITY_RELATION;
    } else if (document_string.contains("addEntityEntityRelationship")){
        return ADD_ENTITY_ENTITY_RELATION;
    } else if (document_string.contains("addActivityEntityRelationship")){
        return ADD_ACTIVITY_ENTITY_RELATION;
    } else if(document_string.contains("addAgentEntityRelationship")){
        return ADD_AGENT_ACTIVITY_RELATION;
    } else if(document_string.contains("addAttributes")){
        return ADD_ATTRIBUTES;
    } else {
        return UNKNOWN_TYPES;
    }
}
 
开发者ID:Data-to-Insight-Center,项目名称:komadu,代码行数:21,代码来源:NotificationSummary.java

示例5: createInstanceForSchemaType

import org.apache.xmlbeans.XmlObject; //导入方法依赖的package包/类
/***
 * 处理全局的schematype数据内容
 * @param sType 当前schema节点
 * @return 解析出来的xml表达式
 */
public String createInstanceForSchemaType(SchemaType sType, boolean isSaveJson,String fileName)
{
    XmlObject xmlobject = XmlObject.Factory.newInstance();
    XmlCursor cursor = xmlobject.newCursor();
    // Skip the document node
    cursor.toNextToken();
    // Using the type and the cursor, call the utility method to get a
    // sample XML payload for that Schema element
    _soapEnc = false;
    //RestfulApiSchemaManager restful = new RestfulApiSchemaManager(false);
    setViewAttrib(isSaveJson);
    
    Map<String, String> mapValues = new LinkedHashMap<String, String>();
    createSampleForType(sType, cursor, mapValues);
    // Cursor now contains the sample payload
    // Pretty print the result.  Note that the cursor is positioned at the
    // end of the doc so we use the original xml object that the cursor was
    // created upon to do the xmlText() against.
    XmlOptions options = new XmlOptions();
    options.put(XmlOptions.SAVE_PRETTY_PRINT);
    options.put(XmlOptions.SAVE_PRETTY_PRINT_INDENT, 2);
    options.put(XmlOptions.SAVE_USE_DEFAULT_NAMESPACE);
   
    String result = xmlobject.xmlText(options);
    //System.out.println(result);
    
    // get current xml object
    navigatingXML(xmlobject,fileName);
    
    // System.out.println(getRestApiManager().getAllRestfulApi());
    return result;
}
 
开发者ID:HuaweiSNC,项目名称:OpsDev,代码行数:38,代码来源:RestfulApiSchemaManager.java

示例6: realToString

import org.apache.xmlbeans.XmlObject; //导入方法依赖的package包/类
public String realToString(Object object) throws TranslationException {
    XmlObject xmlBean = (XmlObject) object;
    XmlOptions tempOptions = new XmlOptions(xmlOptions);
    tempOptions.setSavePrettyPrint();
    return xmlBean.xmlText(tempOptions);
}
 
开发者ID:CenturyLinkCloud,项目名称:mdw,代码行数:7,代码来源:XmlBeanTranslator.java

示例7: toText

import org.apache.xmlbeans.XmlObject; //导入方法依赖的package包/类
private static String toText(XmlObject xbObject) {
    return xbObject.xmlText(XmlOptionsHelper.getInstance().getXmlOptions());
}
 
开发者ID:ioos,项目名称:i52n-sos,代码行数:4,代码来源:IoosTestDataSmlGenerator.java

示例8: anyTypeToString

import org.apache.xmlbeans.XmlObject; //导入方法依赖的package包/类
/**
 * converts an XmlObject into a pretty printed string
 *
 * @param any XmlObject
 * @return converted string
 */
public static String anyTypeToString(XmlObject any) {
    return any.xmlText(new XmlOptions().setSavePrettyPrint());
}
 
开发者ID:Data-to-Insight-Center,项目名称:komadu,代码行数:10,代码来源:KomaduUtils.java


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