use of org.apache.ws.commons.schema.XmlSchemaComplexType in project cxf by apache.
the class StructVisitor method visitDeclaredStruct.
public void visitDeclaredStruct(AST identifierNode) {
Scope structScope = new Scope(getScope(), identifierNode);
// xmlschema:struct
XmlSchemaComplexType complexType = new XmlSchemaComplexType(schema, true);
complexType.setName(mapper.mapToQName(structScope));
XmlSchemaSequence sequence = new XmlSchemaSequence();
complexType.setParticle(sequence);
// corba:struct
Struct struct = new Struct();
struct.setQName(new QName(typeMap.getTargetNamespace(), structScope.toString()));
struct.setType(complexType.getQName());
struct.setRepositoryID(structScope.toIDLRepositoryID());
boolean recursiveAdd = addRecursiveScopedName(identifierNode);
// struct members
visitStructMembers(identifierNode, struct, sequence, structScope);
if (recursiveAdd) {
removeRecursiveScopedName(identifierNode);
}
// add corbaType
typeMap.getStructOrExceptionOrUnion().add(struct);
// REVISIT: are there assignment needed?
setSchemaType(complexType);
setCorbaType(struct);
// Need to check if the struct was forward declared
processForwardStructActions(structScope);
// Once we've finished declaring the struct, we should make sure it has been removed from
// the list of scopedNames so that we inidicate that is no longer simply forward declared.
scopedNames.remove(structScope);
}
use of org.apache.ws.commons.schema.XmlSchemaComplexType in project ddf by codice.
the class FeatureMetacardTypeTest method testfeatureMetacardTypeMultipleGmlProperties.
@Test
public void testfeatureMetacardTypeMultipleGmlProperties() {
XmlSchema schema = new XmlSchema();
XmlSchemaElement gmlElement = new XmlSchemaElement(schema, true);
gmlElement.setSchemaType(new XmlSchemaComplexType(schema, false));
gmlElement.setSchemaTypeName(new QName(Wfs10Constants.GML_NAMESPACE, GML));
gmlElement.setName(ELEMENT_NAME_1);
XmlSchemaElement gmlElement2 = new XmlSchemaElement(schema, true);
gmlElement2.setSchemaType(new XmlSchemaComplexType(schema, false));
gmlElement2.setSchemaTypeName(new QName(Wfs10Constants.GML_NAMESPACE, GML));
gmlElement2.setName(ELEMENT_NAME_2);
FeatureMetacardType featureMetacardType = new FeatureMetacardType(schema, FEATURE_TYPE, NON_QUERYABLE_PROPS, Wfs10Constants.GML_NAMESPACE);
assertTrue(featureMetacardType.getGmlProperties().size() == 2);
assertAttributeDescriptor(featureMetacardType, ELEMENT_NAME_2, BasicTypes.GEO_TYPE);
assertAttributeDescriptor(featureMetacardType, ELEMENT_NAME_1, BasicTypes.GEO_TYPE);
}
use of org.apache.ws.commons.schema.XmlSchemaComplexType in project ddf by codice.
the class FeatureMetacardTypeTest method testFeatureMetacardTypeNonQueryGmlProperty.
@Test
public void testFeatureMetacardTypeNonQueryGmlProperty() {
XmlSchema schema = new XmlSchema();
XmlSchemaElement gmlElement = new XmlSchemaElement(schema, true);
gmlElement.setSchemaType(new XmlSchemaComplexType(schema, false));
gmlElement.setSchemaTypeName(new QName(Wfs10Constants.GML_NAMESPACE, GML));
gmlElement.setName(ELEMENT_NAME_1);
XmlSchemaElement gmlElement2 = new XmlSchemaElement(schema, true);
gmlElement2.setSchemaType(new XmlSchemaComplexType(schema, false));
gmlElement2.setSchemaTypeName(new QName(Wfs10Constants.GML_NAMESPACE, GML));
gmlElement2.setName(ELEMENT_NAME_2);
List<String> nonQueryProps = new ArrayList<String>();
nonQueryProps.add(ELEMENT_NAME_2);
FeatureMetacardType featureMetacardType = new FeatureMetacardType(schema, FEATURE_TYPE, nonQueryProps, Wfs10Constants.GML_NAMESPACE);
assertTrue(featureMetacardType.getGmlProperties().size() == 2);
AttributeDescriptor attrDesc = featureMetacardType.getAttributeDescriptor(prefix(ELEMENT_NAME_1));
assertNotNull(attrDesc);
assertTrue(attrDesc.getType() == BasicTypes.GEO_TYPE);
assertTrue(attrDesc.isIndexed());
AttributeDescriptor attrDesc2 = featureMetacardType.getAttributeDescriptor(prefix(ELEMENT_NAME_2));
assertNotNull(attrDesc2);
assertTrue(attrDesc2.getType() == BasicTypes.GEO_TYPE);
assertFalse(attrDesc2.isIndexed());
}
use of org.apache.ws.commons.schema.XmlSchemaComplexType in project ddf by codice.
the class FeatureMetacardTypeTest method testfeatureMetacardTypeFindSingleGmlProperty.
@Test
public void testfeatureMetacardTypeFindSingleGmlProperty() {
XmlSchema schema = new XmlSchema();
XmlSchemaElement gmlElement = new XmlSchemaElement(schema, true);
gmlElement.setSchemaType(new XmlSchemaComplexType(schema, false));
gmlElement.setSchemaTypeName(new QName(Wfs10Constants.GML_NAMESPACE, GML));
gmlElement.setName(ELEMENT_NAME_1);
FeatureMetacardType featureMetacardType = new FeatureMetacardType(schema, FEATURE_TYPE, NON_QUERYABLE_PROPS, Wfs10Constants.GML_NAMESPACE);
assertTrue(featureMetacardType.getGmlProperties().size() == 1);
assertAttributeDescriptor(featureMetacardType, ELEMENT_NAME_1, BasicTypes.GEO_TYPE);
}
use of org.apache.ws.commons.schema.XmlSchemaComplexType in project ddf by codice.
the class FeatureMetacardTypeTest method testfeatureMetacardTypeFindSingleGmlProperty.
@Test
public void testfeatureMetacardTypeFindSingleGmlProperty() {
XmlSchema schema = new XmlSchema();
XmlSchemaElement gmlElement = new XmlSchemaElement(schema, true);
gmlElement.setSchemaType(new XmlSchemaComplexType(schema, false));
gmlElement.setSchemaTypeName(new QName(Wfs20Constants.GML_3_2_NAMESPACE, GML));
gmlElement.setName(ELEMENT_NAME_1);
FeatureMetacardType featureMetacardType = new FeatureMetacardType(schema, FEATURE_TYPE, NON_QUERYABLE_PROPS, Wfs20Constants.GML_3_2_NAMESPACE);
assertTrue(featureMetacardType.getGmlProperties().size() == 1);
assertAttributeDescriptor(featureMetacardType, ELEMENT_NAME_1, BasicTypes.GEO_TYPE);
}
Aggregations