class PdfLayer {
/**
* Adds a child layer. Nested layers can only have one parent.
* @param child the child layer
*/
public void addChild(PdfLayer child) {
if (child.parent != null)
throw new IllegalArgumentException(MessageLocalization.getComposedMessage("the.layer.1.already.has.a.parent", child.getAsString(PdfName.NAME).toUnicodeString()));
child.parent = this;
if (children == null)
children = new ArrayList<PdfLayer>();
children.add(child);
}
}