本文整理汇总了Java中org.apache.xmlbeans.XmlCursor.insertElement方法的典型用法代码示例。如果您正苦于以下问题:Java XmlCursor.insertElement方法的具体用法?Java XmlCursor.insertElement怎么用?Java XmlCursor.insertElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.xmlbeans.XmlCursor
的用法示例。
在下文中一共展示了XmlCursor.insertElement方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processElement
import org.apache.xmlbeans.XmlCursor; //导入方法依赖的package包/类
private void processElement(SchemaParticle sp, XmlCursor xmlc, boolean mixed)
{
// cast as schema local element
SchemaLocalElement element = (SchemaLocalElement) sp;
/// ^ -> <elemenname></elem>^
if (_soapEnc)
xmlc.insertElement(element.getName().getLocalPart()); // soap encoded? drop namespaces.
else
xmlc.insertElement(element.getName().getLocalPart(), element.getName().getNamespaceURI());
/// -> <elem>^</elem>
xmlc.toPrevToken();
// -> <elem>stuff^</elem>
Map<String, String> mapValues = new LinkedHashMap<String, String>();
createAnnotationForElement(element.getAnnotation(), xmlc, mapValues);
createSampleForType(element.getType(), xmlc, mapValues);
// -> <elem>stuff</elem>^
xmlc.toNextToken();
}
示例2: getOrCreatePOSIXApplication
import org.apache.xmlbeans.XmlCursor; //导入方法依赖的package包/类
public static POSIXApplicationType getOrCreatePOSIXApplication(JobDefinitionType value) {
ApplicationType application = getOrCreateApplication(value);
if(getHPCProfileApplication(value) != null){
//TODO handle: not creating POSIX element if HPCProfile already exists
return getPOSIXApplication(value);
}
if (getPOSIXApplication(value) == null) {
XmlCursor acursor = application.newCursor();
acursor.toEndToken();
acursor.insertElement(POSIX_APPLICATION);
acursor.dispose();
}
return getPOSIXApplication(value);
}
示例3: getOrCreateHPCProfileApplication
import org.apache.xmlbeans.XmlCursor; //导入方法依赖的package包/类
public static HPCProfileApplicationType getOrCreateHPCProfileApplication(JobDefinitionType value) {
ApplicationType application = getOrCreateApplication(value);
if(getPOSIXApplication(value) != null){
//TODO handle: creating HPC element if POSIX already exists
return getHPCProfileApplication(value);
}
if (getHPCProfileApplication(value) == null) {
XmlCursor acursor = application.newCursor();
acursor.toEndToken();
acursor.insertElement(HPC_PROFILE_APPLICATION);
acursor.dispose();
}
return getHPCProfileApplication(value);
}
示例4: processElement
import org.apache.xmlbeans.XmlCursor; //导入方法依赖的package包/类
private void processElement( SchemaParticle sp, XmlCursor xmlc, boolean mixed )
{
// cast as schema local element
SchemaLocalElement element = ( SchemaLocalElement )sp;
// Add comment about type
addElementTypeAndRestricionsComment( element, xmlc );
// / ^ -> <elemenname></elem>^
if( _soapEnc )
xmlc.insertElement( element.getName().getLocalPart() ); // soap
// encoded?
// drop
// namespaces.
else
xmlc.insertElement( element.getName().getLocalPart(), element.getName().getNamespaceURI() );
// / -> <elem>^</elem>
// processAttributes( sp.getType(), xmlc );
xmlc.toPrevToken();
// -> <elem>stuff^</elem>
String[] values = null;
if( multiValues != null )
values = multiValues.get( element.getName() );
if( values != null )
xmlc.insertChars( StringUtils.join( values, "," ) );
else if( sp.isDefault() )
xmlc.insertChars( sp.getDefaultText() );
else
createSampleForType( element.getType(), xmlc );
// -> <elem>stuff</elem>^
xmlc.toNextToken();
}
示例5: getOrCreateSPMDApplication
import org.apache.xmlbeans.XmlCursor; //导入方法依赖的package包/类
public static SPMDApplicationType getOrCreateSPMDApplication(JobDefinitionType value) {
ApplicationType application = getOrCreateApplication(value);
if (getSPMDApplication(value) == null) {
XmlCursor acursor = application.newCursor();
acursor.toEndToken();
acursor.insertElement(SPMD_APPLICATION);
acursor.dispose();
}
return getSPMDApplication(value);
}
示例6: processWildCard
import org.apache.xmlbeans.XmlCursor; //导入方法依赖的package包/类
private void processWildCard(SchemaParticle sp, XmlCursor xmlc, boolean mixed)
{
xmlc.insertComment("You may enter ANY elements at this point");
xmlc.insertElement("AnyElement");
}