use of com.xenoage.utils.annotations.NonNull in project Zong by Xenoage.
the class MxlPageMargins method read.
@NonNull
public static MxlPageMargins read(XmlReader reader) {
// read attributes first, before moving forward to child elements
MxlMarginType type = MxlMarginType.read(reader);
// read child elements
MxlAllMargins value = MxlAllMargins.read(reader);
return new MxlPageMargins(value, type);
}
use of com.xenoage.utils.annotations.NonNull in project Zong by Xenoage.
the class MxlPartGroup method read.
@NonNull
public static MxlPartGroup read(XmlReader reader) {
// attributes
MxlStartStop type = MxlStartStop.read(reader.getAttributeNotNull("type"));
String number = notNull(reader.getAttribute("number"), defaultNumber);
// elements
String groupName = null;
String groupAbbreviation = null;
MxlGroupSymbol groupSymbol = null;
MxlGroupBarline groupBarline = null;
while (reader.openNextChildElement()) {
String n = reader.getElementName();
switch(n) {
case "group-name":
groupName = reader.getTextNotNull();
break;
case "group-abbreviation":
groupAbbreviation = reader.getTextNotNull();
break;
case "group-symbol":
groupSymbol = MxlGroupSymbol.read(reader);
break;
case "group-barline":
groupBarline = MxlGroupBarline.read(reader);
break;
}
reader.closeElement();
}
return new MxlPartGroup(groupName, groupAbbreviation, groupSymbol, groupBarline, type, number);
}
use of com.xenoage.utils.annotations.NonNull in project Zong by Xenoage.
the class MxlCredit method read.
@NonNull
public static MxlCredit read(XmlReader reader) {
int page = notNull(reader.getAttributeInt("page"), defaultPage);
MxlCreditContent content = null;
while (reader.openNextChildElement()) {
String n = reader.getElementName();
if (n.equals("credit-image")) {
content = MxlImage.read(reader);
reader.closeElement();
break;
} else if (n.equals(MxlCreditWords.elemName)) {
content = MxlCreditWords.read(reader);
// element is already closed at this point
break;
}
reader.closeElement();
}
if (content == null)
throw reader.dataException("empty " + elemName);
return new MxlCredit(content, page);
}
use of com.xenoage.utils.annotations.NonNull in project Zong by Xenoage.
the class MxlScorePartwise method read.
@NonNull
public static MxlScorePartwise read(XmlReader reader, ErrorHandler errorHandler) {
// attributes
String version = notNull(reader.getAttribute("version"), defaultVersion);
// elements
MxlScoreHeader scoreHeader = new MxlScoreHeader();
List<MxlPart> parts = alist();
while (reader.openNextChildElement()) {
if (reader.getElementName().equals(MxlPart.elemName))
parts.add(MxlPart.read(reader));
else
scoreHeader.readElement(reader, errorHandler);
reader.closeElement();
}
scoreHeader.check(reader);
if (parts.size() < 1)
throw reader.dataException("no parts found");
return new MxlScorePartwise(scoreHeader, parts, version);
}
use of com.xenoage.utils.annotations.NonNull in project Zong by Xenoage.
the class ScoreFormatReader method read.
@NonNull
public ScoreFormat read() {
scoreFormat = new ScoreFormat();
if (mxlDefaults != null) {
readInterlineSpace();
mxlLayout = mxlDefaults.getLayout();
if (mxlLayout != null) {
readSystemLayout();
readStaffLayouts();
}
readLyricsFont();
}
return scoreFormat;
}
Aggregations