private Id id(boolean allowNullVersion) { String groupId = idFragment(); if (groupId == null) { return null; } // Now expect a colon. if (match(Token.Kind.COLON) == null) { return null; } String artifactId = idFragment(); if (artifactId == null) { return null; } // Now expect a colon. String version; if (match(Token.Kind.COLON) == null && !allowNullVersion) { return null; } else { version = idFragment(); if (version == null && !allowNullVersion) { return null; } } return new Id(groupId, artifactId, StringUtils.isEmpty(version) ? null : version); }
private Parent parent() { if (match(Kind.PARENT) == null) return null; if (match(Kind.COLON) == null) { log.severe("Expected ':' after 'inherits'"); return null; } Id parentId = id(true); if (parentId == null) { log.severe("Expected complete artifact identifier in 'parent' clause"); return null; } String relativePath = "../pom.atom"; if (match(Token.Kind.COLON) != null) { relativePath = relativePath(); if (relativePath == null) { return null; } } Parent parent = new Parent(); parent.setGroupId(parentId.getGroup()); parent.setArtifactId(parentId.getArtifact()); parent.setVersion(parentId.getVersion()); parent.setRelativePath(relativePath); return parent; }
model.setDescription(description); model.setUrl(url); model.setName(projectId.getArtifact()); model.setGroupId(projectId.getGroup()); model.setVersion(projectId.getVersion()); model.setArtifactId(projectId.getArtifact()); model.setModelVersion("4.0.0"); for (Id dep : overrides) { Dependency dependency = new Dependency(); dependency.setGroupId(dep.getGroup()); dependency.setArtifactId(dep.getArtifact()); dependency.setVersion(dep.getVersion()); if (null != dep.getClassifier()) { dependency.setClassifier(dep.getClassifier()); for (Id dep : deps) { Dependency dependency = new Dependency(); dependency.setGroupId(dep.getGroup()); dependency.setArtifactId(dep.getArtifact()); dependency.setVersion(dep.getVersion()); if (null != dep.getClassifier()) { dependency.setClassifier(dep.getClassifier());
/** * Dependencies of a project. The real meat of it. */ private List<Id> dependencies(Token.Kind kind, boolean allowNullVersion) { indent(); if (match(kind, Token.Kind.COLON, Token.Kind.LBRACKET) == null) { return null; // no deps. } List<Id> deps = new ArrayList<Id>(); chewEols(); chewIndents(); // Slurp up the dep ids. Id id; while ((id = id(allowNullVersion)) != null) { // Optional additional params at the end. String classifier = classifier(); if (null != classifier) { id.setClassifier(classifier); } chewEols(); chewIndents(); deps.add(id); } if (match(Token.Kind.RBRACKET) == null) { // ERROR! parseException("Expected ]"); } return deps; }
/** * Dependencies of a project. The real meat of it. */ private List<Id> dependencies(Token.Kind kind, boolean allowNullVersion) { indent(); if (match(kind, Token.Kind.COLON, Token.Kind.LBRACKET) == null) { return null; // no deps. } List<Id> deps = new ArrayList<Id>(); chewEols(); chewIndents(); // Slurp up the dep ids. Id id; while ((id = id(allowNullVersion)) != null) { // Optional additional params at the end. String classifier = classifier(); if (null != classifier) { id.setClassifier(classifier); } chewEols(); chewIndents(); deps.add(id); } if (match(Token.Kind.RBRACKET) == null) { // ERROR! parseException("Expected ]"); } return deps; }
plugin.setGroupId(pluginId.getGroup()); plugin.setArtifactId(pluginId.getArtifact()); plugin.setVersion(pluginId.getVersion());
model.setDescription(description); model.setUrl(url); model.setName(projectId.getArtifact()); model.setGroupId(projectId.getGroup()); model.setVersion(projectId.getVersion()); model.setArtifactId(projectId.getArtifact()); model.setModelVersion("4.0.0"); for (Id dep : overrides) { Dependency dependency = new Dependency(); dependency.setGroupId(dep.getGroup()); dependency.setArtifactId(dep.getArtifact()); dependency.setVersion(dep.getVersion()); if (null != dep.getClassifier()) { dependency.setClassifier(dep.getClassifier()); for (Id dep : deps) { Dependency dependency = new Dependency(); dependency.setGroupId(dep.getGroup()); dependency.setArtifactId(dep.getArtifact()); dependency.setVersion(dep.getVersion()); if (null != dep.getClassifier()) { dependency.setClassifier(dep.getClassifier());
private Id id(boolean allowNullVersion) { String groupId = idFragment(); if (groupId == null) { return null; } // Now expect a colon. if (match(Token.Kind.COLON) == null) { return null; } String artifactId = idFragment(); if (artifactId == null) { return null; } // Now expect a colon. String version; if (match(Token.Kind.COLON) == null && !allowNullVersion) { return null; } else { version = idFragment(); if (version == null && !allowNullVersion) { return null; } } return new Id(groupId, artifactId, StringUtils.isEmpty(version) ? null : version); }
/** * Dependencies of a project. The real meat of it. */ private List<Id> dependencies(Token.Kind kind, boolean allowNullVersion) { indent(); if (match(kind, Token.Kind.COLON, Token.Kind.LBRACKET) == null) { return null; // no deps. } List<Id> deps = new ArrayList<Id>(); chewEols(); chewIndents(); // Slurp up the dep ids. Id id; while ((id = id(allowNullVersion)) != null) { // Optional additional params at the end. String classifier = classifier(); if (null != classifier) { id.setClassifier(classifier); } chewEols(); chewIndents(); deps.add(id); } if (match(Token.Kind.RBRACKET) == null) { // ERROR! parseException("Expected ]"); } return deps; }
private Parent parent() { if (match(Kind.PARENT) == null) return null; if (match(Kind.COLON) == null) { log.severe("Expected ':' after 'inherits'"); return null; } Id parentId = id(true); if (parentId == null) { log.severe("Expected complete artifact identifier in 'parent' clause"); return null; } String relativePath = "../pom.atom"; if (match(Token.Kind.COLON) != null) { relativePath = relativePath(); if (relativePath == null) { return null; } } Parent parent = new Parent(); parent.setGroupId(parentId.getGroup()); parent.setArtifactId(parentId.getArtifact()); parent.setVersion(parentId.getVersion()); parent.setRelativePath(relativePath); return parent; }
model.setDescription(description); model.setUrl(url); model.setName(projectId.getArtifact()); model.setGroupId(projectId.getGroup()); model.setVersion(projectId.getVersion()); model.setArtifactId(projectId.getArtifact()); model.setModelVersion("4.0.0"); for (Id dep : overrides) { Dependency dependency = new Dependency(); dependency.setGroupId(dep.getGroup()); dependency.setArtifactId(dep.getArtifact()); dependency.setVersion(dep.getVersion()); if (null != dep.getClassifier()) { dependency.setClassifier(dep.getClassifier()); for (Id dep : deps) { Dependency dependency = new Dependency(); dependency.setGroupId(dep.getGroup()); dependency.setArtifactId(dep.getArtifact()); dependency.setVersion(dep.getVersion()); if (null != dep.getClassifier()) { dependency.setClassifier(dep.getClassifier());
private Id id(boolean allowNullVersion) { String groupId = idFragment(); if (groupId == null) { return null; } // Now expect a colon. if (match(Token.Kind.COLON) == null) { return null; } String artifactId = idFragment(); if (artifactId == null) { return null; } // Now expect a colon. String version; if (match(Token.Kind.COLON) == null && !allowNullVersion) { return null; } else { version = idFragment(); if (version == null && !allowNullVersion) { return null; } } return new Id(groupId, artifactId, StringUtils.isEmpty(version) ? null : version); }
private Parent parent() { if (match(Kind.PARENT) == null) return null; if (match(Kind.COLON) == null) { log.severe("Expected ':' after 'inherits'"); return null; } Id parentId = id(true); if (parentId == null) { log.severe("Expected complete artifact identifier in 'parent' clause"); return null; } String relativePath = "../pom.atom"; if (match(Token.Kind.COLON) != null) { relativePath = relativePath(); if (relativePath == null) { return null; } } Parent parent = new Parent(); parent.setGroupId(parentId.getGroup()); parent.setArtifactId(parentId.getArtifact()); parent.setVersion(parentId.getVersion()); parent.setRelativePath(relativePath); return parent; }
plugin.setGroupId(pluginId.getGroup()); plugin.setArtifactId(pluginId.getArtifact()); plugin.setVersion(pluginId.getVersion());
plugin.setGroupId(pluginId.getGroup()); plugin.setArtifactId(pluginId.getArtifact()); plugin.setVersion(pluginId.getVersion());