StructPropertyWalker.java 2.18 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  org.kohsuke.rngom.rngparser.digested.DElementPattern
 *  org.kohsuke.rngom.rngparser.digested.DInterleavePattern
 *  org.kohsuke.rngom.rngparser.digested.DPattern
 *  org.kohsuke.rngom.rngparser.digested.DPatternVisitor
 *  org.kohsuke.rngom.rngparser.digested.DUnaryPattern
 */
package com.adobe.xmp.schema.rng.parser.traverser;

import com.adobe.xmp.schema.rng.model.Context;
import com.adobe.xmp.schema.rng.model.PropertyInfo;
import com.adobe.xmp.schema.rng.parser.traverser.BasePatternWalker;
import com.adobe.xmp.schema.rng.parser.traverser.PropertyWithQualifierWalker;
import org.kohsuke.rngom.rngparser.digested.DElementPattern;
import org.kohsuke.rngom.rngparser.digested.DInterleavePattern;
import org.kohsuke.rngom.rngparser.digested.DPattern;
import org.kohsuke.rngom.rngparser.digested.DPatternVisitor;
import org.kohsuke.rngom.rngparser.digested.DUnaryPattern;

class StructPropertyWalker
extends BasePatternWalker {
    StructPropertyWalker(PropertyInfo propertyInfo, Context context) {
        this.relativeDepth = -1;
        this.propertyInfo = propertyInfo;
        this.context = context;
    }

    public Void onElement(DElementPattern p) {
        super.handleAnnotation((DPattern)p, this.context, this.propertyInfo);
        Integer n = this.relativeDepth;
        Integer n2 = this.relativeDepth = Integer.valueOf(this.relativeDepth + 1);
        DPattern child = this.getChild((DUnaryPattern)p);
        if (child instanceof DInterleavePattern) {
            DInterleavePattern iChild = (DInterleavePattern)child;
            for (DPattern c = iChild.firstChild(); c != null; c = c.getNext()) {
                PropertyWithQualifierWalker structWalker = new PropertyWithQualifierWalker(this.context);
                c.accept((DPatternVisitor)structWalker);
                this.propertyInfo.addChild(structWalker.getPropInfo());
            }
        } else {
            PropertyWithQualifierWalker structWalker = new PropertyWithQualifierWalker(this.context);
            child.accept((DPatternVisitor)structWalker);
            this.propertyInfo.addChild(structWalker.getPropInfo());
        }
        return null;
    }
}