Mercurial Hosting > luan
comparison src/goodjava/xml/XmlElement.java @ 1810:3c43b07e12b7
minor
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Sun, 12 May 2024 22:00:42 -0600 |
| parents | a55a891a4f67 |
| children | 9daae8cf4bef |
comparison
equal
deleted
inserted
replaced
| 1809:90187946d1a4 | 1810:3c43b07e12b7 |
|---|---|
| 27 content = null; | 27 content = null; |
| 28 } | 28 } |
| 29 | 29 |
| 30 public void setContent(String content) { | 30 public void setContent(String content) { |
| 31 if( content == null ) | 31 if( content == null ) |
| 32 throw new IllegalArgumentException("content can't be null"); | 32 throw new IllegalArgumentException("content of '"+name+"' can't be null"); |
| 33 this.content = content; | 33 this.content = content; |
| 34 } | 34 } |
| 35 | 35 |
| 36 public void setContent(XmlElement[] content) { | 36 public void setContent(XmlElement[] content) { |
| 37 if( content == null ) | 37 if( content == null ) |
| 38 throw new IllegalArgumentException("content can't be null"); | 38 throw new IllegalArgumentException("content of '"+name+"' can't be null"); |
| 39 if( content.length == 0 ) | 39 if( content.length == 0 ) |
| 40 throw new IllegalArgumentException("content can't be empty"); | 40 throw new IllegalArgumentException("content of '"+name+"' can't be empty"); |
| 41 this.content = content; | 41 this.content = content; |
| 42 for( XmlElement el : content ) { | 42 for( XmlElement el : content ) { |
| 43 el.parent = this; | 43 el.parent = this; |
| 44 } | 44 } |
| 45 } | 45 } |
