private ArrayList getAttributeDescriptorsForCleanPath(String aPath, Map pathHints)
    {
        ArrayList result = new ArrayList();
        ClassDescriptor cld = this;
        ObjectReferenceDescriptor ord;
        FieldDescriptor fld;
        String currPath = aPath;
        String segment;
        StringBuffer processedSegment = new StringBuffer();
        int sepPos;
        Class itemClass;

        while (currPath.length() > 0)
        {
            sepPos = currPath.indexOf(".");
            if (sepPos >= 0)
            {
                segment = currPath.substring(0, sepPos);
                currPath = currPath.substring(sepPos + 1);
            }
            else
            {
                segment = currPath;
                currPath = "";
            }

            if (processedSegment.length() > 0)
            {
                processedSegment.append(".");
            }
            processedSegment.append(segment);

            // look for 1:1 or n:1 Relationship
            ord = cld.getObjectReferenceDescriptorByName(segment);
            if (ord == null)
            {
                // look for 1:n or m:n Relationship
                ord = cld.getCollectionDescriptorByName(segment);
            }

            if (ord != null)
            {
                // BRJ : look for hints for the processed segment
                // ie: ref pointng to ClassA and ref.ref pointing to ClassC
                List hintClasses = pathHints != null ? (List) pathHints.get(processedSegment.toString()) : null;
                if (hintClasses != null && hintClasses.get(0) != null)
                {
                    itemClass = (Class) hintClasses.get(0);
                }
                else
                {
                    itemClass = ord.getItemClass();
                }

                cld = cld.getRepository().getDescriptorFor(itemClass);
                result.add(ord);
            }
            else
            {
                // look for Field
                fld = cld.getFieldDescriptorByName(segment);
                if (fld != null)
                {
                    result.add(fld);
                }
            }
        }

        return result;
    }
private ArrayList getAttributeDescriptorsForCleanPath ( String aPath , Map pathHints ) { ArrayList result = new ArrayList ( ) ; ClassDescriptor cld = this ; ObjectReferenceDescriptor ord ; FieldDescriptor fld ; String currPath = aPath ; String segment ; StringBuffer processedSegment = new StringBuffer ( ) ; int sepPos ; Class itemClass ; while ( currPath . length ( ) > 0 ) { sepPos = currPath . indexOf ( "." ) ; if ( sepPos >= 0 ) { segment = currPath . substring ( 0 , sepPos ) ; currPath = currPath . substring ( sepPos + 1 ) ; } else { segment = currPath ; currPath = "" ; } if ( processedSegment . length ( ) > 0 ) { processedSegment . append ( "." ) ; } processedSegment . append ( segment ) ; ord = cld . getObjectReferenceDescriptorByName ( segment ) ; if ( ord == null ) { ord = cld . getCollectionDescriptorByName ( segment ) ; } if ( ord != null ) { List hintClasses = pathHints != null ? ( List ) pathHints . get ( processedSegment . toString ( ) ) : null ; if ( hintClasses != null && hintClasses . get ( 0 ) != null ) { itemClass = ( Class ) hintClasses . get ( 0 ) ; } else { itemClass = ord . getItemClass ( ) ; } cld = cld . getRepository ( ) . getDescriptorFor ( itemClass ) ; result . add ( ord ) ; } else { fld = cld . getFieldDescriptorByName ( segment ) ; if ( fld != null ) { result . add ( fld ) ; } } } return result ; }
return all AttributeDescriptors for the path<br>
ie: partner.addresses.street returns a Collection of 3 AttributeDescriptors
(ObjectReferenceDescriptor, CollectionDescriptor, FieldDescriptor)<br>
ie: partner.addresses returns a Collection of 2 AttributeDescriptors
(ObjectReferenceDescriptor, CollectionDescriptor)
@param aPath the cleaned path to the attribute
@param pathHints a Map containing the class to be used for a segment or <em>null</em>
if no segment is used.
@return ArrayList of AttributeDescriptors