else if ( nodeName.equals ( INCLUDE_NODE ) )
{
// Reading included file information
final String nearClass = reader.getAttribute ( NEAR_CLASS_ATTRIBUTE );
final String file = reader.getValue ();
includes.add ( new ResourceFile ( ResourceLocation.nearClass, file, nearClass ) );
}
reader.moveUp ();
}
// Reading all additional included files
// This operation performed in the end when all required information is read from XML
for ( int i = 0; i < includes.size (); i++ )
{
final ResourceFile resourceFile = includes.get ( i );
// Replacing null relative class with skin class
if ( resourceFile.getClassName () == null )
{
final String skinClass = skinInfo.getSkinClass ();
if ( skinClass == null )
{
throw new StyleException (
"Included skin file \"" + resourceFile.getSource () + "\" specified but skin \"class\" property is not set!" );
}
resourceFile.setClassName ( skinClass );
}
// Reading skin part from included file
final SkinInfo include = loadSkinInfo ( resourceFile );
if ( include == null )
{
throw new StyleException ( "Included skin file \"" + resourceFile.getSource () + "\" cannot be read!" );
}
// Adding information from included file
// Included styles order is preserved to preserve styles override order
styles.addAll ( i, include.getStyles () );