@Test @SuppressWarnings("unchecked") public void getNameFromField() { when(graphMockHandler.getPropertyAdapter().getValue(domainObject.getNameProperty())).thenReturn("nameValue"); final String name = tested.getName(domainObject); assertEquals("nameValue", name); }
public <T> String getName(final T definition) { final DefinitionAdapter<Object> definitionAdapter = definitionManager.adapters().registry().getDefinitionAdapter(definition.getClass()); final String nameField = definitionAdapter.getMetaPropertyField(definition, PropertyMetaTypes.NAME); if (null != nameField) { Object name = definitionAdapter.getProperty(definition, nameField).get(); return getPropertyValueAsString(name); } return null; }
DefinitionUtils { public <T> String getName(final T definition) { final DefinitionAdapter<Object> definitionAdapter = definitionManager.adapters().registry().getDefinitionAdapter(definition.getClass()); final String nameField = definitionAdapter.getMetaPropertyField(definition, PropertyMetaTypes.NAME); if (null != nameField) { Object name = definitionAdapter.getProperty(definition, nameField).get(); return getPropertyValueAsString(name); } return null; } }
DefinitionUtils { public <T> String getName(final T definition) { final DefinitionAdapter<Object> definitionAdapter = definitionManager.adapters().registry().getDefinitionAdapter(definition.getClass()); final String nameField = definitionAdapter.getMetaPropertyField(definition, PropertyMetaTypes.NAME); if (null != nameField) { Object name = definitionAdapter.getProperty(definition, nameField).get(); return getPropertyValueAsString(name); } return null; } protected  DefinitionUtils(); @Inject @SuppressWarnings("all")  DefinitionUtils(final DefinitionManager definitionManager,
                           final DefinitionsCacheRegistry definitionsRegistry); }
DefinitionUtils { public <T> String getName(final T definition) { final DefinitionAdapter<Object> definitionAdapter = definitionManager.adapters().registry().getDefinitionAdapter(definition.getClass()); final String nameField = definitionAdapter.getMetaPropertyField(definition, PropertyMetaTypes.NAME); if (null != nameField) { Object name = definitionAdapter.getProperty(definition, nameField).get(); return getPropertyValueAsString(name); } return null; } protected  DefinitionUtils(); @Inject @SuppressWarnings("all")  DefinitionUtils(final DefinitionManager definitionManager,
                           final DefinitionsCacheRegistry definitionsRegistry); String getName(final T definition); String getNameIdentifier(final T definition); String getTitle(final String definitionId); @SuppressWarnings("unchecked") Bounds buildBounds(final Object definition,
                              final double x,
                              final double y); MorphDefinition getMorphDefinition(final T definition); boolean hasMorphTargets(final Object definition); String getDefinitionSetId(final Class<?> type); String[] getDefinitionIds(final T definition); boolean isAllPolicy(final MorphDefinition definition); boolean isNonePolicy(final MorphDefinition definition); boolean isDefaultPolicy(final MorphDefinition definition); Annotation getQualifier(final String defSetId); static boolean isNodeFactory(final Class<? extends ElementFactory> graphFactoryClass,
                                        final FactoryRegistry registry); static boolean isEdgeFactory(final Class<? extends ElementFactory> graphFactoryClass,
                                        final FactoryRegistry registry); DefinitionManager getDefinitionManager(); static Class<? extends PropertyType> getDefaultPropertyType(final Class<?> clazz); static Object getElementDefinition(final Element element); }
DefinitionUtils { public <T> String getName(final T definition) { final DefinitionAdapter<Object> definitionAdapter = definitionManager.adapters().registry().getDefinitionAdapter(definition.getClass()); final String nameField = definitionAdapter.getMetaPropertyField(definition, PropertyMetaTypes.NAME); if (null != nameField) { Object name = definitionAdapter.getProperty(definition, nameField).get(); return getPropertyValueAsString(name); } return null; } protected  DefinitionUtils(); @Inject @SuppressWarnings("all")  DefinitionUtils(final DefinitionManager definitionManager,
                           final DefinitionsCacheRegistry definitionsRegistry); String getName(final T definition); String getNameIdentifier(final T definition); String getTitle(final String definitionId); @SuppressWarnings("unchecked") Bounds buildBounds(final Object definition,
                              final double x,
                              final double y); MorphDefinition getMorphDefinition(final T definition); boolean hasMorphTargets(final Object definition); String getDefinitionSetId(final Class<?> type); String[] getDefinitionIds(final T definition); boolean isAllPolicy(final MorphDefinition definition); boolean isNonePolicy(final MorphDefinition definition); boolean isDefaultPolicy(final MorphDefinition definition); Annotation getQualifier(final String defSetId); static boolean isNodeFactory(final Class<? extends ElementFactory> graphFactoryClass,
                                        final FactoryRegistry registry); static boolean isEdgeFactory(final Class<? extends ElementFactory> graphFactoryClass,
                                        final FactoryRegistry registry); DefinitionManager getDefinitionManager(); static Class<? extends PropertyType> getDefaultPropertyType(final Class<?> clazz); static Object getElementDefinition(final Element element);  }