if ( ( node.getManagedBits() & DependencyNode.MANAGED_SCOPE ) == DependencyNode.MANAGED_SCOPE ) if ( ( node.getManagedBits() & DependencyNode.MANAGED_VERSION ) == DependencyNode.MANAGED_VERSION ) if ( ( node.getManagedBits() & DependencyNode.MANAGED_OPTIONAL ) == DependencyNode.MANAGED_OPTIONAL ) if ( ( node.getManagedBits() & DependencyNode.MANAGED_EXCLUSIONS ) == DependencyNode.MANAGED_EXCLUSIONS ) if ( ( node.getManagedBits() & DependencyNode.MANAGED_PROPERTIES ) == DependencyNode.MANAGED_PROPERTIES )
private boolean deriveOptional( DependencyNode node, Object conflictId ) { Dependency dep = node.getDependency(); boolean optional = ( dep != null ) ? dep.isOptional() : false; if ( optional || ( node.getManagedBits() & DependencyNode.MANAGED_OPTIONAL ) != 0 || ( conflictId != null && resolvedIds.containsKey( conflictId ) ) ) { return optional; } int depth = parentNodes.size(); return ( depth > 0 ) ? parentOptionals.get( depth - 1 ) : false; }
private boolean deriveOptional( DependencyNode node, Object conflictId ) { Dependency dep = node.getDependency(); boolean optional = ( dep != null ) ? dep.isOptional() : false; if ( optional || ( node.getManagedBits() & DependencyNode.MANAGED_OPTIONAL ) != 0 || ( conflictId != null && resolvedIds.containsKey( conflictId ) ) ) { return optional; } int depth = parentNodes.size(); return ( depth > 0 ) ? parentOptionals.get( depth - 1 ) : false; }
/** * Gets the optional flag of the specified dependency node before dependency management was applied (if any). * * @param node The dependency node to retrieve the premanaged data for, must not be {@code null}. * @return The node's optional flag before dependency management or {@code null} if the flag was not managed or if * {@link #CONFIG_PROP_VERBOSE} was not enabled. */ public static Boolean getPremanagedOptional( DependencyNode node ) { if ( ( node.getManagedBits() & DependencyNode.MANAGED_OPTIONAL ) == 0 ) { return null; } return cast( node.getData().get( NODE_DATA_PREMANAGED_OPTIONAL ), Boolean.class ); }
/** * Gets the version or version range of the specified dependency node before dependency management was applied (if * any). * * @param node The dependency node to retrieve the premanaged data for, must not be {@code null}. * @return The node's dependency version before dependency management or {@code null} if the version was not managed * or if {@link #CONFIG_PROP_VERBOSE} was not enabled. */ public static String getPremanagedVersion( DependencyNode node ) { if ( ( node.getManagedBits() & DependencyNode.MANAGED_VERSION ) == 0 ) { return null; } return cast( node.getData().get( NODE_DATA_PREMANAGED_VERSION ), String.class ); }
/** * Gets the scope of the specified dependency node before dependency management was applied (if any). * * @param node The dependency node to retrieve the premanaged data for, must not be {@code null}. * @return The node's dependency scope before dependency management or {@code null} if the scope was not managed or * if {@link #CONFIG_PROP_VERBOSE} was not enabled. */ public static String getPremanagedScope( DependencyNode node ) { if ( ( node.getManagedBits() & DependencyNode.MANAGED_SCOPE ) == 0 ) { return null; } return cast( node.getData().get( NODE_DATA_PREMANAGED_SCOPE ), String.class ); }
/** * Gets the scope of the specified dependency node before dependency management was applied (if any). * * @param node The dependency node to retrieve the premanaged data for, must not be {@code null}. * * @return The node's dependency scope before dependency management or {@code null} if the scope was not managed or * if {@link #CONFIG_PROP_VERBOSE} was not enabled. */ public static String getPremanagedScope( DependencyNode node ) { if ( ( node.getManagedBits() & DependencyNode.MANAGED_SCOPE ) == 0 ) { return null; } return cast( node.getData().get( NODE_DATA_PREMANAGED_SCOPE ), String.class ); }
/** * Gets the optional flag of the specified dependency node before dependency management was applied (if any). * * @param node The dependency node to retrieve the premanaged data for, must not be {@code null}. * * @return The node's optional flag before dependency management or {@code null} if the flag was not managed or if * {@link #CONFIG_PROP_VERBOSE} was not enabled. */ public static Boolean getPremanagedOptional( DependencyNode node ) { if ( ( node.getManagedBits() & DependencyNode.MANAGED_OPTIONAL ) == 0 ) { return null; } return cast( node.getData().get( NODE_DATA_PREMANAGED_OPTIONAL ), Boolean.class ); }
/** * Gets the version or version range of the specified dependency node before dependency management was applied (if * any). * * @param node The dependency node to retrieve the premanaged data for, must not be {@code null}. * * @return The node's dependency version before dependency management or {@code null} if the version was not managed * or if {@link #CONFIG_PROP_VERBOSE} was not enabled. */ public static String getPremanagedVersion( DependencyNode node ) { if ( ( node.getManagedBits() & DependencyNode.MANAGED_VERSION ) == 0 ) { return null; } return cast( node.getData().get( NODE_DATA_PREMANAGED_VERSION ), String.class ); }
/** * Gets the {@code Exclusion}s of the specified dependency node before dependency management was applied (if any). * * @param node The dependency node to retrieve the premanaged data for, must not be {@code null}. * * @return The nodes' {@code Exclusion}s before dependency management or {@code null} if exclusions were not managed * or if {@link #CONFIG_PROP_VERBOSE} was not enabled. * * @since 1.1.0 */ @SuppressWarnings( "unchecked" ) public static Collection<Exclusion> getPremanagedExclusions( DependencyNode node ) { if ( ( node.getManagedBits() & DependencyNode.MANAGED_EXCLUSIONS ) == 0 ) { return null; } return cast( node.getData().get( NODE_DATA_PREMANAGED_EXCLUSIONS ), Collection.class ); }
/** * Gets the properties of the specified dependency node before dependency management was applied (if any). * * @param node The dependency node to retrieve the premanaged data for, must not be {@code null}. * * @return The nodes' properties before dependency management or {@code null} if properties were not managed or if * {@link #CONFIG_PROP_VERBOSE} was not enabled. * * @since 1.1.0 */ @SuppressWarnings( "unchecked" ) public static Map<String, String> getPremanagedProperties( DependencyNode node ) { if ( ( node.getManagedBits() & DependencyNode.MANAGED_PROPERTIES ) == 0 ) { return null; } return cast( node.getData().get( NODE_DATA_PREMANAGED_PROPERTIES ), Map.class ); }
private String deriveScope( DependencyNode node, Object conflictId ) throws RepositoryException { if ( ( node.getManagedBits() & DependencyNode.MANAGED_SCOPE ) != 0 || ( conflictId != null && resolvedIds.containsKey( conflictId ) ) ) { return scope( node.getDependency() ); } int depth = parentNodes.size(); scopes( depth, node.getDependency() ); if ( depth > 0 ) { scopeDeriver.deriveScope( scopeCtx ); } return scopeCtx.derivedScope; }
private String deriveScope( DependencyNode node, Object conflictId ) throws RepositoryException { if ( ( node.getManagedBits() & DependencyNode.MANAGED_SCOPE ) != 0 || ( conflictId != null && resolvedIds.containsKey( conflictId ) ) ) { return scope( node.getDependency() ); } int depth = parentNodes.size(); scopes( depth, node.getDependency() ); if ( depth > 0 ) { scopeDeriver.deriveScope( scopeCtx ); } return scopeCtx.derivedScope; }
/** * Creates a mostly shallow clone of the specified node. The new node has its own copy of any custom data and * initially no children. * * @param node The node to copy, must not be {@code null}. */ public DefaultDependencyNode( DependencyNode node ) { dependency = node.getDependency(); artifact = node.getArtifact(); children = new ArrayList<DependencyNode>( 0 ); setAliases( node.getAliases() ); setRequestContext( node.getRequestContext() ); setManagedBits( node.getManagedBits() ); setRelocations( node.getRelocations() ); setRepositories( node.getRepositories() ); setVersion( node.getVersion() ); setVersionConstraint( node.getVersionConstraint() ); Map<?, ?> data = node.getData(); setData( data.isEmpty() ? null : new HashMap<Object, Object>( data ) ); }
/** * Creates a mostly shallow clone of the specified node. The new node has its own copy of any custom data and * initially no children. * * @param node The node to copy, must not be {@code null}. */ public DefaultDependencyNode( DependencyNode node ) { dependency = node.getDependency(); artifact = node.getArtifact(); children = new ArrayList<DependencyNode>( 0 ); setAliases( node.getAliases() ); setRequestContext( node.getRequestContext() ); setManagedBits( node.getManagedBits() ); setRelocations( node.getRelocations() ); setRepositories( node.getRepositories() ); setVersion( node.getVersion() ); setVersionConstraint( node.getVersionConstraint() ); Map<?, ?> data = node.getData(); setData( data.isEmpty() ? null : new HashMap<Object, Object>( data ) ); }