001package io.ebeanservice.docstore.api.mapping; 002 003import io.ebeaninternal.server.text.json.PathStack; 004 005/** 006 * Adapter for DocPropertyVisitor that does not do anything. 007 * Used to extend and implement only the desired methods. 008 */ 009public abstract class DocPropertyAdapter implements DocPropertyVisitor { 010 011 protected PathStack pathStack = new PathStack(); 012 013 @Override 014 public void visitProperty(DocPropertyMapping property) { 015 // do nothing 016 } 017 018 @Override 019 public void visitBegin() { 020 // do nothing 021 } 022 023 @Override 024 public void visitEnd() { 025 // do nothing 026 } 027 028 @Override 029 public void visitBeginObject(DocPropertyMapping property) { 030 pathStack.push(property.getName()); 031 } 032 033 @Override 034 public void visitEndObject(DocPropertyMapping property) { 035 pathStack.pop(); 036 } 037 038 @Override 039 public void visitBeginList(DocPropertyMapping property) { 040 pathStack.push(property.getName()); 041 } 042 043 @Override 044 public void visitEndList(DocPropertyMapping property) { 045 pathStack.pop(); 046 } 047}