private static ObjectSpecification owningSpecFor( final OneToOneAssociation property, final IsisSessionFactory isisSessionFactory) { final SpecificationLoader specificationLoader = isisSessionFactory.getSpecificationLoader(); return specificationLoader.loadSpecification(property.getIdentifier().toClassIdentityString()); }
private static ObjectSpecification owningSpecFor( final OneToOneAssociation property, final IsisSessionFactory isisSessionFactory) { final SpecificationLoader specificationLoader = isisSessionFactory.getSpecificationLoader(); return specificationLoader.loadSpecification(property.getIdentifier().toClassIdentityString()); }
private static ObjectSpecification owningSpecFor(final OneToOneAssociation association) { return IsisContext.getSpecificationLoader().loadSpecification(association.getIdentifier().toClassIdentityString()); }
public PropertyMemento( final OneToOneAssociation property, final IsisSessionFactory isisSessionFactory) { this( owningSpecFor(property, isisSessionFactory).getSpecId(), property.getIdentifier().toNameIdentityString(), property.getSpecification().getSpecId() ); }
public PropertyMemento( final OneToOneAssociation property, final IsisSessionFactory isisSessionFactory) { this( owningSpecFor(property, isisSessionFactory).getSpecId(), property.getIdentifier().toNameIdentityString(), property.getSpecification().getSpecId() ); }
public PropertyMemento(final OneToOneAssociation property) { this(new SpecMemento(owningSpecFor(property)), property.getIdentifier().toNameIdentityString(), new SpecMemento(property.getSpecification())); this.property = property; }
@Override @Programmatic public PropertyEditDto asPropertyEditDto( final OneToOneAssociation property, final ObjectAdapter targetAdapter, final ObjectAdapter newValueAdapterIfAny) { final Interaction interaction = interactionContext.getInteraction(); final int nextEventSequence = interaction.next(Interaction.Sequence.INTERACTION.id()); final Object targetPojo = targetAdapter.getObject(); final Bookmark targetBookmark = bookmarkService.bookmarkFor(targetPojo); final String propertyIdentifier = property.getIdentifier().toClassAndNameIdentityString(); final String propertyId = propertyIdentifier.substring(propertyIdentifier.indexOf('#')+1); final String targetTitle = targetBookmark.toString() + ": " + propertyId; final String currentUser = userService.getUser().getName(); final PropertyDto propertyDto = new PropertyDto(); commandDtoServiceInternal.addPropertyValue(property, propertyDto, newValueAdapterIfAny); final ValueWithTypeDto newValue = propertyDto.getNewValue(); return InteractionDtoUtils.newPropertyEdit( nextEventSequence, targetBookmark, targetTitle, propertyDto.getMemberIdentifier(), newValue, currentUser ); }
private Object handleGetterMethodOnProperty( final ObjectAdapter targetAdapter, final Object[] args, final OneToOneAssociation property) { if (args.length != 0) { throw new IllegalArgumentException("Invoking a 'get' should have no arguments"); } if(getExecutionMode().shouldEnforceRules()) { if(getExecutionMode().shouldFailFast()) { checkVisibility(targetAdapter, property); } else { try { checkVisibility(targetAdapter, property); } catch(Exception ex) { return null; } } } resolveIfRequired(targetAdapter); final InteractionInitiatedBy interactionInitiatedBy = getInteractionInitiatedBy(); final ObjectAdapter currentReferencedAdapter = property.get(targetAdapter, interactionInitiatedBy); final Object currentReferencedObj = ObjectAdapter.Util.unwrap(currentReferencedAdapter); final PropertyAccessEvent ev = new PropertyAccessEvent(getDelegate(), property.getIdentifier(), currentReferencedObj); notifyListeners(ev); return currentReferencedObj; }
@Override public void addPropertyValue( final OneToOneAssociation property, final PropertyDto propertyDto, final ObjectAdapter valueAdapter) { final String actionIdentifier = CommandUtil.memberIdentifierFor(property); final ObjectSpecification onType = property.getOnType(); final String objectType = onType.getSpecId().asString(); final String localId = property.getIdentifier().toNameIdentityString(); propertyDto.setLogicalMemberIdentifier(objectType + "#" + localId); propertyDto.setMemberIdentifier(actionIdentifier); final ObjectSpecification valueSpec = property.getSpecification(); final Class<?> valueType = valueSpec.getCorrespondingClass(); final ValueWithTypeDto newValue = CommonDtoUtils.newValueWithTypeDto( valueType, ObjectAdapter.Util.unwrap(valueAdapter), bookmarkService); propertyDto.setNewValue(newValue); }
will(returnValue(passwordValue)); allowing(mockPasswordMember).getIdentifier(); will(returnValue(mockPasswordIdentifier));
will(returnValue(passwordValue)); allowing(mockPasswordMember).getIdentifier(); will(returnValue(mockPasswordIdentifier));