Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0,
* or the Eclipse Distribution License v. 1.0 which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
*/
// Contributors:
// Oracle - initial API and implementation from Oracle TopLink
package org.eclipse.persistence.jaxb.compiler;
import java.awt.Image;
import java.beans.Introspector;
import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import jakarta.xml.bind.SchemaOutputResolver;
import jakarta.xml.bind.annotation.XmlElementDecl.GLOBAL;
import jakarta.xml.bind.annotation.XmlSchemaType;
import javax.xml.namespace.QName;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
import org.eclipse.persistence.exceptions.BeanValidationException;
import org.eclipse.persistence.internal.core.helper.CoreClassConstants;
import org.eclipse.persistence.internal.jaxb.many.MapValue;
import org.eclipse.persistence.internal.oxm.Constants;
import org.eclipse.persistence.internal.oxm.Namespace;
import org.eclipse.persistence.internal.oxm.XPathFragment;
import org.eclipse.persistence.internal.oxm.mappings.Field;
import org.eclipse.persistence.internal.oxm.schema.model.All;
import org.eclipse.persistence.internal.oxm.schema.model.Any;
import org.eclipse.persistence.internal.oxm.schema.model.AnyAttribute;
import org.eclipse.persistence.internal.oxm.schema.model.Attribute;
import org.eclipse.persistence.internal.oxm.schema.model.Choice;
import org.eclipse.persistence.internal.oxm.schema.model.ComplexContent;
import org.eclipse.persistence.internal.oxm.schema.model.ComplexType;
import org.eclipse.persistence.internal.oxm.schema.model.Element;
import org.eclipse.persistence.internal.oxm.schema.model.Extension;
import org.eclipse.persistence.internal.oxm.schema.model.Import;
import org.eclipse.persistence.internal.oxm.schema.model.Occurs;
import org.eclipse.persistence.internal.oxm.schema.model.Restriction;
import org.eclipse.persistence.internal.oxm.schema.model.Schema;
import org.eclipse.persistence.internal.oxm.schema.model.Sequence;
import org.eclipse.persistence.internal.oxm.schema.model.SimpleComponent;
import org.eclipse.persistence.internal.oxm.schema.model.SimpleContent;
import org.eclipse.persistence.internal.oxm.schema.model.SimpleType;
import org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle;
import org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticleOwner;
import org.eclipse.persistence.jaxb.compiler.builder.TransformerPropertyBuilder;
import org.eclipse.persistence.jaxb.compiler.facets.DecimalMaxFacet;
import org.eclipse.persistence.jaxb.compiler.facets.DecimalMinFacet;
import org.eclipse.persistence.jaxb.compiler.facets.DigitsFacet;
import org.eclipse.persistence.jaxb.compiler.facets.Facet;
import org.eclipse.persistence.jaxb.compiler.facets.FacetVisitor;
import org.eclipse.persistence.jaxb.compiler.facets.MaxFacet;
import org.eclipse.persistence.jaxb.compiler.facets.MinFacet;
import org.eclipse.persistence.jaxb.compiler.facets.PatternFacet;
import org.eclipse.persistence.jaxb.compiler.facets.PatternListFacet;
import org.eclipse.persistence.jaxb.compiler.facets.SizeFacet;
import org.eclipse.persistence.jaxb.javamodel.Helper;
import org.eclipse.persistence.jaxb.javamodel.JavaClass;
import org.eclipse.persistence.jaxb.javamodel.JavaClassCompareByNamespace;
import org.eclipse.persistence.jaxb.xmlmodel.XmlElementWrapper;
import org.eclipse.persistence.jaxb.xmlmodel.XmlJoinNodes.XmlJoinNode;
import org.eclipse.persistence.jaxb.xmlmodel.XmlVirtualAccessMethodsSchema;
import org.eclipse.persistence.oxm.NamespaceResolver;
import org.eclipse.persistence.oxm.XMLField;
/**
* INTERNAL:
*
Purpose:To generate Schema objects based on a map of TypeInfo objects, and some
* additional information gathered by the AnnotationsProcessing phase.
*
Responsibilities:
*
Create and maintain a collection of Schema objects based on the provided TypeInfo objects
*
Add additional global elements to the schema based on an optional map (for WS integration)
*
Should create a schema for each namespace encountered during generation.
*
*
This class is used by the Generator to handle the generation of Schemas. The
* Generator passes in a map of TypeInfo objects, generated by the Annotations processor.
* The generated Schemas are stored in a map of keyed on Target Namespace.
* @see org.eclipse.persistence.jaxb.compiler.TypeInfo
* @see org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor
* @see org.eclipse.persistence.jaxb.compiler.Generator
* @since Oracle TopLink 11.1.1.0.0
* @author mmacivor
*/
public class SchemaGenerator {
private Map schemaForNamespace;
private List allSchemas;
private int schemaCount;
private Helper helper;
private Map typeInfo;
private Map packageToPackageInfoMappings;
private Map schemaTypeInfo;
private Map userDefinedSchemaTypes;
private Map arrayClassesToGeneratedClasses;
private static final String JAVAX_ACTIVATION_DATAHANDLER = "jakarta.activation.DataHandler";
private static final String JAVAX_MAIL_INTERNET_MIMEMULTIPART = "jakarta.mail.internet.MimeMultipart";
private static final String SWA_REF_IMPORT = "http://ws-i.org/profiles/basic/1.1/swaref.xsd";
private static final String COLON = ":";
private static final String ATT = "@";
private static final String EMPTY_STRING = "";
private static final String DOT = ".";
private static final String SKIP = "skip";
private static final String ENTRY = "entry";
private static final String GENERATE = "##generate";
private static final String SCHEMA = "schema";
private static final String SCHEMA_EXT = ".xsd";
private static final String OBJECT_CLASSNAME = "java.lang.Object";
private static final String ID = "ID";
private static final String IDREF = "IDREF";
private static final Character DOT_CHAR = '.';
private static final Character SLASH = '/';
private static final Character SLASHES = '\\';
private SchemaOutputResolver outputResolver;
private boolean facets;
public SchemaGenerator(Helper helper) {
this.helper = helper;
this.facets = helper.isFacets();
}
public void generateSchema(List typeInfoClasses, Map typeInfo, Map userDefinedSchemaTypes, Map packageToPackageInfoMappings, Map additionalGlobalElements, Map arrayClassesToGeneratedClasses, SchemaOutputResolver outputResolver) {
this.outputResolver = outputResolver;
generateSchema(typeInfoClasses, typeInfo, userDefinedSchemaTypes, packageToPackageInfoMappings, additionalGlobalElements, arrayClassesToGeneratedClasses);
}
public void generateSchema(List typeInfoClasses, Map typeInfo, Map userDefinedSchemaTypes, Map packageToPackageInfoMappings, Map additionalGlobalElements, Map arrayClassesToGeneratedClasses) {
this.typeInfo = typeInfo;
this.userDefinedSchemaTypes = userDefinedSchemaTypes;
this.packageToPackageInfoMappings = packageToPackageInfoMappings;
this.schemaCount = 1;
this.schemaTypeInfo = new HashMap(typeInfo.size());
this.arrayClassesToGeneratedClasses = arrayClassesToGeneratedClasses;
//sort input classes before schema name (like schema1.xsd, schema2.xsd....) is generated and assigned
typeInfoClasses.sort(new JavaClassCompareByNamespace(typeInfo));
for (JavaClass javaClass : typeInfoClasses) {
addSchemaComponents(javaClass);
}
populateSchemaTypes();
if (additionalGlobalElements != null) {
addGlobalElements(additionalGlobalElements);
}
}
public void addSchemaComponents(JavaClass myClass) {
// first check for type
String myClassName = myClass.getQualifiedName();
Element rootElement = null;
TypeInfo info = typeInfo.get(myClassName);
if (info.isTransient() || info.getClassNamespace().equals(javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI)) {
return;
}
SchemaTypeInfo schemaTypeInfo = new SchemaTypeInfo();
schemaTypeInfo.setSchemaTypeName(new QName(info.getClassNamespace(), info.getSchemaTypeName()));
this.schemaTypeInfo.put(myClass.getQualifiedName(), schemaTypeInfo);
NamespaceInfo namespaceInfo = this.packageToPackageInfoMappings.get(myClass.getPackageName()).getNamespaceInfo();
if (namespaceInfo.getLocation() != null && !namespaceInfo.getLocation().equals(GENERATE)) {
return;
}
Schema schema = getSchemaForNamespace(info.getClassNamespace(), myClass.getPackageName());
info.setSchema(schema);
String typeName = info.getSchemaTypeName();
String pfx = EMPTY_STRING;
Property valueField = null;
if (info.isSetXmlRootElement()) {
//Create the root element and add it to the schema
org.eclipse.persistence.jaxb.xmlmodel.XmlRootElement xmlRE = info.getXmlRootElement();
rootElement = new Element();
String elementName = xmlRE.getName();
if (elementName.equals(XMLProcessor.DEFAULT) || elementName.equals(EMPTY_STRING)) {
try{
elementName = info.getXmlNameTransformer().transformRootElementName(myClassName);
}catch (Exception ex){
throw org.eclipse.persistence.exceptions.JAXBException.exceptionDuringNameTransformation(myClassName, info.getXmlNameTransformer().getClass().getName(), ex);
}
}
rootElement.setName(elementName);
String rootNamespace = xmlRE.getNamespace();
if (rootNamespace.equals(XMLProcessor.DEFAULT)) {
Schema rootElementSchema = getSchemaForNamespace(namespaceInfo.getNamespace());
if (rootElementSchema != null) {
rootElementSchema.addTopLevelElement(rootElement);
}
schemaTypeInfo.getGlobalElementDeclarations().add(new QName(namespaceInfo.getNamespace(), rootNamespace));
rootNamespace = namespaceInfo.getNamespace();
} else {
Schema rootElementSchema = getSchemaForNamespace(rootNamespace);
if (rootElementSchema != null) {
rootElementSchema.addTopLevelElement(rootElement);
}
schemaTypeInfo.getGlobalElementDeclarations().add(new QName(rootNamespace, elementName));
}
// handle root-level imports/includes [schema = the type's schema]
Schema rootSchema = getSchemaForNamespace(rootNamespace);
addImportIfRequired(rootSchema, schema, schema.getTargetNamespace());
// setup a prefix, if necessary
if (rootSchema != null && !info.getClassNamespace().equals(EMPTY_STRING)) {
pfx = getOrGeneratePrefixForNamespace(info.getClassNamespace(), rootSchema);
pfx += COLON;
}
}
if (CompilerHelper.isSimpleType(info)){
SimpleType type = new SimpleType();
//simple type case, we just need the name and namespace info
if (typeName.equals(EMPTY_STRING)) {
//In this case, it should be a type under
//A root elem or locally defined whenever used
if (rootElement != null) {
rootElement.setSimpleType(type);
}
} else {
type.setName(typeName);
schema.addTopLevelSimpleTypes(type);
if (rootElement != null) {
rootElement.setType(pfx + type.getName());
}
}
//Figure out schema type and set it as Restriction
QName restrictionType = null;
Restriction restriction = new Restriction();
if (info.isEnumerationType()) {
restrictionType = ((EnumTypeInfo) info).getRestrictionBase();
restriction.setEnumerationFacets(this.getEnumerationFacetsFor((EnumTypeInfo) info));
String prefix = null;
if (restrictionType.getNamespaceURI() != null && !EMPTY_STRING.equals(restrictionType.getNamespaceURI())) {
if (javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(restrictionType.getNamespaceURI())) {
prefix = Constants.SCHEMA_PREFIX;
} else {
prefix = getPrefixForNamespace(schema, restrictionType.getNamespaceURI());
}
}
String extensionTypeName = restrictionType.getLocalPart();
if (prefix != null) {
extensionTypeName = prefix + COLON + extensionTypeName;
}
restriction.setBaseType(extensionTypeName);
type.setRestriction(restriction);
} else {
valueField= info.getXmlValueProperty();
JavaClass javaType = valueField.getActualType();
QName baseType = getSchemaTypeFor(javaType);
String prefix = null;
if (baseType.getNamespaceURI() != null && !baseType.getNamespaceURI().equals(EMPTY_STRING)) {
if (baseType.getNamespaceURI().equals(javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI)) {
prefix = Constants.SCHEMA_PREFIX;
} else {
prefix = getPrefixForNamespace(schema, baseType.getNamespaceURI());
}
}
String baseTypeName = baseType.getLocalPart();
if (prefix != null) {
baseTypeName = prefix + COLON + baseTypeName;
}
if (valueField.isXmlList() || (valueField.getGenericType() != null)) {
//generate a list instead of a restriction
org.eclipse.persistence.internal.oxm.schema.model.List list = new org.eclipse.persistence.internal.oxm.schema.model.List();
list.setItemType(baseTypeName);
type.setList(list);
} else {
if (helper.isAnnotationPresent(valueField.getElement(), XmlSchemaType.class)) {
XmlSchemaType schemaType = (XmlSchemaType) helper.getAnnotation(valueField.getElement(), XmlSchemaType.class);
baseType = new QName(schemaType.namespace(), schemaType.name()); // TODO: This assignment seems like a bug, probably this should be "baseTypeName" ?
}
restriction.setBaseType(baseTypeName);
type.setRestriction(restriction);
}
}
info.setSimpleType(type);
} else if ((valueField = this.getXmlValueFieldForSimpleContent(info)) != null) {
ComplexType type = new ComplexType();
SimpleContent content = new SimpleContent();
if (EMPTY_STRING.equals(typeName)) {
if (rootElement != null) {
rootElement.setComplexType(type);
}
info.setComplexType(type);
} else {
type.setName(typeName);
schema.addTopLevelComplexTypes(type);
if (rootElement != null) {
rootElement.setType(pfx + type.getName());
}
}
QName extensionType = getSchemaTypeFor(valueField.getType());
if (helper.isAnnotationPresent(valueField.getElement(), XmlSchemaType.class)) {
XmlSchemaType schemaType = (XmlSchemaType) helper.getAnnotation(valueField.getElement(), XmlSchemaType.class);
extensionType = new QName(schemaType.namespace(), schemaType.name());
}
String prefix = null;
if (extensionType.getNamespaceURI() != null && !extensionType.getNamespaceURI().equals(EMPTY_STRING)) {
if (extensionType.getNamespaceURI().equals(javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI)) {
prefix = Constants.SCHEMA_PREFIX;
} else {
prefix = getPrefixForNamespace(schema, extensionType.getNamespaceURI());
}
}
String extensionTypeName = extensionType.getLocalPart();
if (prefix != null) {
extensionTypeName = prefix + COLON + extensionTypeName;
}
Extension extension = new Extension();
extension.setBaseType(extensionTypeName);
content.setExtension(extension);
type.setSimpleContent(content);
info.setComplexType(type);
} else {
ComplexType type = createComplexTypeForClass(myClass, info);
TypeDefParticle compositor = null;
if(type.getComplexContent() != null && type.getComplexContent().getExtension() != null) {
compositor = type.getComplexContent().getExtension().getTypeDefParticle();
} else {
compositor = type.getTypeDefParticle();
}
if (EMPTY_STRING.equals(typeName)) {
if (rootElement != null) {
rootElement.setComplexType(type);
}
info.setComplexType(type);
info.setCompositor(compositor);
} else {
type.setName(typeName);
if (rootElement != null) {
rootElement.setType(pfx + type.getName());
}
schema.addTopLevelComplexTypes(type);
info.setComplexType(type);
info.setCompositor(compositor);
}
}
}
private ComplexType createComplexTypeForClass(JavaClass myClass, TypeInfo info) {
Schema schema = getSchemaForNamespace(info.getClassNamespace());
ComplexType type = new ComplexType();
JavaClass superClass = CompilerHelper.getNextMappedSuperClass(myClass, this.typeInfo, this.helper);
// Handle abstract class
if (myClass.isAbstract()) {
type.setAbstractValue(true);
}
Extension extension = null;
if (superClass != null) {
TypeInfo parentTypeInfo = this.typeInfo.get(superClass.getQualifiedName());
if (parentTypeInfo != null) {
extension = new Extension();
// may need to qualify the type
String parentPrefix = getPrefixForNamespace(schema, parentTypeInfo.getClassNamespace());
if (parentPrefix != null) {
extension.setBaseType(parentPrefix + COLON + parentTypeInfo.getSchemaTypeName());
} else {
extension.setBaseType(parentTypeInfo.getSchemaTypeName());
}
if(parentTypeInfo.getXmlValueProperty() != null){
SimpleContent content = new SimpleContent();
content.setExtension(extension);
type.setSimpleContent(content);
return type;
}else{
ComplexContent content = new ComplexContent();
content.setExtension(extension);
type.setComplexContent(content);
}
}
}
TypeDefParticle compositor = null;
String[] propOrder = null;
if (info.isSetPropOrder()) {
propOrder = info.getPropOrder();
}
if (propOrder != null && propOrder.length == 0) {
// Note that the spec requires an 'all' to be generated
// in cases where propOrder == 0, however, the TCK
// requires the extension case to use sequences
if (info.hasElementRefs()) {
// generate a sequence to satisfy TCK
compositor = new Sequence();
if (extension != null) {
extension.setSequence((Sequence) compositor);
} else {
type.setSequence((Sequence) compositor);
}
} else if (extension != null) {
compositor = new All();
extension.setAll((All) compositor);
} else {
compositor = new All();
type.setAll((All) compositor);
}
} else {
// generate a sequence to satisfy TCK
compositor = new Sequence();
if (extension != null) {
extension.setSequence((Sequence) compositor);
} else {
type.setSequence((Sequence) compositor);
}
}
return type;
}
public void addToSchemaType(TypeInfo ownerTypeInfo, java.util.List properties, TypeDefParticle compositor, ComplexType type, Schema workingSchema) {
//If there are no properties we don't want a sequence/choice or all tag written out
if (properties.size() == 0) {
type.setAll(null);
type.setSequence(null);
type.setChoice(null);
ownerTypeInfo.setCompositor(null);
return;
}
boolean extAnyAdded = false;
// generate schema components for each property
for (Property next : properties) {
if (next == null) { continue; }
Schema currentSchema = workingSchema;
TypeDefParticle parentCompositor = compositor;
boolean isChoice = (parentCompositor instanceof Choice);
ComplexType parentType = type;
// ignore transient and inverse reference/non-writeable properties
if(!next.isTransient() && !(next.isInverseReference() && !next.isWriteableInverseReference())){
// handle xml extensions
if (next.isVirtual()) {
boolean extSchemaAny = false;
if (ownerTypeInfo.getXmlVirtualAccessMethods().getSchema() != null) {
extSchemaAny = ownerTypeInfo.getXmlVirtualAccessMethods().getSchema().equals(XmlVirtualAccessMethodsSchema.ANY);
}
if (extSchemaAny && !next.isAttribute()) {
if (!extAnyAdded) {
addAnyToSchema(next, compositor, true, Constants.ANY_NAMESPACE_ANY);
extAnyAdded = true;
continue;
} else {
// any already added
continue;
}
} else {
// proceed, adding the schema element as usual
}
}
// handle transformers
if (next.isSetXmlTransformation() && next.getXmlTransformation().isSetXmlWriteTransformers()) {
addTransformerToSchema(next, ownerTypeInfo, compositor, type, workingSchema);
continue;
}
// handle XmlJoinNodes
if (next.isSetXmlJoinNodes()) {
addXmlJoinNodesToSchema(next, parentCompositor, currentSchema, parentType);
continue;
}
// deal with xml-path case
if (next.getXmlPath() != null) {
// create schema components based on the XmlPath
AddToSchemaResult xpr = addXPathToSchema(next, parentCompositor, currentSchema, isChoice, type);
// if the returned object or schema component is null there is nothing to do
if (xpr == null || ((parentCompositor = xpr.particle) == null && xpr.simpleContentType == null)) {
continue;
}
// now process the property as per usual, adding to the created schema component
if(xpr.schema == null) {
//if there's no schema, this may be a ref to an attribute in an ungenerated schema
//no need to generate the attribute in the target schema
continue;
}
currentSchema = xpr.schema;
if(parentCompositor == null) {
parentType = xpr.simpleContentType;
} else if (parentCompositor.getOwner() instanceof ComplexType) {
parentType = ((ComplexType)parentCompositor.getOwner());
}
// deal with the XmlElementWrapper case
} else if (!isChoice && !next.isMap() && next.isSetXmlElementWrapper()) {
AddToSchemaResult asr = addXmlElementWrapperToSchema(next, currentSchema, compositor);
// if returned object is null there is nothing to do
if (asr == null) {
continue;
}
// the returned object contains ComplexType and TypeDefParticles to use
parentType = asr.type;
parentCompositor = asr.particle;
}
// handle mixed content
if (next.isMixedContent()) {
parentType.setMixed(true);
}
// handle attribute
if (next.isAttribute() && !next.isAnyAttribute()) {
addAttributeToSchema(buildAttribute(next, currentSchema), next.getSchemaName(), currentSchema, parentType);
// handle any attribute
} else if (next.isAnyAttribute()) {
addAnyAttributeToSchema(parentType);
// handle choice
} else if (next.isChoice()) {
addChoiceToSchema(next, ownerTypeInfo, parentType, parentCompositor, currentSchema);
// handle reference
} else if (next.isReference()) {
addReferenceToSchema(next, currentSchema, parentCompositor);
// handle any
} else if (next.isAny() || next.getVariableAttributeName() !=null) {
addAnyToSchema(next, parentCompositor);
// add an element
} else if (!(ownerTypeInfo.getXmlValueProperty() != null && ownerTypeInfo.getXmlValueProperty() == next)) {
Element element = buildElement(next, parentCompositor instanceof All, currentSchema, ownerTypeInfo);
addElementToSchema(element, next.getSchemaName().getNamespaceURI(), next.isPositional(), parentCompositor, currentSchema, ownerTypeInfo.getJavaClass().getPackageName());
}
}
}
}
/**
* Return the schema type (as QName) based on a given JavaClass.
*
* @param javaClass
* @return
*/
public QName getSchemaTypeFor(JavaClass javaClass) {
String className;
if (javaClass.isArray()) {
Class wrapperClass = arrayClassesToGeneratedClasses.get(javaClass.getName());
if (null == wrapperClass) {
className = javaClass.getQualifiedName();
} else {
className = wrapperClass.getName();
}
} else {
className = javaClass.getQualifiedName();
}
// check user defined types first
QName schemaType = userDefinedSchemaTypes.get(className);
if (schemaType == null) {
schemaType = (QName) helper.getXMLToJavaTypeMap().get(javaClass.getRawName());
}
if (schemaType == null) {
TypeInfo targetInfo = this.typeInfo.get(className);
if (targetInfo != null) {
schemaType = new QName(targetInfo.getClassNamespace(), targetInfo.getSchemaTypeName());
}
}
if (schemaType == null) {
if (javaClass.getQualifiedName().equals(OBJECT_CLASSNAME)) {
return Constants.ANY_TYPE_QNAME;
}
return Constants.ANY_SIMPLE_TYPE_QNAME;
}
return schemaType;
}
public void populateSchemaTypes() {
for (TypeInfo info : typeInfo.values()) {
if (info.isComplexType()) {
if (info.getSchema() != null) {
List props = info.getNonTransientPropertiesInPropOrder();
// handle class indicator field name
if (info.isSetXmlDiscriminatorNode()) {
String xpath = info.getXmlDiscriminatorNode();
String pname = XMLProcessor.getNameFromXPath(xpath, EMPTY_STRING, true);
if (!pname.equals(EMPTY_STRING)) {
// since there is no property for the indicator field name, we'll need to make one
Property prop = new Property(helper);
prop.setPropertyName(pname);
prop.setXmlPath(xpath);
prop.setSchemaName(new QName(pname));
prop.setType(helper.getJavaClass(String.class));
prop.setIsAttribute(true);
props.add(prop);
}
}
addToSchemaType(info, props, info.getCompositor(), info.getComplexType(), info.getSchema());
if (info.hasPredicateProperties()) {
addToSchemaType(info, info.getPredicateProperties(), info.getCompositor(), info.getComplexType(), info.getSchema());
}
}
}
}
}
public String getSchemaTypeNameForClassName(String className) {
return Introspector.decapitalize(className.substring(className.lastIndexOf(DOT_CHAR) + 1));
}
public ArrayList