NeoProjectVersionRef( final String groupId, final String artifactId, final VersionSpec versionSpec, final String versionString ) { super( groupId, artifactId ); if ( versionSpec == null && versionString == null ) { throw new InvalidRefException( "Version spec AND string cannot both be null for '" + groupId + ":" + artifactId + "'" ); } this.versionString = versionString; this.versionSpec = versionSpec; }
SimpleProjectVersionRef( final String groupId, final String artifactId, final VersionSpec versionSpec, final String versionString ) { super( groupId, artifactId ); if ( versionSpec == null && StringUtils.isEmpty( versionString ) ) { throw new InvalidRefException( "Version spec AND string cannot both be empty for '" + groupId + ":" + artifactId + "'" ); } this.versionString = versionString; this.versionSpec = versionSpec; }
public SimpleProjectRef( final String groupId, final String artifactId ) { if ( isEmpty( groupId ) || isEmpty( artifactId ) ) { throw new InvalidRefException( "ProjectId must contain non-empty groupId AND artifactId. (Given: '" + groupId + "':'" + artifactId + "')" ); } this.groupId = groupId; this.artifactId = artifactId; }
public static ProjectVersionRef parse( final String gav ) { final String[] parts = gav.split( ":" ); if ( parts.length < 3 || isEmpty( parts[0] ) || isEmpty( parts[1] ) || isEmpty( parts[2] ) ) { throw new InvalidRefException( "ProjectVersionRef must contain non-empty groupId, artifactId, AND version. (Given: '" + gav + "')" ); } return new SimpleProjectVersionRef( parts[0], parts[1], parts[2] ); }
public static ProjectVersionRef parse( final String gav ) { final String[] parts = gav.split( ":" ); if ( parts.length < 3 || isEmpty( parts[0] ) || isEmpty( parts[1] ) || isEmpty( parts[2] ) ) { throw new InvalidRefException( "ProjectVersionRef must contain non-empty groupId, artifactId, AND version. (Given: '" + gav + "')" ); } return new NeoProjectVersionRef( parts[0], parts[1], parts[2] ); }
public static ProjectRef parse( final String ga ) { final String[] parts = ga.split( ":" ); if ( parts.length < 2 || isEmpty( parts[0] ) || isEmpty( parts[1] ) ) { throw new InvalidRefException( "ProjectRef must contain non-empty groupId AND artifactId. (Given: '" + ga + "')" ); } return new SimpleProjectRef( parts[0], parts[1] ); }
public static ProjectRef parse( final String ga ) { final String[] parts = ga.split( ":" ); if ( parts.length < 2 || isEmpty( parts[0] ) || isEmpty( parts[1] ) ) { throw new InvalidRefException( "ProjectRef must contain non-empty groupId AND artifactId. (Given: '" + ga + "')" ); } return new NeoProjectRef( parts[0], parts[1] ); }
public static String getStringProperty( final PropertyContainer container, final String named, final String memVal ) { if ( memVal != null ) { return memVal; } String v = container == null ? null : Conversions.getStringProperty( named, container ); if ( v == null ) { throw new InvalidRefException( named + " cannot both be null!" ); } return v; }
public NeoProjectRef( final String groupId, final String artifactId ) { this.groupId = groupId; this.artifactId = artifactId; if ( isEmpty( getGroupId() ) || isEmpty( getArtifactId() ) ) { throw new InvalidRefException( "ProjectId must contain non-empty groupId AND artifactId. (Given: '" + groupId + "':'" + artifactId + "')" ); } }
throw new InvalidRefException( "VersionlessArtifactRef must contain AT LEAST non-empty groupId and artifactId. (Given: '" + spec + "')" );
public static NeoArtifactRef parse( final String spec ) { final String[] parts = spec.split( ":" ); if ( parts.length < 3 || isEmpty( parts[0] ) || isEmpty( parts[1] ) || isEmpty( parts[2] ) ) { throw new InvalidRefException( "SimpleArtifactRef must contain AT LEAST non-empty groupId, artifactId, AND version. (Given: '" + spec + "')" ); } final String g = parts[0]; final String a = parts[1]; // assume we're actually parsing a GAV into a POM artifact... String v = parts[2]; String t = "pom"; String c = null; if ( parts.length > 3 ) { // oops, it's a type, not a version...see toString() for the specification. t = v; v = parts[3]; if ( parts.length > 4 ) { c = parts[4]; } } // assume non-optional, because it might not matter if you're parsing a string like this...you'd be more careful if you were reading something // that had an optional field, because it's not in the normal GATV[C] spec. return new NeoArtifactRef( g, a, v, t, c ); }
public static SimpleArtifactRef parse( final String spec ) { final String[] parts = spec.split( ":" ); if ( parts.length < 3 || isEmpty( parts[0] ) || isEmpty( parts[1] ) || isEmpty( parts[2] ) ) { throw new InvalidRefException( "SimpleArtifactRef must contain AT LEAST non-empty groupId, artifactId, AND version. (Given: '" + spec + "')" ); } final String g = parts[0]; final String a = parts[1]; // assume we're actually parsing a GAV into a POM artifact... String v = parts[2]; String t = "pom"; String c = null; if ( parts.length > 3 ) { // oops, it's a type, not a version...see toString() for the specification. t = v; v = parts[3]; if ( parts.length > 4 ) { c = parts[4]; } } // assume non-optional, because it might not matter if you're parsing a string like this...you'd be more careful if you were reading something // that had an optional field, because it's not in the normal GATV[C] spec. return new SimpleArtifactRef( g, a, v, t, c ); }
throw new InvalidRefException( "VersionlessArtifactRef must contain AT LEAST non-empty groupId and artifactId. (Given: '" + spec + "')" );
public NeoProjectRef( final Node container ) { this.container = container; if ( isEmpty( getGroupId() ) || isEmpty( getArtifactId() ) ) { throw new InvalidRefException( "ProjectId must contain non-empty groupId AND artifactId. (Given: '" + getGroupId() + "':'" + getArtifactId() + "', db-node=" + container.getId() + ")" ); } }