use of org.eclipse.persistence.internal.oxm.schema.model.AnyAttribute in project eclipselink by eclipse-ee4j.
the class SchemaModelGenerator method processMapping.
/**
* Process a given mapping.
*/
protected void processMapping(CoreMapping mapping, Sequence seq, ComplexType ct, HashMap<String, Schema> schemaForNamespace, Schema workingSchema, SchemaModelGeneratorProperties properties, List<Descriptor> descriptors) {
if (mapping instanceof BinaryDataMapping) {
processXMLBinaryDataMapping((BinaryDataMapping) mapping, seq, ct, schemaForNamespace, workingSchema, properties);
} else if (mapping instanceof BinaryDataCollectionMapping) {
processXMLBinaryDataCollectionMapping((BinaryDataCollectionMapping) mapping, seq, ct, schemaForNamespace, workingSchema, properties);
} else if (mapping instanceof DirectMapping) {
processXMLDirectMapping((DirectMapping) mapping, seq, ct, schemaForNamespace, workingSchema, properties);
} else if (mapping instanceof DirectCollectionMapping) {
processXMLCompositeDirectCollectionMapping((DirectCollectionMapping) mapping, seq, ct, schemaForNamespace, workingSchema, properties);
} else if (mapping instanceof CompositeCollectionMapping) {
processXMLCompositeMapping((CompositeCollectionMapping) mapping, seq, ct, schemaForNamespace, workingSchema, properties, descriptors, true);
} else if (mapping instanceof CompositeObjectMapping) {
processXMLCompositeMapping((CompositeObjectMapping) mapping, seq, ct, schemaForNamespace, workingSchema, properties, descriptors, false);
} else if (mapping instanceof AnyAttributeMapping) {
AnyAttribute anyAttribute = new AnyAttribute();
anyAttribute.setProcessContents(AnyAttribute.LAX);
ct.setAnyAttribute(anyAttribute);
} else if (mapping instanceof AnyObjectMapping) {
processAnyMapping(seq, false);
} else if (mapping instanceof AnyCollectionMapping) {
processAnyMapping(seq, true);
} else if (mapping instanceof ChoiceObjectMapping) {
processXMLChoiceObjectMapping((ChoiceObjectMapping) mapping, seq, ct, schemaForNamespace, workingSchema, properties, descriptors);
} else if (mapping instanceof ChoiceCollectionMapping) {
processXMLChoiceCollectionMapping((ChoiceCollectionMapping) mapping, seq, ct, schemaForNamespace, workingSchema, properties, descriptors);
} else if (mapping instanceof CollectionReferenceMapping) {
processXMLObjectReferenceMapping((CollectionReferenceMapping) mapping, seq, ct, schemaForNamespace, workingSchema, properties, descriptors, true);
} else if (mapping instanceof ObjectReferenceMapping) {
processXMLObjectReferenceMapping((ObjectReferenceMapping) mapping, seq, ct, schemaForNamespace, workingSchema, properties, descriptors, false);
}
}
use of org.eclipse.persistence.internal.oxm.schema.model.AnyAttribute in project eclipselink by eclipse-ee4j.
the class SchemaGenerator method addAnyAttributeToSchema.
/**
* Convenience method for processing an any attribute property. Required
* schema components will be generated and set accordingly.
*
* @param type the ComplexType which compositor(s) should be added to
*/
private void addAnyAttributeToSchema(ComplexType type) {
AnyAttribute anyAttribute = new AnyAttribute();
anyAttribute.setProcessContents(SKIP);
anyAttribute.setNamespace(Constants.ANY_NAMESPACE_OTHER);
if (type.getSimpleContent() != null) {
SimpleContent content = type.getSimpleContent();
if (content.getExtension() != null) {
content.getExtension().setAnyAttribute(anyAttribute);
} else if (content.getRestriction() != null) {
content.getRestriction().setAnyAttribute(anyAttribute);
}
} else {
type.setAnyAttribute(anyAttribute);
}
}
Aggregations