/* * This code is distributed under The GNU Lesser General Public License (LGPLv3) * Please visit GNU site for LGPLv3 http://www.gnu.org/copyleft/lesser.html * * Copyright Denis Pavlov 2009 * Web: http://www.genericdtoassembler.org * SVN: https://svn.code.sf.net/p/geda-genericdto/code/trunk/ * SVN (mirror): http://geda-genericdto.googlecode.com/svn/trunk/ */ package com.inspiresoftware.lib.dto.geda.assembler.annotations.impl; import com.inspiresoftware.lib.dto.geda.annotations.Dto; import com.inspiresoftware.lib.dto.geda.assembler.annotations.AnnotationProxy; import com.inspiresoftware.lib.dto.geda.exception.GeDARuntimeException; /** * Dto wrapper. * * @since 3.0.0 * * User: denispavlov * Date: 13-02-21 * Time: 1:13 PM */ public class LocalClassLoaderDtoAnnotationProxy implements AnnotationProxy { private final Dto annotation; public LocalClassLoaderDtoAnnotationProxy(final Dto annotation) { this.annotation = annotation; } /** {@inheritDoc} */ public boolean annotationExists() { return true; } /** {@inheritDoc} */ public <T> T getValue(final String property) { if ("value".equals(property)) { return (T) annotation.value(); } throw new GeDARuntimeException("Invalid @Dto annotation proxy access via property: " + property); } }