append( ", implementations={" ); for ( int i = this.getImplementations().size() - 1; i >= 0; i-- ) this.getImplementations().getImplementation( i );
/** * Setter for property {@code multiplicity}. * * @param value the new implementation multiplicity of the specification. * * @throws IllegalArgumentException if {@code value} is not equal to one of * the constants {@code MULTIPLICITY_ONE} or {@code MULTIPLICITY_MANY}. * @throws MultiplicityConstraintException if {@code value} equals * {@code MULTIPLICITY_ONE} and the specification currently has more than * one implementation defined. * * @see #MULTIPLICITY_ONE * @see #MULTIPLICITY_MANY */ public void setMultiplicity( final int value ) { if ( value != MULTIPLICITY_ONE && value != MULTIPLICITY_MANY ) { throw new IllegalArgumentException( Integer.toString( value ) ); } if ( value == MULTIPLICITY_ONE && this.getImplementations().size() > 1 ) { throw new MultiplicityConstraintException( this.getIdentifier() ); } this.multiplicity = value; }
final Collection col = new LinkedList( Arrays.asList( spec.getImplementations(). getImplementations() ) );
public JFileChooser getSaveAsFileChooser() { if(this.saveAsFileChooser == null) { this.saveAsFileChooser = new JFileChooser(); this.saveAsFileChooser.setAcceptAllFileFilterUsed(false); this.saveAsFileChooser.setMultiSelectionEnabled(false); final Implementations formatters = ModelFactory.getModel().getModules(). getSpecification(PhysicalFileFormatter.class.getName()). getImplementations(); for(int i = formatters.size() - 1; i >= 0; i--) { final PhysicalFileFormatter formatter = (PhysicalFileFormatter) ContainerFactory. getContainer().getImplementation( PhysicalFileFormatter.class, formatters.getImplementation(i).getName()); this.saveAsFileChooser.addChoosableFileFilter( new PhysicalFileFormatterFileFilter(formatter)); } } return this.saveAsFileChooser; }
if ( spec.getImplementations().size() != 1 ) impl = spec.getImplementations().getImplementation( 0 ); instance = new Instance( classLoader, spec.getScope(), spec.getImplementations().size() ); for ( int i = spec.getImplementations().size() - 1; i >= 0; i-- ) impl = spec.getImplementations().getImplementation( i ); instance = new Instance( classLoader, spec.getScope(),
/** * Resolves application messages for a given exception by querying any * available {@code ExceptionMessageResolver} implementation stopping at the * first implementation not returning {@code null}. * * @param exception The exception to resolve application messages for. * * @throws NullPointerException if {@code exception} is {@code null}. */ private Message[] resolveMessages( final Exception exception ) { if ( exception == null ) { throw new NullPointerException( "exception" ); } Message[] messages = null; final Specification spec = ModelFactory.getModel().getModules(). getSpecification( ExceptionMessageResolver.class.getName() ); final Implementation[] resolvers = spec.getImplementations(). getImplementations(); for ( int i = resolvers.length - 1; i >= 0 && messages == null; i-- ) { final ExceptionMessageResolver resolver = (ExceptionMessageResolver) ContainerFactory.getContainer(). getObject( ExceptionMessageResolver.class, resolvers[i].getName() ); messages = resolver.resolve( exception ); } return messages; }
getImplementations().size() != 1 ) impl = dependency.getSpecification().getImplementations(). getImplementation( 0 ); getImplementations().size() ); getImplementations().size() - 1; i >= 0; i-- ) impl = dependency.getSpecification().getImplementations(). getImplementation( i );