public static CollisionCategory imports(Xml root, MapTileCollision map)
    {
        Check.notNull(root);
        Check.notNull(map);

        final Collection<Xml> children = root.getChildren(TileGroupsConfig.NODE_GROUP);
        final Collection<CollisionGroup> groups = new ArrayList<>(children.size());

        for (final Xml groupNode : children)
        {
            final String groupName = groupNode.getText();
            final CollisionGroup group = map.getCollisionGroup(groupName);
            groups.add(group);
        }

        final String axisName = root.readString(ATT_AXIS);
        final Axis axis;
        try
        {
            axis = Axis.valueOf(axisName);
        }
        catch (final IllegalArgumentException exception)
        {
            throw new LionEngineException(exception, ERROR_AXIS + axisName);
        }

        final int x = root.readInteger(ATT_X);
        final int y = root.readInteger(ATT_Y);
        final boolean glue = root.readBoolean(true, ATT_GLUE);
        final String name = root.readString(ATT_NAME);

        return new CollisionCategory(name, axis, x, y, glue, groups);
    }
public static CollisionCategory imports ( Xml root , MapTileCollision map ) { Check . notNull ( root ) ; Check . notNull ( map ) ; final Collection < Xml > children = root . getChildren ( TileGroupsConfig . NODE_GROUP ) ; final Collection < CollisionGroup > groups = new ArrayList < > ( children . size ( ) ) ; for ( final Xml groupNode : children ) { final String groupName = groupNode . getText ( ) ; final CollisionGroup group = map . getCollisionGroup ( groupName ) ; groups . add ( group ) ; } final String axisName = root . readString ( ATT_AXIS ) ; final Axis axis ; try { axis = Axis . valueOf ( axisName ) ; } catch ( final IllegalArgumentException exception ) { throw new LionEngineException ( exception , ERROR_AXIS + axisName ) ; } final int x = root . readInteger ( ATT_X ) ; final int y = root . readInteger ( ATT_Y ) ; final boolean glue = root . readBoolean ( true , ATT_GLUE ) ; final String name = root . readString ( ATT_NAME ) ; return new CollisionCategory ( name , axis , x , y , glue , groups ) ; }
Create the category data from node.

@param root The root reference (must not be <code>null</code>).
@param map The map reference (must not be <code>null</code>).
@return The category node instance.
@throws LionEngineException If unable to read node.