本文整理汇总了Java中com.sun.xml.xsom.XSTerm.isElementDecl方法的典型用法代码示例。如果您正苦于以下问题:Java XSTerm.isElementDecl方法的具体用法?Java XSTerm.isElementDecl怎么用?Java XSTerm.isElementDecl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.xml.xsom.XSTerm
的用法示例。
在下文中一共展示了XSTerm.isElementDecl方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addSchemaElements
import com.sun.xml.xsom.XSTerm; //导入方法依赖的package包/类
private void addSchemaElements() {
for (Map.Entry<String, XSComplexType> entry : schemaObject
.getComplexTypes().entrySet()) {
XSContentType content = entry.getValue().getContentType();
XSParticle particle = content.asParticle();
if (particle != null) {
XSTerm term = particle.getTerm();
if (term.isModelGroup()) {
XSParticle[] particles = term.asModelGroup().getChildren();
for (XSParticle p : particles) {
XSTerm pterm = p.getTerm();
if (pterm.isElementDecl()) {
XSElementDecl e = pterm.asElementDecl();
schemaElements.put(e.getName(), e);
}
}
}
}
}
}
示例2: isMultiValued
import com.sun.xml.xsom.XSTerm; //导入方法依赖的package包/类
/**
* Checks if "maxOccurs" of the element definition is greater than 1, i.e.,
* if the SOAP message can contain several values for one input
*
* @param inputName
* The element name
* @return
*/
public boolean isMultiValued(String inputName) {
for (Map.Entry<String, XSComplexType> entry : schemaObject
.getComplexTypes().entrySet()) {
XSContentType content = entry.getValue().getContentType();
XSParticle particle = content.asParticle();
if (particle != null) {
XSTerm term = particle.getTerm();
if (term.isModelGroup()) {
XSParticle[] particles = term.asModelGroup().getChildren();
for (XSParticle p : particles) {
XSTerm pterm = p.getTerm();
if (pterm.isElementDecl()) {
XSElementDecl e = pterm.asElementDecl();
if (e.getName().equals(inputName)) {
return p.isRepeated();
}
}
}
}
}
}
return false;
}
示例3: termProcessing
import com.sun.xml.xsom.XSTerm; //导入方法依赖的package包/类
private void termProcessing( Value value, SOAPElement element, SOAPEnvelope envelope, boolean first,
XSTerm currTerm, int getMaxOccur,
XSSchemaSet sSet, String messageNamespace )
throws SOAPException
{
if ( currTerm.isElementDecl() ) {
ValueVector vec;
XSElementDecl currElementDecl = currTerm.asElementDecl();
String name = currElementDecl.getName();
String prefix = (first) ? getPrefix( currElementDecl ) : getPrefixOrNull( currElementDecl );
SOAPElement childElement;
if ( (vec = value.children().get( name )) != null ) {
int k = 0;
while( vec.size() > 0 && (getMaxOccur > k || getMaxOccur == XSParticle.UNBOUNDED) ) {
if ( prefix == null ) {
childElement = element.addChildElement( name );
} else {
childElement = element.addChildElement( name, prefix );
}
Value v = vec.remove( 0 );
valueToTypedSOAP(
v,
currElementDecl,
childElement,
envelope,
false,
sSet,
messageNamespace );
k++;
}
}
}
}
示例4: createGroup
import com.sun.xml.xsom.XSTerm; //导入方法依赖的package包/类
private void createGroup(XSModelGroupDecl modelGroupDecl) {
EClass eClass = ecoreFactory.createEClass();
eClass.setName(modelGroupDecl.getName());
ePackage.getEClassifiers().add(eClass);
for (XSParticle particle : modelGroupDecl.getModelGroup().getChildren()) {
XSTerm term = particle.getTerm();
if (term.isElementDecl()) {
String name = term.asElementDecl().getName();
EClassifier subClass = ePackage.getEClassifier(name);
if (subClass != null && subClass instanceof EClass) {
((EClass) subClass).getESuperTypes().add(eClass);
}
}
}
}