Package org.apache.stanbol.entityhub.servicesapi.defaults

Examples of org.apache.stanbol.entityhub.servicesapi.defaults.SpecialFieldEnum


        if (indexField == null) {
            throw new IllegalArgumentException("The parsed IndexField name MUST NOT be NULL!");
        }
        Collection<String> fieldNames = indexFieldMappings.get(indexField);
        if (fieldNames == null) {
            SpecialFieldEnum specialField = indexField.getSpecialField();//check for special field;
            if(specialField != null){
                switch (specialField) {
                    case fullText:
                        fieldNames = Collections.singleton(getFullTextSearchField());
                        break;
                    case references:
                        fieldNames = Collections.singleton(getReferredDocumentField());
                    default:
                        throw new IllegalStateException("Unsupported Special Field '"
                            +specialField.getUri()+"! Please report this to the "
                            + "Stanbol Developer Mailing list or create an according"
                            + "JIRA issue at https://issues.apache.org/jira/browse/STANBOL!");
                }
            } else {
                fieldNames = new HashSet<String>(2); //typically onle 1 or 2 values
View Full Code Here


     * parsed as path or a special field is used in a path with a length &gt; 1
     * @throws IllegalStateException if an unknown {@link SpecialFieldEnum
     * special field} is encountered.
     */
    private String encodePathName(IndexField indexField) {
        SpecialFieldEnum specialField = indexField.getSpecialField();
        if(specialField != null){ //handel special fields
            switch (specialField) {
                case fullText:
                    return getFullTextSearchField();
                case references:
                    return getReferredDocumentField();
                default:
                    throw new IllegalStateException("Unsupported Special Field '"
                            + specialField.getUri()+"'! Please report this to"
                            + "the Apache Stanbol Developer Mailing List!");
            }
        } else { //normal field
            StringBuilder pathName = new StringBuilder();
            // Now Iterate over the Path
View Full Code Here

        if (indexField == null) {
            throw new IllegalArgumentException("The parsed IndexField name MUST NOT be NULL!");
        }
        List<String> fieldNames = indexFieldMappings.get(indexField);
        if (fieldNames == null) {
            SpecialFieldEnum specialField = indexField.getSpecialField();//check for special field;
            if(specialField != null){
                switch (specialField) {
                    case fullText:
                        fieldNames = Collections.singletonList(getFullTextSearchField());
                        break;
                    case references:
                        fieldNames = Collections.singletonList(getReferredDocumentField());
                        break;
                    default:
                        throw new IllegalStateException("Unsupported Special Field '"
                            +specialField.getUri()+"! Please report this to the "
                            + "Stanbol Developer Mailing list or create an according"
                            + "JIRA issue at https://issues.apache.org/jira/browse/STANBOL!");
                }
            } else {
                fieldNames = new ArrayList<String>(2); //typically only 1 or 2 values
View Full Code Here

     * parsed as path or a special field is used in a path with a length &gt; 1
     * @throws IllegalStateException if an unknown {@link SpecialFieldEnum
     * special field} is encountered.
     */
    private String encodePathName(IndexField indexField) {
        SpecialFieldEnum specialField = indexField.getSpecialField();
        if(specialField != null){ //handel special fields
            switch (specialField) {
                case fullText:
                    return getFullTextSearchField();
                case references:
                    return getReferredDocumentField();
                default:
                    throw new IllegalStateException("Unsupported Special Field '"
                            + specialField.getUri()+"'! Please report this to"
                            + "the Apache Stanbol Developer Mailing List!");
            }
        } else { //normal field
            StringBuilder pathName = new StringBuilder();
            // Now Iterate over the Path
View Full Code Here

        if (indexField == null) {
            throw new IllegalArgumentException("The parsed IndexField name MUST NOT be NULL!");
        }
        Collection<String> fieldNames = indexFieldMappings.get(indexField);
        if (fieldNames == null) {
            SpecialFieldEnum specialField = indexField.getSpecialField();//check for special field;
            if(specialField != null){
                switch (specialField) {
                    case fullText:
                        fieldNames = Collections.singleton(getFullTextSearchField());
                        break;
                    case references:
                        fieldNames = Collections.singleton(getReferredDocumentField());
                    default:
                        throw new IllegalStateException("Unsupported Special Field '"
                            +specialField.getUri()+"! Please report this to the "
                            + "Stanbol Developer Mailing list or create an according"
                            + "JIRA issue at https://issues.apache.org/jira/browse/STANBOL!");
                }
            } else {
                fieldNames = new HashSet<String>(2); //typically onle 1 or 2 values
View Full Code Here

     * parsed as path or a special field is used in a path with a length &gt; 1
     * @throws IllegalStateException if an unknown {@link SpecialFieldEnum
     * special field} is encountered.
     */
    private String encodePathName(IndexField indexField) {
        SpecialFieldEnum specialField = indexField.getSpecialField();
        if(specialField != null){ //handel special fields
            switch (specialField) {
                case fullText:
                    return getFullTextSearchField();
                case references:
                    return getReferredDocumentField();
                default:
                    throw new IllegalStateException("Unsupported Special Field '"
                            + specialField.getUri()+"'! Please report this to"
                            + "the Apache Stanbol Developer Mailing List!");
            }
        } else { //normal field
            StringBuilder pathName = new StringBuilder();
            // Now Iterate over the Path
View Full Code Here

        for(String field : path){
            if(field == null || field.isEmpty()){
                throw new IllegalArgumentException(String.format(
                    "The parsed path MUST NOT contain a NULL value or an empty element (path=%s)!", path));
            }
            SpecialFieldEnum specialField = SpecialFieldEnum.getSpecialField(field);
            if(specialField != null){
                if(path.size() > 1){
                    throw new IllegalArgumentException(String.format(
                        "Special Fields MUST NOT be used on path with a length > 1 " +
                        "(path='%s' | specialField='%s')!",
                        path, specialField.getUri()));
                }
                return specialField;
            }
        }
        return null;
View Full Code Here

TOP

Related Classes of org.apache.stanbol.entityhub.servicesapi.defaults.SpecialFieldEnum

Copyright © 2018 www.massapicom. 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.