/** * Method updateRepositoryBase * * @param value * @param element * @param counter * @param xmlTag */ protected void updateRepositoryBase( RepositoryBase value, String xmlTag, Counter counter, Element element ) { boolean shouldExist = value != null; Element root = updateElement( counter, element, xmlTag, shouldExist ); if ( shouldExist ) { Counter innerCount = new Counter( counter.getDepth() + 1 ); findAndReplaceSimpleElement( innerCount, root, "id", value.getId(), null ); findAndReplaceSimpleElement( innerCount, root, "name", value.getName(), null ); findAndReplaceSimpleElement( innerCount, root, "url", value.getUrl(), null ); findAndReplaceSimpleElement( innerCount, root, "layout", value.getLayout(), "default" ); } }
protected void mergeRepositoryBase( RepositoryBase target, RepositoryBase source, boolean sourceDominant, Map<Object, Object> context ) { mergeRepositoryBase_Id( target, source, sourceDominant, context ); mergeRepositoryBase_Name( target, source, sourceDominant, context ); mergeRepositoryBase_Url( target, source, sourceDominant, context ); mergeRepositoryBase_Layout( target, source, sourceDominant, context ); }
protected void mergeRepositoryBase_Id( RepositoryBase target, RepositoryBase source, boolean sourceDominant, Map<Object, Object> context ) { String src = source.getId(); if ( src != null ) { if ( sourceDominant || target.getId() == null ) { target.setId( src ); target.setLocation( "id", source.getLocation( "id" ) ); } } }
protected void mergeRepositoryBase_Url( RepositoryBase target, RepositoryBase source, boolean sourceDominant, Map<Object, Object> context ) { String src = source.getUrl(); if ( src != null ) { if ( sourceDominant || target.getUrl() == null ) { target.setUrl( src ); target.setLocation( "url", source.getLocation( "url" ) ); } } }
protected void mergeRepositoryBase_Name( RepositoryBase target, RepositoryBase source, boolean sourceDominant, Map<Object, Object> context ) { String src = source.getName(); if ( src != null ) { if ( sourceDominant || target.getName() == null ) { target.setName( src ); target.setLocation( "name", source.getLocation( "name" ) ); } } }
protected void mergeRepositoryBase_Layout( RepositoryBase target, RepositoryBase source, boolean sourceDominant, Map<Object, Object> context ) { String src = source.getLayout(); if ( src != null ) { if ( sourceDominant || target.getLayout() == null ) { target.setLayout( src ); target.setLocation( "layout", source.getLocation( "layout" ) ); } } }
protected Object getRepositoryBaseKey( RepositoryBase object ) { return object; }
@Override protected Object getRepositoryBaseKey( RepositoryBase object ) { return object.getId(); }