nginx-java-parser icon indicating copy to clipboard operation
nginx-java-parser copied to clipboard

I have a new method to submit

Open mujianfenghe opened this issue 3 years ago • 0 comments

##in NgxBlock Class ,I have a new method to submit

public void getAllElementByBlock(NgxBlock ngxBlock,StringBuilder stringBuilder){
    <NgxEntry> iterator = ngxBlock.iterator();
    while(iterator.hasNext()){
        NgxEntry ngxEntry = iterator.next();
        if(ngxEntry instanceof NgxBlock){
            NgxBlock block = (NgxBlock) ngxEntry;
            stringBuilder.append(block.getName()+" " +block.getValue()+"}");
            getAllElementByBlock(block,stringBuilder);
            stringBuilder.append(“}”);
        }else if(ngxEntry instanceof NgxParam){
            NgxParam ngxParam = (NgxParam) ngxEntry;
            stringBuilder.append(ngxParam.getName+" "+ngxParam.getValue()+";");
        }
    }
}

mujianfenghe avatar Jan 20 '22 03:01 mujianfenghe