org.apache.maven.model.Parent.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(167)

本文整理了Java中org.apache.maven.model.Parent.<init>()方法的一些代码示例,展示了Parent.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parent.<init>()方法的具体详情如下:
包路径:org.apache.maven.model.Parent
类名称:Parent
方法名:<init>

Parent.<init>介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

Parent parent = new Parent();
parent.name = "ParentName";

Child child = new Child();
child.name = "ChildName";

parent.child = child;

// this will update the id in child
childDao.create(child);

// this saves the parent with the id of the child
parentDao.create(parent);

代码示例来源:origin: stackoverflow.com

List<Child> childList = new ArrayList<Child>();
childList.add(new Child());

List<? extends Parent> parentList = childList;
parentList.set(0, new Parent());

Child child = childList.get(0); // No! It's not a child! Type safety is broken...

代码示例来源:origin: stackoverflow.com

Parent parent = new Parent();
...
Child c1 = new Child();
...

parent.addToChild(c1);

session.save(parent);

代码示例来源:origin: stackoverflow.com

Parent parent = new Parent();
parent.name = 1;
Child child = new Child();
child.name = 2;
child.salary = 2000;
Parent[] employees = new Parent[] { parent, child };
for (Parent employee : employees) {
  employee.getEmployeeDetails();
}

代码示例来源:origin: stackoverflow.com

Parent parent = new Parent();
...
Child c1 = new Child();
...
c1.setParent(parent);

List<Child> children = new ArrayList<Child>();
children.add(c1);
parent.setChilds(children);

session.save(parent);

代码示例来源:origin: stackoverflow.com

Parent parent = new Parent();
Child child1 = new Child();
Parent child2 = new Child();

parent.StaticMethod();
child1.StaticMethod();
child2.StaticMethod();

代码示例来源:origin: apache/maven

protected void mergeModel_Parent( Model target, Model source, boolean sourceDominant, Map<Object, Object> context )
{
  Parent src = source.getParent();
  if ( src != null )
  {
    Parent tgt = target.getParent();
    if ( tgt == null )
    {
      tgt = new Parent();
      tgt.setRelativePath( null );
      target.setParent( tgt );
    }
    mergeParent( tgt, src, sourceDominant, context );
  }
}

代码示例来源:origin: org.apache.maven/maven-project

public static Parent cloneParent( Parent src )
{
  if ( src == null )
  {
    return null;
  }
  Parent result = new Parent();
  result.setArtifactId( src.getArtifactId() );
  result.setGroupId( src.getGroupId() );
  result.setRelativePath( src.getRelativePath() );
  result.setVersion( src.getVersion() );
  
  return result;
}

代码示例来源:origin: stackoverflow.com

parents.add(new Parent());
Child c = children.get(0);

代码示例来源:origin: apache/maven

Parent parent = new Parent();
for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )

代码示例来源:origin: takari/polyglot-maven

public void parent(NamedValue... keyValuePairs) {
  Parent parent = new Parent();
  parent = NamedValueProcessor.namedToObject(parent, keyValuePairs);
  model.setParent(parent);
}

代码示例来源:origin: takari/polyglot-maven

public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attrs) throws InstantiationException, IllegalAccessException {
 Parent node;
 if (value != null) {
  node = parse(value);
  if (node == null) {
   throw new NodeValueParseException(this, value);
  }
 } else {
  node = new Parent();
 }
 return node;
}

代码示例来源:origin: takari/polyglot-maven

public static Parent parse(final Object value) {
  assert value != null;

  if (value instanceof String) {
   Parent node = new Parent();
   String[] items = ((String) value).split(":");
   switch (items.length) {
   case 3:
    node.setGroupId(items[0]);
    node.setArtifactId(items[1]);
    node.setVersion(items[2]);
    return node;
   }
  }

  return null;
 }
}

代码示例来源:origin: apache/maven

Parent parent = new Parent();
InputLocation _location;
_location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );

代码示例来源:origin: takari/polyglot-maven

@Override
 public Object construct(Node node) {
  ScalarNode scalar = (ScalarNode) node;
  Coordinate coord = Coordinate.createCoordinate(scalar.getValue());
  return coord.mergeParent(new Parent());
 }
}

代码示例来源:origin: takari/polyglot-maven

Parent parent = new Parent();
for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )

代码示例来源:origin: takari/polyglot-maven

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;
}

代码示例来源:origin: io.takari.polyglot/polyglot-yaml

@Override
 public Object construct(Node node) {
  ScalarNode scalar = (ScalarNode) node;
  Coordinate coord = Coordinate.createCoordinate(scalar.getValue());
  return coord.mergeParent(new Parent());
 }
}

代码示例来源:origin: stackoverflow.com

Parent p = new Parent();
p.setGroupId("org.codehaus.griffon");
p.setArtifactId("application-master-pom");
p.setVersion("1.0.0");
MavenFacet mavenFacet = getFaceted().getFacet(MavenFacet.class);
Model model = mavenFacet.getModel();
model.setParent(p);
mavenFacet.setModel(model);

代码示例来源:origin: stackoverflow.com

Parent parent = new Parent();
parent = parentDomainService.save(parent);
parent.setChildren(Lists.newArrayList(new Child(), new Child()));

for (Child child: parent.getChildren()) {
  child.setParentId(parent.getId());
} 

childDomainService.save(parent.getChildren());

相关文章