@Override
    @SuppressWarnings("unchecked")
    public void read(JmeImporter im) throws IOException {
        InputCapsule ic = im.getCapsule(this);

        name = ic.readString("name", null);
        worldBound = (BoundingVolume) ic.readSavable("world_bound", null);
        cullHint = ic.readEnum("cull_mode", CullHint.class, CullHint.Inherit);
        batchHint = ic.readEnum("batch_hint", BatchHint.class, BatchHint.Inherit);
        queueBucket = ic.readEnum("queue", RenderQueue.Bucket.class,
                RenderQueue.Bucket.Inherit);
        shadowMode = ic.readEnum("shadow_mode", ShadowMode.class,
                ShadowMode.Inherit);

        localTransform = (Transform) ic.readSavable("transform", Transform.IDENTITY);

        localLights = (LightList) ic.readSavable("lights", null);
        localLights.setOwner(this);

        ArrayList<MatParamOverride> localOverridesList = ic.readSavableArrayList("overrides", null);
        if (localOverridesList == null) {
            localOverrides = new SafeArrayList<>(MatParamOverride.class);
        } else {
            localOverrides = new SafeArrayList(MatParamOverride.class, localOverridesList);
        }
        worldOverrides = new SafeArrayList<>(MatParamOverride.class);

        //changed for backward compatibility with j3o files
        //generated before the AnimControl/SkeletonControl split
        //the AnimControl creates the SkeletonControl for old files and add it to the spatial.
        // The SkeletonControl must be the last in the stack,
        // so we add the list of all other controls before it.
        //When backward compatibility won't be needed anymore this can be replaced by :
        //controls = ic.readSavableArrayList("controlsList", null));
        controls.addAll(0, ic.readSavableArrayList("controlsList", null));

        userData = (HashMap<String, Savable>) ic.readStringSavableMap("user_data", null);
    }
Note that we are <i>matching</i> the pattern, therefore the pattern
must match the entire pattern (i.e. it behaves as if it is sandwiched
between "^" and "$").
You can set regex modes, like case insensitivity, by using the (?X)
or (?X:Y) constructs.

@param spatialSubclass Subclass which this must implement.
                       Null causes all Spatials to qualify.
@param nameRegex  Regular expression to match this name against.
                       Null causes all Names to qualify.
@return true if this implements the specified class and this's name
        matches the specified pattern.

@see java.util.regex.Pattern
jme3-core/src/main/java/com/jme3/scene/Spatial.java