Examples of FieldBridge


Examples of org.hibernate.search.bridge.FieldBridge

    if ( PropertiesMetadata.Container.OBJECT == container ) {
      return new NullEncodingFieldBridge( NULL_EMBEDDED_STRING_BRIDGE, indexNullAs );
    }
    else {
      NumericField numericField = member.getAnnotation( NumericField.class );
      FieldBridge fieldBridge = BridgeFactory.guessType( null, numericField, member, reflectionManager );
      if ( fieldBridge instanceof StringBridge ) {
        fieldBridge = new NullEncodingFieldBridge( (StringBridge) fieldBridge, indexNullAs );
      }
      return fieldBridge;
    }
View Full Code Here

Examples of org.hibernate.search.bridge.FieldBridge

    propertiesMetadata.classNames.add( fieldName );
    propertiesMetadata.classStores.add( ann.store() );
    Field.Index index = AnnotationProcessingHelper.getIndex( Index.YES, Analyze.NO, Norms.NO );
    propertiesMetadata.classIndexes.add( index );
    propertiesMetadata.classTermVectors.add( AnnotationProcessingHelper.getTermVector( TermVector.NO ) );
    final FieldBridge spatialBridge;
    if ( reflectionManager.toXClass( Coordinates.class ).isAssignableFrom( clazz ) ) {
      spatialBridge = BridgeFactory.buildSpatialBridge( ann, clazz, null, null );
    }
    else {
View Full Code Here

Examples of org.hibernate.search.bridge.FieldBridge

   * @param cb the class bridge annotation
   * @param clazz the {@code XClass} on which the annotation is defined on
   * @return Returns the specified {@code FieldBridge} instance
   */
  public static FieldBridge extractType(ClassBridge cb, XClass clazz) {
    FieldBridge bridge = null;

    if ( cb != null ) {
      Class<?> impl = cb.impl();
      if ( impl != null ) {
        try {
View Full Code Here

Examples of org.hibernate.search.bridge.FieldBridge

   * @return Returns the {@code SpatialFieldBridge} instance
   * @param latitudeField a {@link java.lang.String} object.
   * @param longitudeField a {@link java.lang.String} object.
   */
  public static FieldBridge buildSpatialBridge(Spatial spatial, XClass clazz, String latitudeField, String longitudeField) {
    FieldBridge bridge;
    try {
      bridge = buildSpatialBridge( spatial, latitudeField, longitudeField );
    }
    catch ( Exception e ) {
      throw LOG.unableToInstantiateSpatial( clazz.getName(), e );
View Full Code Here

Examples of org.hibernate.search.bridge.FieldBridge

   * @param spatial the {@code Spatial} annotation
   * @param member the {@code XMember} on which the annotation is defined on
   * @return Returns the {@code SpatialFieldBridge} instance
   */
  public static FieldBridge buildSpatialBridge(Spatial spatial, XMember member) {
    FieldBridge bridge;
    try {
      bridge = buildSpatialBridge( spatial, null, null );
    }
    catch ( Exception e ) {
      throw LOG.unableToInstantiateSpatial( member.getName(), e );
View Full Code Here

Examples of org.hibernate.search.bridge.FieldBridge

   * @return Returns the {@code SpatialFieldBridge} instance
   * @param latitudeField a {@link java.lang.String} object.
   * @param longitudeField a {@link java.lang.String} object.
   */
  public static FieldBridge buildSpatialBridge(Spatial spatial, String latitudeField, String longitudeField) {
    FieldBridge bridge = null;
    if ( spatial != null ) {
      if ( spatial.spatialMode() == SpatialMode.GRID ) {
        if ( latitudeField != null && longitudeField != null ) {
          bridge = new SpatialFieldBridgeByQuadTree( spatial.topQuadTreeLevel(), spatial.bottomQuadTreeLevel(), latitudeField, longitudeField );
        }
View Full Code Here

Examples of org.hibernate.search.bridge.FieldBridge

    return bridge;
  }

  public static FieldBridge guessType(Field field, NumericField numericField, XMember member, ReflectionManager reflectionManager) {
    FieldBridge bridge;
    org.hibernate.search.annotations.FieldBridge bridgeAnn;
    //@Field bridge has priority over @FieldBridge
    if ( field != null && void.class != field.bridge().impl() ) {
      bridgeAnn = field.bridge();
    }
View Full Code Here

Examples of org.hibernate.search.bridge.FieldBridge

    return bridge;
  }

  private static FieldBridge createTikaBridge(org.hibernate.search.annotations.TikaBridge annotation) {
    Class<?> tikaBridgeClass;
    FieldBridge tikaBridge;
    try {
      tikaBridgeClass = ClassLoaderHelper.classForName( TIKA_BRIDGE_NAME, BridgeFactory.class.getClassLoader() );
      tikaBridge = ClassLoaderHelper.instanceFromClass( FieldBridge.class, tikaBridgeClass, "Tika bridge" );
    }
    catch ( ClassNotFoundException e ) {
View Full Code Here

Examples of org.hibernate.search.bridge.FieldBridge

  private static FieldBridge doExtractType(
      org.hibernate.search.annotations.FieldBridge bridgeAnn,
      String appliedOnName,
      Class<?> appliedOnType) {
    assert bridgeAnn != null : "@FieldBridge instance cannot be null";
    FieldBridge bridge;
    Class impl = bridgeAnn.impl();
    if ( impl == void.class ) {
      throw LOG.noImplementationClassInFieldBridge( appliedOnName );
    }
    try {
View Full Code Here

Examples of org.hibernate.search.bridge.FieldBridge

   * @throws SearchException if the FieldBridge passed in is not an instance of a TwoWayFieldBridge.
   */
  public static TwoWayFieldBridge extractTwoWayType(org.hibernate.search.annotations.FieldBridge fieldBridge,
                            XClass appliedOnType,
                            ReflectionManager reflectionManager) {
    FieldBridge fb = extractType( fieldBridge, appliedOnType, reflectionManager );
    if ( fb instanceof TwoWayFieldBridge ) {
      return (TwoWayFieldBridge) fb;
    }
    else {
      throw LOG.fieldBridgeNotAnInstanceof( TwoWayFieldBridge.class.getSimpleName() );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.