com.sun.xml.xsom.XSContentType Java Examples
The following examples show how to use
com.sun.xml.xsom.XSContentType.
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: GroupInterfaceGenerator.java From jaxb2-rich-contract-plugin with MIT License | 6 votes |
private static Collection<? extends XSDeclaration> findModelGroups(final XSComplexType complexType) { XSContentType contentType = complexType.getExplicitContent(); if (contentType == null) { contentType = complexType.getContentType(); } final XSParticle particle = contentType.asParticle(); if (particle != null && !particle.isRepeated()) { final XSTerm term = particle.getTerm(); if (term instanceof XSModelGroupDecl) { return Collections.singletonList((XSModelGroupDecl)term); } else { final XSModelGroup modelGroup = term.asModelGroup(); return modelGroup != null ? findModelGroups(modelGroup) : Collections.<XSModelGroupDecl>emptyList(); } } else { return Collections.emptyList(); } }
Example #2
Source File: XsdToJolieConverterImpl.java From jolie with GNU Lesser General Public License v2.1 | 5 votes |
private TypeDefinition loadComplexType( XSComplexType complexType, boolean lazy, TypeDefinition lazyType ) throws ConversionException { XSParticle particle; XSContentType contentType; contentType = complexType.getContentType(); if( (particle = contentType.asParticle()) == null ) { return null;// createAnyOrUndefined( complexType.getName(), complexType ); } TypeInlineDefinition jolieType; if( lazy ) { jolieType = (TypeInlineDefinition) lazyType; } else { jolieType = createComplexType( complexType, complexType.getName().replace( "-", "_" ) + TYPE_SUFFIX, particle ); } if( contentType.asSimpleType() != null ) { checkStrictModeForSimpleType( contentType ); } else if( (particle = contentType.asParticle()) != null ) { XSTerm term = particle.getTerm(); XSModelGroup modelGroup = getModelGroup( term ); if( modelGroup != null ) { groupProcessing( modelGroup, particle, jolieType ); } } return jolieType; }
Example #3
Source File: XsdToJolieConverterImpl.java From jolie with GNU Lesser General Public License v2.1 | 5 votes |
private void checkStrictModeForSimpleType( XSContentType contentType ) throws ConversionException { if( !strict() ) { log( Level.WARNING, WARNING_SIMPLE_TYPE + contentType.asSimpleType().getName() ); } else { throw new ConversionException( ERROR_SIMPLE_TYPE + WARNING_SIMPLE_TYPE + contentType.asSimpleType().getName() ); } }
Example #4
Source File: XmlUtils.java From jolie with GNU Lesser General Public License v2.1 | 5 votes |
private static void _valueToDocument( Value value, Element element, Document doc, XSType type ) { addForcedAttribute( value, element ); if( type.isSimpleType() ) { element.appendChild( doc.createTextNode( value.strValue() ) ); } else if( type.isComplexType() ) { String name; Value currValue; XSComplexType complexType = type.asComplexType(); // Iterate over attributes Collection< ? extends XSAttributeUse > attributeUses = complexType.getAttributeUses(); for( XSAttributeUse attrUse : attributeUses ) { name = attrUse.getDecl().getName(); if( (currValue = getAttributeOrNull( value, name )) != null ) { element.setAttribute( name, currValue.strValue() ); } } XSContentType contentType = complexType.getContentType(); XSParticle particle = contentType.asParticle(); if( contentType.asSimpleType() != null ) { element.appendChild( doc.createTextNode( value.strValue() ) ); } else if( particle != null ) { XSTerm term = particle.getTerm(); XSModelGroupDecl modelGroupDecl; XSModelGroup modelGroup = null; if( (modelGroupDecl = term.asModelGroupDecl()) != null ) { modelGroup = modelGroupDecl.getModelGroup(); } else if( term.isModelGroup() ) { modelGroup = term.asModelGroup(); } if( modelGroup != null ) { _valueToDocument( value, element, doc, modelGroup ); } } } }
Example #5
Source File: XsdParser.java From jumbune with GNU Lesser General Public License v3.0 | 4 votes |
private void traverseChilds(XSTerm rfTerm) { if (rfTerm.isModelGroupDecl()) { XSModelGroupDecl rfmodelGD = rfTerm.asModelGroupDecl(); XSModelGroup rfmodelG = rfmodelGD.getModelGroup(); XSParticle[] rfparrs = rfmodelG.getChildren(); for (XSParticle rfpar : rfparrs) { XSTerm rfsterm = rfpar.getTerm(); if (rfsterm.isElementDecl()) { XSComplexType rfcomp = rfsterm.asElementDecl().getType() .asComplexType(); if (rfcomp != null) { traverseChilds(rfsterm); } } else { traverseChilds(rfsterm); } } } else if (rfTerm.isModelGroup()) { XSModelGroup rmodel = rfTerm.asModelGroup(); XSParticle[] rparrs = rmodel.getChildren(); for (XSParticle rpar : rparrs) { if (rpar != null) { XSTerm rterm = rpar.getTerm(); if (rterm.isElementDecl()) { childelements.add(rterm.asElementDecl()); XSComplexType rcomp = rterm.asElementDecl().getType() .asComplexType(); if (rcomp != null) { traverseChilds(rterm); } } else { traverseChilds(rterm); } } } } else { XSComplexType rtcomp = rfTerm.asElementDecl().getType() .asComplexType(); XSContentType rfxscont = rtcomp.getContentType(); XSParticle rfparticle = rfxscont.asParticle(); if (rfparticle != null) { XSTerm rsterm = rfparticle.getTerm(); traverseChilds(rsterm); } else { childelements.add(rfTerm.asElementDecl()); } } }
Example #6
Source File: SimpleTypeAnalyzer.java From hyperjaxb3 with BSD 2-Clause "Simplified" License | 4 votes |
public T empty(XSContentType arg0) { return null; }
Example #7
Source File: ComplexTypeImpl.java From jolie with GNU Lesser General Public License v2.1 | 4 votes |
public void setExplicitContent( XSContentType v ) { this.explicitContent = v; }
Example #8
Source File: SchemaTreeTraverser.java From jolie with GNU Lesser General Public License v2.1 | 4 votes |
public void empty(XSContentType t) { }
Example #9
Source File: SchemaWriter.java From citygml4j with Apache License 2.0 | votes |
public void empty( XSContentType t ) {}
Example #10
Source File: JumbuneSchemaWriter.java From jumbune with GNU Lesser General Public License v3.0 | votes |
public void empty( XSContentType t ) {}
Example #11
Source File: EmptyImpl.java From jolie with GNU Lesser General Public License v2.1 | votes |
public XSContentType getContentType() { return this; }
Example #12
Source File: EmptyImpl.java From jolie with GNU Lesser General Public License v2.1 | votes |
public XSContentType asEmpty() { return this; }
Example #13
Source File: ComplexTypeImpl.java From jolie with GNU Lesser General Public License v2.1 | votes |
public XSContentType getExplicitContent() { return explicitContent; }
Example #14
Source File: ComplexTypeImpl.java From jolie with GNU Lesser General Public License v2.1 | votes |
public XSContentType getContentType() { return contentType.getContentType(); }
Example #15
Source File: SchemaWriter.java From jolie with GNU Lesser General Public License v2.1 | votes |
public void empty( XSContentType t ) {}
Example #16
Source File: Ref.java From jolie with GNU Lesser General Public License v2.1 | votes |
XSContentType getContentType();
Example #17
Source File: SimpleTypeImpl.java From jolie with GNU Lesser General Public License v2.1 | votes |
public XSContentType getContentType() { return this; }
Example #18
Source File: SimpleTypeImpl.java From jolie with GNU Lesser General Public License v2.1 | votes |
public final XSContentType asEmpty() { return null; }
Example #19
Source File: ParticleImpl.java From jolie with GNU Lesser General Public License v2.1 | votes |
public XSContentType getContentType() { return this; }
Example #20
Source File: ParticleImpl.java From jolie with GNU Lesser General Public License v2.1 | votes |
public XSContentType asEmpty() { return null; }
Example #21
Source File: SchemaSetImpl.java From jolie with GNU Lesser General Public License v2.1 | votes |
public XSContentType asEmpty() { return null; }
Example #22
Source File: SchemaSetImpl.java From jolie with GNU Lesser General Public License v2.1 | votes |
public XSContentType getExplicitContent() { return null; }
Example #23
Source File: SchemaSetImpl.java From jolie with GNU Lesser General Public License v2.1 | votes |
public XSContentType getContentType() { return contentType; }
Example #24
Source File: SchemaSetImpl.java From jolie with GNU Lesser General Public License v2.1 | votes |
public XSContentType asEmpty() { return null; }
Example #25
Source File: SchemaSetImpl.java From jolie with GNU Lesser General Public License v2.1 | votes |
public XSContentType getEmpty() { return empty; }