public Iterator<XSElementDecl> particle(XSParticle particle) { return singleton(particle.getTerm().asElementDecl()); }
public Iterator<XSElementDecl> particle(XSParticle particle) { return singleton(particle.getTerm().asElementDecl()); }
public Iterator<XSElementDecl> particle(XSParticle particle) { return singleton(particle.getTerm().asElementDecl()); }
public Iterator<XSElementDecl> particle(XSParticle particle) { return singleton(particle.getTerm().asElementDecl()); }
public Iterator<XSElementDecl> particle(XSParticle particle) { return singleton(particle.getTerm().asElementDecl()); }
/** * Creates appropriate instance of PropertyContainerDefinition. It may be * PropertyContainerDefinition itself or one of its subclasses * (ResourceObjectDefinition). This method also takes care of parsing all * the annotations and similar fancy stuff. * * We need to pass createResourceObject flag explicitly here. Because even * if we are in resource schema, we want PropertyContainers inside * ResourceObjects, not ResourceObjects inside ResouceObjects. */ private PrismContainerDefinition<?> createPropertyContainerDefinition(XSType xsType, XSParticle elementParticle, ComplexTypeDefinition complexTypeDefinition, XSAnnotation annotation, boolean topLevel) throws SchemaException { XSTerm elementTerm = elementParticle.getTerm(); XSElementDecl elementDecl = elementTerm.asElementDecl(); PrismContainerDefinition<?> pcd = createPropertyContainerDefinition(xsType, elementDecl, complexTypeDefinition, annotation, elementParticle, topLevel); return pcd; }
protected void processParticle(XSParticle particle, ParseContext parseContext) throws Exception { parseContext.minOccurs = particle.getMinOccurs().intValue(); parseContext.maxOccurs = particle.getMaxOccurs().intValue(); XSTerm term = particle.getTerm(); if (term.isModelGroup()) { processGroup(term.asModelGroup(), parseContext); } else if (term.isModelGroupDecl()) { processGroupDecl(term.asModelGroupDecl(), parseContext); } else if (term.isElementDecl()) { processElement(term.asElementDecl(), parseContext); } }
private Object parseDefaultValue(XSParticle elementParticle, QName typeName) { if (elementParticle == null) { return null; } XSTerm term = elementParticle.getTerm(); if (term == null) { return null; } XSElementDecl elementDecl = term.asElementDecl(); if (elementDecl == null) { return null; } if (elementDecl.getDefaultValue() != null) { if (XmlTypeConverter.canConvert(typeName)) { return XmlTypeConverter.toJavaValue(elementDecl.getDefaultValue().value, typeName); } return elementDecl.getDefaultValue().value; } return null; }
private CCustomizations getCustomizations( XSParticle src ) { // customizations for a particle should include those defined in the term unless it's global // this is so that the schema like: // // <xs:sequence> // <xs:element name="foo" type="xs:int"> // <xs:annotation><xs:appinfo> // <hyperjaxb:... /> // // would be picked up if(src.getTerm().isElementDecl()) { XSElementDecl xed = src.getTerm().asElementDecl(); if(xed.isGlobal()) return getCustomizations((XSComponent)src); } return getCustomizations(src,src.getTerm()); }
private CCustomizations getCustomizations( XSParticle src ) { // customizations for a particle should include those defined in the term unless it's global // this is so that the schema like: // // <xs:sequence> // <xs:element name="foo" type="xs:int"> // <xs:annotation><xs:appinfo> // <hyperjaxb:... /> // // would be picked up if(src.getTerm().isElementDecl()) { XSElementDecl xed = src.getTerm().asElementDecl(); if(xed.isGlobal()) return getCustomizations((XSComponent)src); } return getCustomizations(src,src.getTerm()); }
private CCustomizations getCustomizations( XSParticle src ) { // customizations for a particle should include those defined in the term unless it's global // this is so that the schema like: // // <xs:sequence> // <xs:element name="foo" type="xs:int"> // <xs:annotation><xs:appinfo> // <hyperjaxb:... /> // // would be picked up if(src.getTerm().isElementDecl()) { XSElementDecl xed = src.getTerm().asElementDecl(); if(xed.isGlobal()) return getCustomizations((XSComponent)src); } return getCustomizations(src,src.getTerm()); }
private CCustomizations getCustomizations( XSParticle src ) { // customizations for a particle should include those defined in the term unless it's global // this is so that the schema like: // // <xs:sequence> // <xs:element name="foo" type="xs:int"> // <xs:annotation><xs:appinfo> // <hyperjaxb:... /> // // would be picked up if(src.getTerm().isElementDecl()) { XSElementDecl xed = src.getTerm().asElementDecl(); if(xed.isGlobal()) return getCustomizations((XSComponent)src); } return getCustomizations(src,src.getTerm()); }
private CCustomizations getCustomizations( XSParticle src ) { // customizations for a particle should include those defined in the term unless it's global // this is so that the schema like: // // <xs:sequence> // <xs:element name="foo" type="xs:int"> // <xs:annotation><xs:appinfo> // <hyperjaxb:... /> // // would be picked up if(src.getTerm().isElementDecl()) { XSElementDecl xed = src.getTerm().asElementDecl(); if(xed.isGlobal()) return getCustomizations((XSComponent)src); } return getCustomizations(src,src.getTerm()); }
public boolean isOptional(final String elementName) { for (final Entry<String, XSComplexType> entry : getComplexTypes().entrySet()) { final XSContentType content = entry.getValue().getContentType(); final XSParticle particle = content.asParticle(); if (null != particle) { final XSTerm term = particle.getTerm(); if (term.isModelGroup()) { final XSParticle[] particles = term.asModelGroup().getChildren(); for (final XSParticle p : particles) { final XSTerm pterm = p.getTerm(); if (pterm.isElementDecl()) { final XSElementDecl e = pterm.asElementDecl(); if (0 == e.getName().compareToIgnoreCase(elementName)) { return p.getMinOccurs() == 0; } } } } } } return true; }
private boolean containsDefaultValue(Outline outline, FieldOutline field) { ClassOutline fClass = null; for (ClassOutline classOutline : outline.getClasses()) { if (classOutline.implClass == field.getRawType() && !classOutline.implClass.isAbstract()) { fClass = classOutline; break; } } if (fClass == null) { return false; } for (FieldOutline f : fClass.getDeclaredFields()) { if (f.getPropertyInfo().getSchemaComponent() instanceof XSParticle) { XSParticle particle = (XSParticle)f.getPropertyInfo().getSchemaComponent(); XSTerm term = particle.getTerm(); if (term.isElementDecl() && term.asElementDecl().getDefaultValue() != null) { return true; } } } return false; }
/** * Gets the {@link BIDom} object that applies to the given particle. */ protected final BIDom getLocalDomCustomization( XSParticle p ) { if (p == null) { return null; } BIDom dom = getBindInfo(p).get(BIDom.class); if(dom!=null) return dom; // if not, the term might have one. dom = getBindInfo(p.getTerm()).get(BIDom.class); if(dom!=null) return dom; XSTerm t = p.getTerm(); // type could also have one, in case of the dom customization if(t.isElementDecl()) return getBindInfo(t.asElementDecl().getType()).get(BIDom.class); // similarly the model group in a model group definition may have one. if(t.isModelGroupDecl()) return getBindInfo(t.asModelGroupDecl().getModelGroup()).get(BIDom.class); return null; }
/** * Gets the {@link BIDom} object that applies to the given particle. */ protected final BIDom getLocalDomCustomization( XSParticle p ) { if (p == null) { return null; } BIDom dom = getBindInfo(p).get(BIDom.class); if(dom!=null) return dom; // if not, the term might have one. dom = getBindInfo(p.getTerm()).get(BIDom.class); if(dom!=null) return dom; XSTerm t = p.getTerm(); // type could also have one, in case of the dom customization if(t.isElementDecl()) return getBindInfo(t.asElementDecl().getType()).get(BIDom.class); // similarly the model group in a model group definition may have one. if(t.isModelGroupDecl()) return getBindInfo(t.asModelGroupDecl().getModelGroup()).get(BIDom.class); return null; }
/** * Gets the {@link BIDom} object that applies to the given particle. */ protected final BIDom getLocalDomCustomization( XSParticle p ) { if (p == null) { return null; } BIDom dom = getBindInfo(p).get(BIDom.class); if(dom!=null) return dom; // if not, the term might have one. dom = getBindInfo(p.getTerm()).get(BIDom.class); if(dom!=null) return dom; XSTerm t = p.getTerm(); // type could also have one, in case of the dom customization if(t.isElementDecl()) return getBindInfo(t.asElementDecl().getType()).get(BIDom.class); // similarly the model group in a model group definition may have one. if(t.isModelGroupDecl()) return getBindInfo(t.asModelGroupDecl().getModelGroup()).get(BIDom.class); return null; }
/** * Gets the {@link BIDom} object that applies to the given particle. */ protected final BIDom getLocalDomCustomization( XSParticle p ) { if (p == null) { return null; } BIDom dom = getBindInfo(p).get(BIDom.class); if(dom!=null) return dom; // if not, the term might have one. dom = getBindInfo(p.getTerm()).get(BIDom.class); if(dom!=null) return dom; XSTerm t = p.getTerm(); // type could also have one, in case of the dom customization if(t.isElementDecl()) return getBindInfo(t.asElementDecl().getType()).get(BIDom.class); // similarly the model group in a model group definition may have one. if(t.isModelGroupDecl()) return getBindInfo(t.asModelGroupDecl().getModelGroup()).get(BIDom.class); return null; }
/** * Gets the {@link BIDom} object that applies to the given particle. */ protected final BIDom getLocalDomCustomization( XSParticle p ) { if (p == null) { return null; } BIDom dom = getBindInfo(p).get(BIDom.class); if(dom!=null) return dom; // if not, the term might have one. dom = getBindInfo(p.getTerm()).get(BIDom.class); if(dom!=null) return dom; XSTerm t = p.getTerm(); // type could also have one, in case of the dom customization if(t.isElementDecl()) return getBindInfo(t.asElementDecl().getType()).get(BIDom.class); // similarly the model group in a model group definition may have one. if(t.isModelGroupDecl()) return getBindInfo(t.asModelGroupDecl().getModelGroup()).get(BIDom.class); return null; }