Package se.jbee.inject

Examples of se.jbee.inject.DeclarationType


    Set<Type<?>> nullified = new HashSet<Type<?>>();
    for ( int i = 1; i < bindings.length; i++ ) {
      Binding<?> one = bindings[lastDistinctIndex];
      Binding<?> other = bindings[i];
      final boolean equalResource = one.resource.equalTo( other.resource );
      DeclarationType oneType = one.source.getType();
      DeclarationType otherType = other.source.getType();
      if ( equalResource && oneType.clashesWith( otherType ) ) {
        throw new IllegalStateException( "Duplicate binds:\n" + one + "\n" + other );
      }
      if ( other.source.getType() == DeclarationType.REQUIRED ) {
        required.add( other.resource.getType() );
      } else if ( equalResource && oneType.nullifiedBy( otherType ) ) {
        if ( i - 1 == lastDistinctIndex ) {
          uniques.remove( uniques.size() - 1 );
          nullified.add( one.resource.getType() );
        }
      } else if ( !equalResource || !otherType.replacedBy( oneType ) ) {
        uniques.add( other );
        lastDistinctIndex = i;
      }
    }
    if ( required.isEmpty() ) {
View Full Code Here

TOP

Related Classes of se.jbee.inject.DeclarationType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.