public void addClassReference ( final String className , final MetadataElement classReference ) { classReference . setRef ( getNamespaceValue ( classReference . getRef ( ) ) ) ; for ( MetadataItem item : classList ) { if ( item . getName ( ) . equals ( className ) && item . getNamespace ( ) . equals ( getCurrentNamespace ( ) ) && item . getPackageApi ( ) . equals ( getCurrentPackageApi ( ) ) ) { item . getReferences ( ) . add ( classReference ) ; return ; } } final MetadataItem newItem = new MetadataItem ( className ) ; newItem . getReferences ( ) . add ( classReference ) ; newItem . setNamespace ( getCurrentNamespace ( ) ) ; newItem . setSchemaName ( getCurrentSchmema ( ) ) ; newItem . setPackageApi ( getCurrentPackageApi ( ) ) ; newItem . setPackageImpl ( getCurrentPackageImpl ( ) ) ; classList . add ( newItem ) ; }
Adds a new reference to the specific element class . If no element class is found then a new element class . will be created .