Java Code Examples for com.sun.xml.xsom.XSElementDecl#getName()

The following examples show how to use com.sun.xml.xsom.XSElementDecl#getName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XmlFormBuilder.java    From dynaform with Artistic License 2.0 6 votes vote down vote up
private XmlForm elementDeclSimple(XSElementDecl decl, XSSimpleType simpleType) {
  FormElement element = declSimple(simpleType, decl.getName(), decl.getDefaultValue(), decl.getFixedValue());
  if (element == null)
    return null;
  
  XmlWriter writer = new XmlElementWriter(decl.getName(), null,
      new TextXmlWriter(new FormElementWriter(element)));
  
  XmlReader reader = new XmlElementReader(decl.getName(), null,
      new TextXmlReader(new FormElementHandler(element)));
  
  if (ignoreWhitespace)
    reader = WhitespaceReader.appendTo(reader);

  return new XmlFormImpl(element, writer, reader);
}
 
Example 2
Source File: SoapProtocol.java    From jolie with GNU Lesser General Public License v2.1 5 votes vote down vote up
private void termProcessing( Value value, SOAPElement element, SOAPEnvelope envelope, boolean first,
	XSTerm currTerm, int getMaxOccur,
	XSSchemaSet sSet, String messageNamespace )
	throws SOAPException {
	Value currValue = value.clone();
	if( currTerm.isElementDecl() ) {
		ValueVector vec;
		XSElementDecl currElementDecl = currTerm.asElementDecl();
		String name = currElementDecl.getName();
		String prefix = (first) ? getPrefix( currElementDecl ) : getPrefixOrNull( currElementDecl );
		SOAPElement childElement;
		if( (vec = currValue.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++;
			}
		}
	}

}
 
Example 3
Source File: FindXSElementDeclVisitor.java    From jaxb2-basics with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void elementDecl(XSElementDecl decl) {
	final QName declName = StringUtils.isEmpty(decl.getTargetNamespace()) ? new QName(
			decl.getName()) : new QName(decl.getTargetNamespace(),
			decl.getName());
	if (this.name.equals(declName)) {
		this.elementDecl = decl;
	}
}
 
Example 4
Source File: ElementDecl.java    From citygml4j with Apache License 2.0 5 votes vote down vote up
public QName getRootSubsitutionGroup() {
	XSElementDecl tmp = element;
	XSElementDecl head = null;

	while ((tmp = tmp.getSubstAffiliation()) != null)
		head = tmp;

	return (head != null) ? new QName(head.getTargetNamespace(), head.getName()) : null;
}
 
Example 5
Source File: ComponentNameFunction.java    From jolie with GNU Lesser General Public License v2.1 4 votes vote down vote up
/**
 * @see com.sun.xml.xsom.visitor.XSTermFunction#elementDecl(XSElementDecl)
 */
public String elementDecl(XSElementDecl decl) {
    String name = decl.getName();
    if( name == null ) name = "";
    return name + " " + nameGetter.elementDecl( decl );
}
 
Example 6
Source File: MetaPlugin.java    From jaxb2-rich-contract-plugin with MIT License 4 votes vote down vote up
@Override
public QName elementDecl(final XSElementDecl decl) {
	return new QName(decl.getTargetNamespace(), decl.getName());
}
 
Example 7
Source File: ElementDecl.java    From citygml4j with Apache License 2.0 4 votes vote down vote up
public QName getSubsitutionGroup() {
	XSElementDecl head = element.getSubstAffiliation();
	return (head != null) ? new QName(head.getTargetNamespace(), head.getName()) : null;
}