Search in sources :

Example 1 with AnyAttribute

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);
    }
}
Also used : AnyAttribute(org.eclipse.persistence.internal.oxm.schema.model.AnyAttribute) ObjectReferenceMapping(org.eclipse.persistence.internal.oxm.mappings.ObjectReferenceMapping) AnyObjectMapping(org.eclipse.persistence.internal.oxm.mappings.AnyObjectMapping) AnyCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.AnyCollectionMapping) BinaryDataCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.BinaryDataCollectionMapping) ChoiceCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.ChoiceCollectionMapping) BinaryDataMapping(org.eclipse.persistence.internal.oxm.mappings.BinaryDataMapping) DirectCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.DirectCollectionMapping) CollectionReferenceMapping(org.eclipse.persistence.internal.oxm.mappings.CollectionReferenceMapping) CompositeCollectionMapping(org.eclipse.persistence.internal.oxm.mappings.CompositeCollectionMapping) DirectMapping(org.eclipse.persistence.internal.oxm.mappings.DirectMapping) CompositeObjectMapping(org.eclipse.persistence.internal.oxm.mappings.CompositeObjectMapping) AnyAttributeMapping(org.eclipse.persistence.internal.oxm.mappings.AnyAttributeMapping) ChoiceObjectMapping(org.eclipse.persistence.internal.oxm.mappings.ChoiceObjectMapping)

Example 2 with AnyAttribute

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);
    }
}
Also used : AnyAttribute(org.eclipse.persistence.internal.oxm.schema.model.AnyAttribute) SimpleContent(org.eclipse.persistence.internal.oxm.schema.model.SimpleContent)

Aggregations

AnyAttribute (org.eclipse.persistence.internal.oxm.schema.model.AnyAttribute)2 AnyAttributeMapping (org.eclipse.persistence.internal.oxm.mappings.AnyAttributeMapping)1 AnyCollectionMapping (org.eclipse.persistence.internal.oxm.mappings.AnyCollectionMapping)1 AnyObjectMapping (org.eclipse.persistence.internal.oxm.mappings.AnyObjectMapping)1 BinaryDataCollectionMapping (org.eclipse.persistence.internal.oxm.mappings.BinaryDataCollectionMapping)1 BinaryDataMapping (org.eclipse.persistence.internal.oxm.mappings.BinaryDataMapping)1 ChoiceCollectionMapping (org.eclipse.persistence.internal.oxm.mappings.ChoiceCollectionMapping)1 ChoiceObjectMapping (org.eclipse.persistence.internal.oxm.mappings.ChoiceObjectMapping)1 CollectionReferenceMapping (org.eclipse.persistence.internal.oxm.mappings.CollectionReferenceMapping)1 CompositeCollectionMapping (org.eclipse.persistence.internal.oxm.mappings.CompositeCollectionMapping)1 CompositeObjectMapping (org.eclipse.persistence.internal.oxm.mappings.CompositeObjectMapping)1 DirectCollectionMapping (org.eclipse.persistence.internal.oxm.mappings.DirectCollectionMapping)1 DirectMapping (org.eclipse.persistence.internal.oxm.mappings.DirectMapping)1 ObjectReferenceMapping (org.eclipse.persistence.internal.oxm.mappings.ObjectReferenceMapping)1 SimpleContent (org.eclipse.persistence.internal.oxm.schema.model.SimpleContent)1