private AccessibleObject getAccessor() { return this._traversedAsso == null ? this._traversedManyAsso.accessor() : this._traversedAsso.accessor(); }
private TraversedAssoOrManyAssoRef( ManyAssociationFunction<?> func ) { this( func.traversedAssociation(), func.traversedManyAssociation() ); }
@Override public boolean test( Composite item ) { ManyAssociation<T> collection = manyAssociationFunction.apply( item ); if( collection == null ) { return false; } return collection.contains( value ); }
public Triple addTripleManyAssociation( final ManyAssociationFunction<?> manyAssociationReference, final boolean optional ) { AssociationFunction<?> traversedAssociation = manyAssociationReference.traversedAssociation(); String subject = "?entity"; if( traversedAssociation != null ) { subject = addTripleAssociation( traversedAssociation, false ).value; } QualifiedName qualifiedName = QualifiedName.fromAccessor( manyAssociationReference.accessor() ); String predicatePrefix = addNamespace( qualifiedName.toNamespace() ); String predicate = predicatePrefix + ":" + qualifiedName.name(); Triple collectionTriple = addTriple( subject, predicate, optional ); String liSubject = collectionTriple.value; return addTriple( liSubject, "rdf:li", false ); }
method.getReturnType().getClassLoader(), array( method.getReturnType() ), new ManyAssociationReferenceHandler<>( new ManyAssociationFunction<T>( compositeAssociation, compositeManyAssociation, compositeNamedAssociation,
private void processManyAssociationContainsSpecification( BoolQueryBuilder queryBuilder, ManyAssociationContainsPredicate<?> spec, Map<String, Object> variables ) { LOGGER.trace( "Processing ManyAssociationContainsSpecification {}", spec ); String name = spec.manyAssociation().toString() + ".identity"; Object value = resolveVariable( spec.value(), variables ); queryBuilder.must( termQuery( name, value ) ); }
public Triple addTripleManyAssociation( final ManyAssociationFunction<?> manyAssociationReference, final boolean optional ) { AssociationFunction<?> traversedAssociation = manyAssociationReference.traversedAssociation(); String subject = "?entity"; if( traversedAssociation != null ) { subject = addTripleAssociation( traversedAssociation, false ).value; } QualifiedName qualifiedName = QualifiedName.fromAccessor( manyAssociationReference.accessor() ); String predicatePrefix = addNamespace( qualifiedName.toNamespace() ); String predicate = predicatePrefix + ":" + qualifiedName.name(); Triple collectionTriple = addTriple( subject, predicate, optional ); String liSubject = collectionTriple.value; return addTriple( liSubject, "rdf:li", false ); }
method.getReturnType().getClassLoader(), array( method.getReturnType() ), new ManyAssociationReferenceHandler<>( new ManyAssociationFunction<T>( compositeAssociation, compositeManyAssociation, compositeNamedAssociation,
@Override public Object invoke( Object o, final Method method, Object[] objects ) throws Throwable { if( method.equals( ManyAssociation.class.getMethod( "get", Integer.TYPE ) ) ) { Type manyAssociationType = GenericAssociationInfo.associationTypeOf( manyAssociation.accessor() ); if( manyAssociationType.getClass().equals( Class.class ) ) { return Proxy.newProxyInstance( method.getDeclaringClass().getClassLoader(), array( (Class) manyAssociationType, PropertyReference.class ), new TemplateHandler<T>( null, null, manyAssociation, null ) ); } } return null; } }
Proxy.newProxyInstance( field.getType().getClassLoader(), array( field.getType() ), new ManyAssociationReferenceHandler<>( new ManyAssociationFunction<T>( null, null, null, field ) ) ) );
@Override public boolean test( Composite item ) { ManyAssociation<T> collection = manyAssociationFunction.apply( item ); if( collection == null ) { return false; } return collection.contains( value ); }
@Override public Object invoke( Object o, final Method method, Object[] objects ) throws Throwable { if( method.equals( ManyAssociation.class.getMethod( "get", Integer.TYPE ) ) ) { Type manyAssociationType = GenericAssociationInfo.associationTypeOf( manyAssociation.accessor() ); if( manyAssociationType.getClass().equals( Class.class ) ) { return Proxy.newProxyInstance( method.getDeclaringClass().getClassLoader(), array( (Class) manyAssociationType, PropertyReference.class ), new TemplateHandler<T>( null, null, manyAssociation, null ) ); } } return null; } }
Proxy.newProxyInstance( field.getType().getClassLoader(), array( field.getType() ), new ManyAssociationReferenceHandler<>( new ManyAssociationFunction<T>( null, null, null, field ) ) ) );