[OLINGO-575] Merge edm provider classes

This commit is contained in:
Christian Amend 2015-03-17 14:20:07 +01:00
parent 4768048fba
commit 8a58a67800
263 changed files with 1912 additions and 3784 deletions

View File

@ -1,35 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
import java.util.List;
public interface Action extends Named, Annotatable {
boolean isBound();
String getEntitySetPath();
List<Parameter> getParameters();
Parameter getParameter(String name);
ReturnType getReturnType();
}

View File

@ -1,25 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
public interface ActionImport extends OperationImport {
String getAction();
}

View File

@ -1,30 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
import org.apache.olingo.client.api.edm.xml.annotation.AnnotationExpression;
public interface Annotation extends Annotatable {
String getTerm();
String getQualifier();
AnnotationExpression getExpression();
}

View File

@ -1,29 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
public interface Annotations extends Annotatable {
String getTarget();
String getQualifier();
Annotation getAnnotation(String term);
}

View File

@ -1,26 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
import java.util.List;
public interface BindingTarget extends Named, Annotatable {
List<? extends NavigationPropertyBinding> getNavigationPropertyBindings();
}

View File

@ -1,24 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
public interface ComplexType extends StructuralType {
//No additional methods needed for now.
}

View File

@ -20,6 +20,8 @@ package org.apache.olingo.client.api.edm.xml;
import java.util.List;
import org.apache.olingo.commons.api.edm.provider.Schema;
public interface DataServices {
String getDataServiceVersion();

View File

@ -1,50 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
import java.util.List;
public interface EntityContainer extends Named, Annotatable {
String getExtends();
boolean isLazyLoadingEnabled();
boolean isDefaultEntityContainer();
EntitySet getEntitySet(String name);
List<EntitySet> getEntitySets();
List<Singleton> getSingletons();
Singleton getSingleton(String name);
ActionImport getActionImport(String name);
List<ActionImport> getActionImports(String name);
List<ActionImport> getActionImports();
FunctionImport getFunctionImport(String name);
List<FunctionImport> getFunctionImports(String name);
List<FunctionImport> getFunctionImports();
}

View File

@ -1,26 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
import java.util.List;
public interface EntityKey {
List<PropertyRef> getPropertyRefs();
}

View File

@ -1,27 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
public interface EntitySet extends Named, BindingTarget {
String getEntityType();
boolean isIncludeInServiceDocument();
}

View File

@ -1,26 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
public interface EntityType extends StructuralType {
EntityKey getKey();
boolean isHasStream();
}

View File

@ -1,34 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
import java.util.List;
public interface EnumType extends Named {
String getUnderlyingType();
boolean isFlags();
List<Member> getMembers();
Member getMember(String name);
Member getMember(Integer value);
}

View File

@ -1,25 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
public interface Function extends Action {
boolean isComposable();
}

View File

@ -1,27 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
public interface FunctionImport extends OperationImport, Named {
String getFunction();
boolean isIncludeInServiceDocument();
}

View File

@ -1,26 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
public interface Member {
String getName();
String getValue();
}

View File

@ -1,36 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
import java.util.List;
public interface NavigationProperty extends Named, Annotatable {
String getType();
boolean isNullable();
String getPartner();
List<ReferentialConstraint> getReferentialConstraints();
OnDelete getOnDelete();
boolean isContainsTarget();
}

View File

@ -1,27 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
public interface NavigationPropertyBinding {
String getPath();
String getTarget();
}

View File

@ -1,24 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
public interface OnDelete {
OnDeleteAction getAction();
}

View File

@ -1,27 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
public interface OperationImport extends Named, Annotatable {
String getEntitySet();
void setEntitySet(String entitySet);
}

View File

@ -1,42 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
import org.apache.olingo.commons.api.edm.geo.SRID;
public interface Property extends Named, Annotatable {
String getType();
boolean isNullable();
String getDefaultValue();
Integer getMaxLength();
Integer getPrecision();
Integer getScale();
boolean isUnicode();
SRID getSrid();
}

View File

@ -1,25 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
public interface PropertyRef extends Named {
String getAlias();
}

View File

@ -21,6 +21,8 @@ package org.apache.olingo.client.api.edm.xml;
import java.net.URI;
import java.util.List;
import org.apache.olingo.commons.api.edm.provider.Annotatable;
public interface Reference extends Annotatable {
URI getUri();

View File

@ -1,28 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
public interface ReferentialConstraint extends Annotatable {
String getProperty();
String getReferencedProperty();
}

View File

@ -1,36 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
import org.apache.olingo.commons.api.edm.geo.SRID;
public interface ReturnType {
Integer getMaxLength();
Integer getPrecision();
Integer getScale();
SRID getSrid();
String getType();
boolean isNullable();
}

View File

@ -1,88 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
import java.util.List;
import java.util.Map;
public interface Schema {
String getNamespace();
String getAlias();
List<EnumType> getEnumTypes();
EnumType getEnumType(String name);
/**
* Gets default entity container.
*
* @return default entity container.
*/
EntityContainer getDefaultEntityContainer();
/**
* Gets entity container with the given name.
*
* @param name name.
* @return entity container.
*/
EntityContainer getEntityContainer(String name);
List<EntityContainer> getEntityContainers();
EntityContainer getEntityContainer();
ComplexType getComplexType(String name);
List<ComplexType> getComplexTypes();
EntityType getEntityType(String name);
List<EntityType> getEntityTypes();
List<Action> getActions();
List<Action> getActions(String name);
Annotation getAnnotation(String term);
Map<String, Annotatable> getAnnotatables();
List<Function> getFunctions();
List<Function> getFunctions(String name);
Term getTerm(String name);
List<Term> getTerms();
TypeDefinition getTypeDefinition(String name);
List<TypeDefinition> getTypeDefinitions();
List<Annotations> getAnnotationGroups();
Annotations getAnnotationGroup(String target);
//TODO: Check if there are annotations in V4
List<Annotation> getAnnotations();
}

View File

@ -1,24 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
public interface Singleton extends EntitySet, BindingTarget {
//No additional methods needed for now.
}

View File

@ -1,39 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
import java.util.List;
public interface StructuralType extends Named, Annotatable{
boolean isAbstractType();
String getBaseType();
boolean isOpenType();
Property getProperty(String name);
List<Property> getProperties();
NavigationProperty getNavigationProperty(String name);
List<NavigationProperty> getNavigationProperties();
}

View File

@ -1,44 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
import java.util.List;
import org.apache.olingo.commons.api.edm.geo.SRID;
public interface Term extends Named, Annotatable {
List<String> getAppliesTo();
String getBaseTerm();
String getDefaultValue();
Integer getMaxLength();
Integer getPrecision();
Integer getScale();
SRID getSrid();
String getType();
boolean isNullable();
}

View File

@ -1,40 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.edm.xml;
import java.util.List;
import org.apache.olingo.commons.api.edm.geo.SRID;
public interface TypeDefinition extends Named, Annotatable {
List<Annotation> getAnnotations();
Integer getMaxLength();
Integer getPrecision();
Integer getScale();
SRID getSrid();
String getUnderlyingType();
boolean isUnicode();
}

View File

@ -21,6 +21,8 @@ package org.apache.olingo.client.api.edm.xml;
import java.util.List;
import java.util.Map;
import org.apache.olingo.commons.api.edm.provider.Schema;
/**
* Entry point for access information about EDM metadata.
*/

View File

@ -21,7 +21,6 @@ package org.apache.olingo.client.api.serialization;
import java.io.InputStream;
import java.util.Map;
import org.apache.olingo.client.api.edm.xml.Schema;
import org.apache.olingo.commons.api.data.ResWrap;
import org.apache.olingo.commons.api.domain.ODataEntity;
import org.apache.olingo.commons.api.domain.ODataEntitySet;
@ -29,6 +28,7 @@ import org.apache.olingo.commons.api.domain.ODataError;
import org.apache.olingo.commons.api.domain.ODataProperty;
import org.apache.olingo.commons.api.domain.ODataServiceDocument;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.provider.Schema;
import org.apache.olingo.commons.api.format.ODataFormat;
import org.apache.olingo.commons.api.serialization.ODataDeserializerException;

View File

@ -27,15 +27,15 @@ import org.apache.http.client.methods.HttpUriRequest;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.retrieve.XMLMetadataRequest;
import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.client.api.edm.xml.Annotations;
import org.apache.olingo.client.api.edm.xml.Include;
import org.apache.olingo.client.api.edm.xml.IncludeAnnotations;
import org.apache.olingo.client.api.edm.xml.Reference;
import org.apache.olingo.client.api.edm.xml.Schema;
import org.apache.olingo.client.api.edm.xml.XMLMetadata;
import org.apache.olingo.client.core.edm.xml.AnnotationsImpl;
import org.apache.olingo.client.core.edm.xml.SchemaImpl;
import org.apache.olingo.commons.api.edm.provider.Annotation;
import org.apache.olingo.commons.api.edm.provider.Annotations;
import org.apache.olingo.commons.api.edm.provider.Schema;
import org.apache.olingo.commons.api.format.ODataFormat;
public class XMLMetadataRequestImpl

View File

@ -18,11 +18,11 @@
*/
package org.apache.olingo.client.core.edm;
import org.apache.olingo.client.api.edm.xml.Action;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmAction;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
import org.apache.olingo.commons.api.edm.provider.Action;
public class EdmActionImpl extends EdmOperationImpl implements EdmAction {

View File

@ -20,7 +20,6 @@ package org.apache.olingo.client.core.edm;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.ActionImport;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmAction;
import org.apache.olingo.commons.api.edm.EdmActionImport;
@ -28,6 +27,7 @@ import org.apache.olingo.commons.api.edm.EdmAnnotation;
import org.apache.olingo.commons.api.edm.EdmEntityContainer;
import org.apache.olingo.commons.api.edm.EdmTerm;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.ActionImport;
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;
import org.apache.olingo.commons.core.edm.EdmTypeInfo;

View File

@ -21,11 +21,11 @@ package org.apache.olingo.client.core.edm;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.Annotatable;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmAnnotation;
import org.apache.olingo.commons.api.edm.EdmTerm;
import org.apache.olingo.commons.api.edm.provider.Annotatable;
import org.apache.olingo.commons.api.edm.provider.Annotation;
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;
public class EdmAnnotationHelperImpl implements EdmAnnotationHelper {

View File

@ -21,11 +21,6 @@ package org.apache.olingo.client.core.edm;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.Annotatable;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.client.api.edm.xml.annotation.AnnotationExpression;
import org.apache.olingo.client.api.edm.xml.annotation.DynamicAnnotationExpression;
import org.apache.olingo.client.api.edm.xml.annotation.PropertyValue;
import org.apache.olingo.client.core.edm.annotation.EdmCastImpl;
import org.apache.olingo.client.core.edm.annotation.EdmConstantAnnotationExpressionImpl;
import org.apache.olingo.client.core.edm.annotation.EdmIsOfImpl;
@ -38,6 +33,11 @@ import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.annotation.EdmAnnotationExpression;
import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpression;
import org.apache.olingo.commons.api.edm.annotation.EdmPropertyValue;
import org.apache.olingo.commons.api.edm.provider.Annotatable;
import org.apache.olingo.commons.api.edm.provider.Annotation;
import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression;
import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression;
import org.apache.olingo.commons.api.edm.provider.annotation.PropertyValue;
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;
import org.apache.olingo.commons.core.edm.annotation.EdmAndImpl;
import org.apache.olingo.commons.core.edm.annotation.EdmAnnotationPathImpl;

View File

@ -22,8 +22,6 @@ import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.client.api.edm.xml.Annotations;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmAnnotation;
import org.apache.olingo.commons.api.edm.EdmAnnotations;
@ -34,6 +32,8 @@ import org.apache.olingo.commons.api.edm.EdmSchema;
import org.apache.olingo.commons.api.edm.EdmStructuredType;
import org.apache.olingo.commons.api.edm.EdmTerm;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.Annotation;
import org.apache.olingo.commons.api.edm.provider.Annotations;
public class EdmAnnotationsImpl implements EdmAnnotations {

View File

@ -21,14 +21,14 @@ package org.apache.olingo.client.core.edm;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.BindingTarget;
import org.apache.olingo.client.api.edm.xml.NavigationPropertyBinding;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmAnnotation;
import org.apache.olingo.commons.api.edm.EdmEntityContainer;
import org.apache.olingo.commons.api.edm.EdmNavigationPropertyBinding;
import org.apache.olingo.commons.api.edm.EdmTerm;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.BindingTarget;
import org.apache.olingo.commons.api.edm.provider.NavigationPropertyBinding;
import org.apache.olingo.commons.core.edm.AbstractEdmBindingTarget;
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;
import org.apache.olingo.commons.core.edm.EdmNavigationPropertyBindingImpl;

View File

@ -32,19 +32,6 @@ import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.apache.olingo.client.api.edm.xml.Action;
import org.apache.olingo.client.api.edm.xml.Annotatable;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.client.api.edm.xml.Annotations;
import org.apache.olingo.client.api.edm.xml.ComplexType;
import org.apache.olingo.client.api.edm.xml.EntityContainer;
import org.apache.olingo.client.api.edm.xml.EntityType;
import org.apache.olingo.client.api.edm.xml.EnumType;
import org.apache.olingo.client.api.edm.xml.Function;
import org.apache.olingo.client.api.edm.xml.Parameter;
import org.apache.olingo.client.api.edm.xml.Schema;
import org.apache.olingo.client.api.edm.xml.Term;
import org.apache.olingo.client.api.edm.xml.TypeDefinition;
import org.apache.olingo.commons.api.edm.EdmAction;
import org.apache.olingo.commons.api.edm.EdmAnnotation;
import org.apache.olingo.commons.api.edm.EdmAnnotations;
@ -57,6 +44,19 @@ import org.apache.olingo.commons.api.edm.EdmSchema;
import org.apache.olingo.commons.api.edm.EdmTerm;
import org.apache.olingo.commons.api.edm.EdmTypeDefinition;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.Action;
import org.apache.olingo.commons.api.edm.provider.Annotatable;
import org.apache.olingo.commons.api.edm.provider.Annotation;
import org.apache.olingo.commons.api.edm.provider.Annotations;
import org.apache.olingo.commons.api.edm.provider.ComplexType;
import org.apache.olingo.commons.api.edm.provider.EntityContainer;
import org.apache.olingo.commons.api.edm.provider.EntityType;
import org.apache.olingo.commons.api.edm.provider.EnumType;
import org.apache.olingo.commons.api.edm.provider.Function;
import org.apache.olingo.commons.api.edm.provider.Parameter;
import org.apache.olingo.commons.api.edm.provider.Schema;
import org.apache.olingo.commons.api.edm.provider.Term;
import org.apache.olingo.commons.api.edm.provider.TypeDefinition;
import org.apache.olingo.commons.core.edm.AbstractEdm;
import org.apache.olingo.commons.core.edm.EdmTypeInfo;
@ -106,7 +106,7 @@ public class EdmClientImpl extends AbstractEdm {
final Schema schema = xmlSchemaByNamespace.get(containerName.getNamespace());
if (schema != null) {
final EntityContainer xmlEntityContainer = schema.getDefaultEntityContainer();
final EntityContainer xmlEntityContainer = schema.getEntityContainer();
if (xmlEntityContainer != null) {
result = new EdmEntityContainerImpl(this, containerName, xmlEntityContainer);
}

View File

@ -21,13 +21,13 @@ package org.apache.olingo.client.core.edm;
import java.util.List;
import java.util.Map;
import org.apache.olingo.client.api.edm.xml.ComplexType;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmAnnotation;
import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
import org.apache.olingo.commons.api.edm.EdmProperty;
import org.apache.olingo.commons.api.edm.EdmTerm;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.ComplexType;
import org.apache.olingo.commons.core.edm.AbstractEdmComplexType;
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;
import org.apache.olingo.commons.core.edm.EdmStructuredTypeHelper;

View File

@ -21,11 +21,6 @@ package org.apache.olingo.client.core.edm;
import java.util.Collections;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.ActionImport;
import org.apache.olingo.client.api.edm.xml.EntityContainer;
import org.apache.olingo.client.api.edm.xml.EntitySet;
import org.apache.olingo.client.api.edm.xml.FunctionImport;
import org.apache.olingo.client.api.edm.xml.Singleton;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmActionImport;
import org.apache.olingo.commons.api.edm.EdmAnnotation;
@ -34,6 +29,11 @@ import org.apache.olingo.commons.api.edm.EdmFunctionImport;
import org.apache.olingo.commons.api.edm.EdmSingleton;
import org.apache.olingo.commons.api.edm.EdmTerm;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.ActionImport;
import org.apache.olingo.commons.api.edm.provider.EntityContainer;
import org.apache.olingo.commons.api.edm.provider.EntitySet;
import org.apache.olingo.commons.api.edm.provider.FunctionImport;
import org.apache.olingo.commons.api.edm.provider.Singleton;
import org.apache.olingo.commons.core.edm.AbstractEdmEntityContainer;
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;
import org.apache.olingo.commons.core.edm.EdmTypeInfo;
@ -47,8 +47,8 @@ public class EdmEntityContainerImpl extends AbstractEdmEntityContainer {
public EdmEntityContainerImpl(final Edm edm, final FullQualifiedName entityContainerName,
final EntityContainer xmlEntityContainer) {
super(edm, entityContainerName, xmlEntityContainer.getExtends() == null
? null : new FullQualifiedName(xmlEntityContainer.getExtends()));
super(edm, entityContainerName, xmlEntityContainer.getExtendsContainer() == null
? null : new FullQualifiedName(xmlEntityContainer.getExtendsContainer()));
this.xmlEntityContainer = xmlEntityContainer;
this.helper = new EdmAnnotationHelperImpl(edm, xmlEntityContainer);
@ -65,7 +65,7 @@ public class EdmEntityContainerImpl extends AbstractEdmEntityContainer {
return singleton == null
? null
: new EdmSingletonImpl(edm, this, singletonName, new EdmTypeInfo.Builder().
setTypeExpression(singleton.getEntityType()).
setTypeExpression(singleton.getType()).
setDefaultNamespace(entityContainerName.getNamespace()).
build().getFullQualifiedName(), singleton);
}
@ -76,7 +76,7 @@ public class EdmEntityContainerImpl extends AbstractEdmEntityContainer {
final EntitySet entitySet = xmlEntityContainer.getEntitySet(entitySetName);
if (entitySet != null) {
final FullQualifiedName entityType = new EdmTypeInfo.Builder().setTypeExpression(entitySet.getEntityType()).
final FullQualifiedName entityType = new EdmTypeInfo.Builder().setTypeExpression(entitySet.getType()).
setDefaultNamespace(entityContainerName.getNamespace()).build().getFullQualifiedName();
result = new EdmEntitySetImpl(edm, this, entitySetName, entityType, entitySet);
}
@ -113,7 +113,7 @@ public class EdmEntityContainerImpl extends AbstractEdmEntityContainer {
if (localEntitySets != null) {
for (EntitySet entitySet : localEntitySets) {
EdmEntitySet edmSet;
final FullQualifiedName entityType = new EdmTypeInfo.Builder().setTypeExpression(entitySet.getEntityType()).
final FullQualifiedName entityType = new EdmTypeInfo.Builder().setTypeExpression(entitySet.getType()).
setDefaultNamespace(entityContainerName.getNamespace()).build().getFullQualifiedName();
edmSet = new EdmEntitySetImpl(edm, this, entitySet.getName(), entityType, entitySet);
entitySets.put(edmSet.getName(), edmSet);
@ -138,7 +138,7 @@ public class EdmEntityContainerImpl extends AbstractEdmEntityContainer {
for (Singleton singleton : localSingletons) {
singletons.put(singleton.getName(), new EdmSingletonImpl(edm, this, singleton.getName(),
new EdmTypeInfo.Builder().
setTypeExpression(singleton.getEntityType()).setDefaultNamespace(entityContainerName.getNamespace()).
setTypeExpression(singleton.getType()).setDefaultNamespace(entityContainerName.getNamespace()).
build().getFullQualifiedName(), singleton));
}
}

View File

@ -18,11 +18,11 @@
*/
package org.apache.olingo.client.core.edm;
import org.apache.olingo.client.api.edm.xml.EntitySet;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmEntityContainer;
import org.apache.olingo.commons.api.edm.EdmEntitySet;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.EntitySet;
public class EdmEntitySetImpl extends EdmBindingTargetImpl implements EdmEntitySet {

View File

@ -22,8 +22,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.olingo.client.api.edm.xml.EntityType;
import org.apache.olingo.client.api.edm.xml.PropertyRef;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmAnnotation;
import org.apache.olingo.commons.api.edm.EdmEntityType;
@ -32,6 +30,8 @@ import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
import org.apache.olingo.commons.api.edm.EdmProperty;
import org.apache.olingo.commons.api.edm.EdmTerm;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.EntityType;
import org.apache.olingo.commons.api.edm.provider.PropertyRef;
import org.apache.olingo.commons.core.edm.AbstractEdmEntityType;
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;
import org.apache.olingo.commons.core.edm.EdmStructuredTypeHelper;
@ -56,12 +56,11 @@ public class EdmEntityTypeImpl extends AbstractEdmEntityType {
final List<EdmKeyPropertyRef> edmKey;
// Abstract EntityTypes do not necessarily have keys
if (entityType.isAbstractType() && entityType.getKey() == null) {
if (entityType.isAbstract() && entityType.getKey() == null) {
edmKey = new ArrayList<EdmKeyPropertyRef>();
} else {
edmKey = new ArrayList<EdmKeyPropertyRef>(
entityType.getKey().getPropertyRefs().size());
for (PropertyRef ref : entityType.getKey().getPropertyRefs()) {
edmKey = new ArrayList<EdmKeyPropertyRef>(entityType.getKey().size());
for (PropertyRef ref : entityType.getKey()) {
edmKey.add(new EdmKeyPropertyRefImpl(instance, ref));
}
}
@ -76,7 +75,7 @@ public class EdmEntityTypeImpl extends AbstractEdmEntityType {
private EdmEntityTypeImpl(final Edm edm, final FullQualifiedName fqn, final FullQualifiedName baseTypeName,
final EntityType entityType) {
super(edm, fqn, baseTypeName, entityType.isHasStream());
super(edm, fqn, baseTypeName, entityType.hasStream());
this.typeHelper = new EdmStructuredTypeHelperImpl(edm, getFullQualifiedName(), entityType);
this.annotationHelper = new EdmAnnotationHelperImpl(edm, entityType);
}

View File

@ -26,14 +26,14 @@ import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.olingo.client.api.edm.xml.EnumType;
import org.apache.olingo.client.api.edm.xml.Member;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmException;
import org.apache.olingo.commons.api.edm.EdmMember;
import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.EnumMember;
import org.apache.olingo.commons.api.edm.provider.EnumType;
import org.apache.olingo.commons.core.edm.AbstractEdmEnumType;
import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;
@ -69,10 +69,10 @@ public class EdmEnumTypeImpl extends AbstractEdmEnumType {
this.underlyingType = EdmPrimitiveTypeFactory.getInstance(underlyingTipeKind);
}
final List<? extends Member> xmlMembers = xmlEnumType.getMembers();
final List<EnumMember> xmlMembers = xmlEnumType.getMembers();
final List<String> _memberNames = new ArrayList<String>();
final Map<String, EdmMember> _members = new LinkedHashMap<String, EdmMember>(xmlMembers.size());
for (Member xmlMember : xmlMembers) {
for (EnumMember xmlMember : xmlMembers) {
_memberNames.add(xmlMember.getName());
_members.put(xmlMember.getName(), new EdmMemberImpl(edm, fqn, xmlMember));
}

View File

@ -18,11 +18,11 @@
*/
package org.apache.olingo.client.core.edm;
import org.apache.olingo.client.api.edm.xml.Function;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmFunction;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
import org.apache.olingo.commons.api.edm.provider.Function;
public class EdmFunctionImpl extends EdmOperationImpl implements EdmFunction {

View File

@ -20,7 +20,6 @@ package org.apache.olingo.client.core.edm;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.FunctionImport;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmAnnotation;
import org.apache.olingo.commons.api.edm.EdmEntityContainer;
@ -28,6 +27,7 @@ import org.apache.olingo.commons.api.edm.EdmFunction;
import org.apache.olingo.commons.api.edm.EdmFunctionImport;
import org.apache.olingo.commons.api.edm.EdmTerm;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.FunctionImport;
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;
import org.apache.olingo.commons.core.edm.EdmTypeInfo;

View File

@ -18,8 +18,8 @@
*/
package org.apache.olingo.client.core.edm;
import org.apache.olingo.client.api.edm.xml.PropertyRef;
import org.apache.olingo.commons.api.edm.EdmEntityType;
import org.apache.olingo.commons.api.edm.provider.PropertyRef;
import org.apache.olingo.commons.core.edm.AbstractEdmKeyPropertyRef;
public class EdmKeyPropertyRefImpl extends AbstractEdmKeyPropertyRef {

View File

@ -21,12 +21,12 @@ package org.apache.olingo.client.core.edm;
import java.util.Collections;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.Member;
import org.apache.olingo.client.core.edm.xml.MemberImpl;
import org.apache.olingo.client.core.edm.xml.EnumMemberImpl;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmAnnotation;
import org.apache.olingo.commons.api.edm.EdmTerm;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.EnumMember;
import org.apache.olingo.commons.core.edm.AbstractEdmMember;
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;
@ -34,10 +34,10 @@ public class EdmMemberImpl extends AbstractEdmMember {
private EdmAnnotationHelper helper;
public EdmMemberImpl(final Edm edm, final FullQualifiedName enumFQN, final Member member) {
public EdmMemberImpl(final Edm edm, final FullQualifiedName enumFQN, final EnumMember member) {
super(edm, enumFQN, member.getName(), member.getValue());
this.helper = member instanceof MemberImpl
? new EdmAnnotationHelperImpl(edm, (MemberImpl) member)
this.helper = member instanceof EnumMemberImpl
? new EdmAnnotationHelperImpl(edm, member)
: null;
}

View File

@ -21,13 +21,13 @@ package org.apache.olingo.client.core.edm;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.NavigationProperty;
import org.apache.olingo.client.api.edm.xml.ReferentialConstraint;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmAnnotation;
import org.apache.olingo.commons.api.edm.EdmReferentialConstraint;
import org.apache.olingo.commons.api.edm.EdmTerm;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.NavigationProperty;
import org.apache.olingo.commons.api.edm.provider.ReferentialConstraint;
import org.apache.olingo.commons.core.edm.AbstractEdmNavigationProperty;
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;
import org.apache.olingo.commons.core.edm.EdmTypeInfo;
@ -71,7 +71,7 @@ public class EdmNavigationPropertyImpl extends AbstractEdmNavigationProperty {
}
@Override
public Boolean isNullable() {
public boolean isNullable() {
return navigationProperty.isNullable();
}

View File

@ -22,20 +22,20 @@ import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.apache.olingo.client.api.edm.xml.Action;
import org.apache.olingo.client.api.edm.xml.Parameter;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmAnnotation;
import org.apache.olingo.commons.api.edm.EdmParameter;
import org.apache.olingo.commons.api.edm.EdmTerm;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
import org.apache.olingo.commons.api.edm.provider.Operation;
import org.apache.olingo.commons.api.edm.provider.Parameter;
import org.apache.olingo.commons.core.edm.AbstractEdmOperation;
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;
public abstract class EdmOperationImpl extends AbstractEdmOperation {
protected final Action operation;
protected final Operation operation;
protected final EdmAnnotationHelper helper;
@ -63,7 +63,7 @@ public abstract class EdmOperationImpl extends AbstractEdmOperation {
return instance;
}
protected EdmOperationImpl(final Edm edm, final FullQualifiedName name, final Action operation,
protected EdmOperationImpl(final Edm edm, final FullQualifiedName name, final Operation operation,
final EdmTypeKind kind) {
super(edm, name, kind);

View File

@ -21,13 +21,13 @@ package org.apache.olingo.client.core.edm;
import java.util.Collections;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.Parameter;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmAnnotation;
import org.apache.olingo.commons.api.edm.EdmMapping;
import org.apache.olingo.commons.api.edm.EdmTerm;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.geo.SRID;
import org.apache.olingo.commons.api.edm.provider.Parameter;
import org.apache.olingo.commons.core.edm.AbstractEdmParameter;
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;
import org.apache.olingo.commons.core.edm.EdmTypeInfo;
@ -58,7 +58,7 @@ public class EdmParameterImpl extends AbstractEdmParameter {
}
@Override
public Boolean isNullable() {
public boolean isNullable() {
return parameter.isNullable();
}

View File

@ -21,13 +21,13 @@ package org.apache.olingo.client.core.edm;
import java.util.Collections;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.Property;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmAnnotation;
import org.apache.olingo.commons.api.edm.EdmMapping;
import org.apache.olingo.commons.api.edm.EdmTerm;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.geo.SRID;
import org.apache.olingo.commons.api.edm.provider.Property;
import org.apache.olingo.commons.core.edm.AbstractEdmProperty;
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;
import org.apache.olingo.commons.core.edm.EdmTypeInfo;
@ -47,7 +47,9 @@ public class EdmPropertyImpl extends AbstractEdmProperty {
this.structuredTypeName = structuredTypeName;
this.property = property;
this.typeInfo = new EdmTypeInfo.Builder().setEdm(edm).setTypeExpression(property.getType()).build();
this.typeInfo =
new EdmTypeInfo.Builder().setEdm(edm).setTypeExpression(property.getType())
.build();
this.helper = new EdmAnnotationHelperImpl(edm, property);
}
@ -67,7 +69,7 @@ public class EdmPropertyImpl extends AbstractEdmProperty {
}
@Override
public Boolean isNullable() {
public boolean isNullable() {
return property.isNullable();
}
@ -87,7 +89,7 @@ public class EdmPropertyImpl extends AbstractEdmProperty {
}
@Override
public Boolean isUnicode() {
public boolean isUnicode() {
return property.isUnicode();
}

View File

@ -20,10 +20,10 @@ package org.apache.olingo.client.core.edm;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.ReferentialConstraint;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmAnnotation;
import org.apache.olingo.commons.api.edm.EdmTerm;
import org.apache.olingo.commons.api.edm.provider.ReferentialConstraint;
import org.apache.olingo.commons.core.edm.AbstractEdmReferentialConstraint;
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;

View File

@ -18,9 +18,9 @@
*/
package org.apache.olingo.client.core.edm;
import org.apache.olingo.client.api.edm.xml.ReturnType;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.geo.SRID;
import org.apache.olingo.commons.api.edm.provider.ReturnType;
import org.apache.olingo.commons.core.edm.AbstractEdmReturnType;
import org.apache.olingo.commons.core.edm.EdmTypeInfo;
@ -47,7 +47,7 @@ public class EdmReturnTypeImpl extends AbstractEdmReturnType {
}
@Override
public Boolean isNullable() {
public boolean isNullable() {
return returnType.isNullable();
}

View File

@ -23,17 +23,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.olingo.client.api.edm.xml.Action;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.client.api.edm.xml.Annotations;
import org.apache.olingo.client.api.edm.xml.ComplexType;
import org.apache.olingo.client.api.edm.xml.EntityContainer;
import org.apache.olingo.client.api.edm.xml.EntityType;
import org.apache.olingo.client.api.edm.xml.EnumType;
import org.apache.olingo.client.api.edm.xml.Function;
import org.apache.olingo.client.api.edm.xml.Schema;
import org.apache.olingo.client.api.edm.xml.Term;
import org.apache.olingo.client.api.edm.xml.TypeDefinition;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmAction;
import org.apache.olingo.commons.api.edm.EdmAnnotation;
@ -46,6 +35,17 @@ import org.apache.olingo.commons.api.edm.EdmFunction;
import org.apache.olingo.commons.api.edm.EdmTerm;
import org.apache.olingo.commons.api.edm.EdmTypeDefinition;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.Action;
import org.apache.olingo.commons.api.edm.provider.Annotation;
import org.apache.olingo.commons.api.edm.provider.Annotations;
import org.apache.olingo.commons.api.edm.provider.ComplexType;
import org.apache.olingo.commons.api.edm.provider.EntityContainer;
import org.apache.olingo.commons.api.edm.provider.EntityType;
import org.apache.olingo.commons.api.edm.provider.EnumType;
import org.apache.olingo.commons.api.edm.provider.Function;
import org.apache.olingo.commons.api.edm.provider.Schema;
import org.apache.olingo.commons.api.edm.provider.Term;
import org.apache.olingo.commons.api.edm.provider.TypeDefinition;
import org.apache.olingo.commons.core.edm.AbstractEdmSchema;
public class EdmSchemaImpl extends AbstractEdmSchema {
@ -88,7 +88,7 @@ public class EdmSchemaImpl extends AbstractEdmSchema {
}
private EdmEntityContainer createEntityContainer(final String name) {
final EntityContainer defaultContainer = schema.getEntityContainer(name);
final EntityContainer defaultContainer = schema.getEntityContainer();
if (defaultContainer != null) {
final FullQualifiedName entityContainerName =
new FullQualifiedName(schema.getNamespace(), defaultContainer.getName());
@ -99,7 +99,7 @@ public class EdmSchemaImpl extends AbstractEdmSchema {
@Override
protected EdmEntityContainer createEntityContainer() {
final EntityContainer defaultContainer = schema.getDefaultEntityContainer();
final EntityContainer defaultContainer = schema.getEntityContainer();
if (defaultContainer != null) {
return createEntityContainer(defaultContainer.getName());
}

View File

@ -18,11 +18,11 @@
*/
package org.apache.olingo.client.core.edm;
import org.apache.olingo.client.api.edm.xml.Singleton;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmEntityContainer;
import org.apache.olingo.commons.api.edm.EdmSingleton;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.Singleton;
public class EdmSingletonImpl extends EdmBindingTargetImpl implements EdmSingleton {

View File

@ -21,13 +21,13 @@ package org.apache.olingo.client.core.edm;
import java.util.LinkedHashMap;
import java.util.Map;
import org.apache.olingo.client.api.edm.xml.NavigationProperty;
import org.apache.olingo.client.api.edm.xml.Property;
import org.apache.olingo.client.api.edm.xml.StructuralType;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
import org.apache.olingo.commons.api.edm.EdmProperty;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.NavigationProperty;
import org.apache.olingo.commons.api.edm.provider.Property;
import org.apache.olingo.commons.api.edm.provider.StructuralType;
import org.apache.olingo.commons.core.edm.EdmStructuredTypeHelper;
public class EdmStructuredTypeHelperImpl implements EdmStructuredTypeHelper {
@ -80,6 +80,6 @@ public class EdmStructuredTypeHelperImpl implements EdmStructuredTypeHelper {
@Override
public boolean isAbstract() {
return structuralType.isAbstractType();
return structuralType.isAbstract();
}
}

View File

@ -22,7 +22,6 @@ import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.ClassUtils;
import org.apache.olingo.client.api.edm.xml.Term;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmAnnotation;
import org.apache.olingo.commons.api.edm.EdmException;
@ -30,6 +29,7 @@ import org.apache.olingo.commons.api.edm.EdmTerm;
import org.apache.olingo.commons.api.edm.EdmType;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.geo.SRID;
import org.apache.olingo.commons.api.edm.provider.Term;
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;
import org.apache.olingo.commons.core.edm.EdmNamedImpl;
import org.apache.olingo.commons.core.edm.EdmTypeInfo;

View File

@ -20,7 +20,6 @@ package org.apache.olingo.client.core.edm;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.TypeDefinition;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmAnnotation;
import org.apache.olingo.commons.api.edm.EdmException;
@ -29,6 +28,7 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.edm.EdmTerm;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.geo.SRID;
import org.apache.olingo.commons.api.edm.provider.TypeDefinition;
import org.apache.olingo.commons.core.edm.AbstractEdmTypeDefinition;
import org.apache.olingo.commons.core.edm.EdmAnnotationHelper;
import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;

View File

@ -18,12 +18,12 @@
*/
package org.apache.olingo.client.core.edm.annotation;
import org.apache.olingo.client.api.edm.xml.annotation.Cast;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmType;
import org.apache.olingo.commons.api.edm.annotation.EdmCast;
import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpression;
import org.apache.olingo.commons.api.edm.geo.SRID;
import org.apache.olingo.commons.api.edm.provider.annotation.Cast;
import org.apache.olingo.commons.core.edm.EdmTypeInfo;
import org.apache.olingo.commons.core.edm.annotation.AbstractEdmAnnotatableDynamicAnnotationExpression;

View File

@ -22,7 +22,6 @@ import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.apache.olingo.client.api.edm.xml.annotation.ConstantAnnotationExpression;
import org.apache.olingo.commons.api.Constants;
import org.apache.olingo.commons.api.domain.ODataEnumValue;
import org.apache.olingo.commons.api.domain.ODataValue;
@ -31,6 +30,7 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.edm.annotation.EdmConstantAnnotationExpression;
import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpression;
import org.apache.olingo.commons.api.edm.provider.annotation.ConstantAnnotationExpression;
import org.apache.olingo.commons.core.domain.ODataCollectionValueImpl;
import org.apache.olingo.commons.core.domain.ODataEnumValueImpl;
import org.apache.olingo.commons.core.domain.ODataPrimitiveValueImpl;

View File

@ -18,12 +18,12 @@
*/
package org.apache.olingo.client.core.edm.annotation;
import org.apache.olingo.client.api.edm.xml.annotation.IsOf;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmType;
import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpression;
import org.apache.olingo.commons.api.edm.annotation.EdmIsOf;
import org.apache.olingo.commons.api.edm.geo.SRID;
import org.apache.olingo.commons.api.edm.provider.annotation.IsOf;
import org.apache.olingo.commons.core.edm.EdmTypeInfo;
import org.apache.olingo.commons.core.edm.annotation.AbstractEdmAnnotatableDynamicAnnotationExpression;

View File

@ -1,49 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.core.edm.xml;
import org.apache.olingo.client.api.edm.xml.NavigationProperty;
import org.apache.olingo.client.api.edm.xml.Property;
import org.apache.olingo.client.api.edm.xml.StructuralType;
public abstract class AbstractStructuralType extends AbstractEdmItem implements StructuralType {
private static final long serialVersionUID = 1137297128124390440L;
private String name;
@Override
public String getName() {
return name;
}
public void setName(final String name) {
this.name = name;
}
@Override
public Property getProperty(final String name) {
return getOneByName(name, getProperties());
}
@Override
public NavigationProperty getNavigationProperty(final String name) {
return getOneByName(name, getNavigationProperties());
}
}

View File

@ -18,82 +18,12 @@
*/
package org.apache.olingo.client.core.edm.xml;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.Action;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.client.api.edm.xml.Parameter;
import org.apache.olingo.client.api.edm.xml.ReturnType;
import org.apache.olingo.commons.api.edm.provider.Action;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = ActionDeserializer.class)
public class ActionImpl extends AbstractEdmItem implements Action {
public class ActionImpl extends Action {
private static final long serialVersionUID = 5321541275349234088L;
private String name;
private boolean bound = false;
private String entitySetPath;
private final List<Parameter> parameters = new ArrayList<Parameter>();
private ReturnType returnType;
private final List<Annotation> annotations = new ArrayList<Annotation>();
@Override
public List<Annotation> getAnnotations() {
return annotations;
}
@Override
public String getName() {
return name;
}
public void setName(final String name) {
this.name = name;
}
@Override
public boolean isBound() {
return bound;
}
public void setBound(final boolean bound) {
this.bound = bound;
}
@Override
public String getEntitySetPath() {
return entitySetPath;
}
public void setEntitySetPath(final String entitySetPath) {
this.entitySetPath = entitySetPath;
}
@Override
public Parameter getParameter(final String name) {
return getOneByName(name, getParameters());
}
@Override
public List<Parameter> getParameters() {
return parameters;
}
@Override
public ReturnType getReturnType() {
return returnType;
}
public void setReturnType(final ReturnType returnType) {
this.returnType = returnType;
}
}

View File

@ -1,77 +1,51 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.core.edm.xml;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.ActionImport;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.commons.api.edm.provider.ActionImport;
import com.fasterxml.jackson.annotation.JsonProperty;
public class ActionImportImpl extends AbstractEdmItem implements ActionImport {
public class ActionImportImpl extends ActionImport {
private static final long serialVersionUID = 2971468441177647068L;
@JsonProperty(value = "Name", required = true)
private String name;
@JsonProperty(value = "Action", required = true)
private String action;
@JsonProperty(value = "EntitySet")
private String entitySet;
private final List<Annotation> annotations = new ArrayList<Annotation>();
@Override
public List<Annotation> getAnnotations() {
return annotations;
@JsonProperty(value = "Action", required = true)
public ActionImport setAction(final String action) {
super.setAction(action);
return this;
}
@Override
public String getName() {
return name;
}
public void setName(final String name) {
this.name = name;
@JsonProperty(value = "Name", required = true)
public ActionImport setName(final String name) {
super.setName(name);
return this;
}
@Override
public String getAction() {
return action;
}
public void setAction(final String action) {
this.action = action;
}
@Override
public String getEntitySet() {
return entitySet;
}
@Override
public void setEntitySet(final String entitySet) {
this.entitySet = entitySet;
@JsonProperty(value = "EntitySet")
public ActionImport setEntitySet(final String entitySet) {
super.setEntitySet(entitySet);
return this;
}
}

View File

@ -21,13 +21,13 @@ package org.apache.olingo.client.core.edm.xml;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.client.api.edm.xml.annotation.AnnotationExpression;
import org.apache.olingo.commons.api.edm.provider.Annotation;
import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = AnnotationDeserializer.class)
public class AnnotationImpl extends AbstractEdmItem implements Annotation {
public class AnnotationImpl extends Annotation {
private static final long serialVersionUID = 5464714417411058033L;
@ -49,8 +49,9 @@ public class AnnotationImpl extends AbstractEdmItem implements Annotation {
return term;
}
public void setTerm(final String term) {
public AnnotationImpl setTerm(final String term) {
this.term = term;
return this;
}
@Override
@ -58,8 +59,9 @@ public class AnnotationImpl extends AbstractEdmItem implements Annotation {
return qualifier;
}
public void setQualifier(final String qualifier) {
public AnnotationImpl setQualifier(final String qualifier) {
this.qualifier = qualifier;
return this;
}
@Override

View File

@ -18,59 +18,13 @@
*/
package org.apache.olingo.client.core.edm.xml;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.commons.api.edm.provider.Annotations;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.client.api.edm.xml.Annotations;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = AnnotationsDeserializer.class)
public class AnnotationsImpl extends AbstractEdmItem implements Annotations {
public class AnnotationsImpl extends Annotations {
private static final long serialVersionUID = -5961207981571644200L;
private final List<Annotation> annotations = new ArrayList<Annotation>();
@JsonProperty(value = "Target", required = true)
private String target;
@JsonProperty("Qualifier")
private String qualifier;
@Override
public String getTarget() {
return target;
}
public void setTarget(final String target) {
this.target = target;
}
@Override
public String getQualifier() {
return qualifier;
}
public void setQualifier(final String qualifier) {
this.qualifier = qualifier;
}
@Override
public List<Annotation> getAnnotations() {
return annotations;
}
@Override
public Annotation getAnnotation(final String term) {
Annotation result = null;
for (Annotation annotation : getAnnotations()) {
if (term.equals(annotation.getTerm())) {
result = annotation;
}
}
return result;
}
}

View File

@ -27,10 +27,10 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.DeserializationContext;
public class ComplexTypeDeserializer extends AbstractEdmDeserializer<AbstractStructuralType> {
public class ComplexTypeDeserializer extends AbstractEdmDeserializer<ComplexTypeImpl> {
@Override
protected AbstractStructuralType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
protected ComplexTypeImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
throws IOException, JsonProcessingException {
final ComplexTypeImpl complexType = new ComplexTypeImpl();
@ -41,7 +41,7 @@ public class ComplexTypeDeserializer extends AbstractEdmDeserializer<AbstractStr
if ("Name".equals(jp.getCurrentName())) {
complexType.setName(jp.nextTextValue());
} else if ("Abstract".equals(jp.getCurrentName())) {
complexType.setAbstractEntityType(BooleanUtils.toBoolean(jp.nextTextValue()));
complexType.setAbstract(BooleanUtils.toBoolean(jp.nextTextValue()));
} else if ("BaseType".equals(jp.getCurrentName())) {
complexType.setBaseType(jp.nextTextValue());
} else if ("OpenType".equals(jp.getCurrentName())) {

View File

@ -18,83 +18,13 @@
*/
package org.apache.olingo.client.core.edm.xml;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.client.api.edm.xml.ComplexType;
import org.apache.olingo.client.api.edm.xml.NavigationProperty;
import org.apache.olingo.client.api.edm.xml.Property;
import org.apache.olingo.commons.api.edm.provider.ComplexType;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = ComplexTypeDeserializer.class)
public class ComplexTypeImpl extends AbstractStructuralType implements ComplexType {
public class ComplexTypeImpl extends ComplexType {
private static final long serialVersionUID = 4076944306925840115L;
private boolean abstractEntityType = false;
private String baseType;
private boolean openType = false;
private final List<Property> properties = new ArrayList<Property>();
private final List<NavigationProperty> navigationProperties = new ArrayList<NavigationProperty>();
private final List<Annotation> annotations = new ArrayList<Annotation>();
@Override
public boolean isAbstractType() {
return abstractEntityType;
}
public void setAbstractEntityType(final boolean abstractEntityType) {
this.abstractEntityType = abstractEntityType;
}
@Override
public String getBaseType() {
return baseType;
}
public void setBaseType(final String baseType) {
this.baseType = baseType;
}
@Override
public boolean isOpenType() {
return openType;
}
public void setOpenType(final boolean openType) {
this.openType = openType;
}
@Override
public Property getProperty(final String name) {
return super.getProperty(name);
}
@Override
public List<Property> getProperties() {
return properties;
}
@Override
public NavigationProperty getNavigationProperty(final String name) {
return super.getNavigationProperty(name);
}
@Override
public List<NavigationProperty> getNavigationProperties() {
return navigationProperties;
}
@Override
public List<Annotation> getAnnotations() {
return annotations;
}
}

View File

@ -22,7 +22,8 @@ import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.DataServices;
import org.apache.olingo.client.api.edm.xml.Schema;
import org.apache.olingo.commons.api.edm.provider.AbstractEdmItem;
import org.apache.olingo.commons.api.edm.provider.Schema;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

View File

@ -24,6 +24,7 @@ import java.util.List;
import org.apache.olingo.client.api.edm.xml.DataServices;
import org.apache.olingo.client.api.edm.xml.Edmx;
import org.apache.olingo.client.api.edm.xml.Reference;
import org.apache.olingo.commons.api.edm.provider.AbstractEdmItem;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

View File

@ -20,8 +20,6 @@ package org.apache.olingo.client.core.edm.xml;
import java.io.IOException;
import org.apache.commons.lang3.BooleanUtils;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.JsonToken;
@ -41,9 +39,7 @@ public class EntityContainerDeserializer extends AbstractEdmDeserializer<EntityC
if ("Name".equals(jp.getCurrentName())) {
entityContainer.setName(jp.nextTextValue());
} else if ("Extends".equals(jp.getCurrentName())) {
entityContainer.setExtends(jp.nextTextValue());
} else if ("LazyLoadingEnabled".equals(jp.getCurrentName())) {
entityContainer.setLazyLoadingEnabled(BooleanUtils.toBoolean(jp.nextTextValue()));
entityContainer.setExtendsContainer(jp.nextTextValue());
} else if ("EntitySet".equals(jp.getCurrentName())) {
jp.nextToken();
entityContainer.getEntitySets().add(jp.readValueAs(EntitySetImpl.class));

View File

@ -18,149 +18,12 @@
*/
package org.apache.olingo.client.core.edm.xml;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.ActionImport;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.client.api.edm.xml.EntityContainer;
import org.apache.olingo.client.api.edm.xml.EntitySet;
import org.apache.olingo.client.api.edm.xml.FunctionImport;
import org.apache.olingo.client.api.edm.xml.Singleton;
import org.apache.olingo.commons.api.edm.provider.EntityContainer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = EntityContainerDeserializer.class)
public class EntityContainerImpl extends AbstractEdmItem implements EntityContainer {
public class EntityContainerImpl extends EntityContainer {
private static final long serialVersionUID = 5631432527646955795L;
private final List<EntitySet> entitySets = new ArrayList<EntitySet>();
private final List<Singleton> singletons = new ArrayList<Singleton>();
private final List<ActionImport> actionImports = new ArrayList<ActionImport>();
private final List<FunctionImport> functionImports = new ArrayList<FunctionImport>();
private final List<Annotation> annotations = new ArrayList<Annotation>();
private String name;
private String _extends;
private boolean lazyLoadingEnabled;
@Override
public String getName() {
return name;
}
public void setName(final String name) {
this.name = name;
}
@Override
public String getExtends() {
return _extends;
}
public void setExtends(final String _extends) {
this._extends = _extends;
}
@Override
public boolean isLazyLoadingEnabled() {
return lazyLoadingEnabled;
}
public void setLazyLoadingEnabled(final boolean lazyLoadingEnabled) {
this.lazyLoadingEnabled = lazyLoadingEnabled;
}
@Override
public EntitySet getEntitySet(final String name) {
return getOneByName(name, getEntitySets());
}
/**
* Gets the first function import with given name.
*
* @param name name.
* @return function import.
*/
@Override
public FunctionImport getFunctionImport(final String name) {
return getOneByName(name, getFunctionImports());
}
/**
* Gets all function imports with given name.
*
* @param name name.
* @return function imports.
*/
@Override
public List<FunctionImport> getFunctionImports(final String name) {
return getAllByName(name, getFunctionImports());
}
//TODO: No default container in V4 so we should delete this.
@Override
public boolean isDefaultEntityContainer() {
return true;
}
@Override
public List<EntitySet> getEntitySets() {
return entitySets;
}
@Override
public List<Singleton> getSingletons() {
return singletons;
}
@Override
public Singleton getSingleton(final String name) {
return getOneByName(name, getSingletons());
}
/**
* Gets the first action import with given name.
*
* @param name name.
* @return action import.
*/
@Override
public ActionImport getActionImport(final String name) {
return getOneByName(name, getActionImports());
}
/**
* Gets all action imports with given name.
*
* @param name name.
* @return action imports.
*/
@Override
public List<ActionImport> getActionImports(final String name) {
return getAllByName(name, getActionImports());
}
@Override
public List<ActionImport> getActionImports() {
return actionImports;
}
@Override
public List<FunctionImport> getFunctionImports() {
return functionImports;
}
@Override
public List<Annotation> getAnnotations() {
return annotations;
}
}

View File

@ -38,7 +38,7 @@ public class EntityKeyDeserializer extends AbstractEdmDeserializer<EntityKeyImpl
if (token == JsonToken.FIELD_NAME && "PropertyRef".equals(jp.getCurrentName())) {
jp.nextToken();
entityKey.getPropertyRefs().add(jp.readValueAs( PropertyRefImpl.class));
entityKey.getPropertyRefs().add(jp.readValueAs(PropertyRefImpl.class));
}
}

View File

@ -21,19 +21,18 @@ package org.apache.olingo.client.core.edm.xml;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.EntityKey;
import org.apache.olingo.client.api.edm.xml.PropertyRef;
import org.apache.olingo.commons.api.edm.provider.AbstractEdmItem;
import org.apache.olingo.commons.api.edm.provider.PropertyRef;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = EntityKeyDeserializer.class)
public class EntityKeyImpl extends AbstractEdmItem implements EntityKey {
public class EntityKeyImpl extends AbstractEdmItem {
private static final long serialVersionUID = 520227585458843347L;
private final List<PropertyRef> propertyRefs = new ArrayList<PropertyRef>();
@Override
public List<PropertyRef> getPropertyRefs() {
return propertyRefs;
}

View File

@ -21,7 +21,7 @@ package org.apache.olingo.client.core.edm.xml;
import java.io.IOException;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.olingo.client.api.edm.xml.EntitySet;
import org.apache.olingo.commons.api.edm.provider.EntitySet;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
@ -42,7 +42,7 @@ public class EntitySetDeserializer extends AbstractEdmDeserializer<EntitySet> {
if ("Name".equals(jp.getCurrentName())) {
entitySet.setName(jp.nextTextValue());
} else if ("EntityType".equals(jp.getCurrentName())) {
entitySet.setEntityType(jp.nextTextValue());
entitySet.setType(jp.nextTextValue());
} else if ("IncludeInServiceDocument".equals(jp.getCurrentName())) {
entitySet.setIncludeInServiceDocument(BooleanUtils.toBoolean(jp.nextTextValue()));
} else if ("NavigationPropertyBinding".equals(jp.getCurrentName())) {

View File

@ -18,65 +18,13 @@
*/
package org.apache.olingo.client.core.edm.xml;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.client.api.edm.xml.EntitySet;
import org.apache.olingo.client.api.edm.xml.NavigationPropertyBinding;
import org.apache.olingo.commons.api.edm.provider.EntitySet;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = EntitySetDeserializer.class)
public class EntitySetImpl extends AbstractEdmItem implements EntitySet {
public class EntitySetImpl extends EntitySet {
private static final long serialVersionUID = -5553885465204370676L;
private boolean includeInServiceDocument = true;
private final List<Annotation> annotations = new ArrayList<Annotation>();
private final List<NavigationPropertyBinding> navigationPropertyBindings = new ArrayList<NavigationPropertyBinding>();
private String name;
private String entityType;
@Override
public String getName() {
return name;
}
public void setName(final String name) {
this.name = name;
}
@Override
public String getEntityType() {
return entityType;
}
public void setEntityType(final String entityType) {
this.entityType = entityType;
}
@Override
public boolean isIncludeInServiceDocument() {
return includeInServiceDocument;
}
public void setIncludeInServiceDocument(final boolean includeInServiceDocument) {
this.includeInServiceDocument = includeInServiceDocument;
}
@Override
public List<NavigationPropertyBinding> getNavigationPropertyBindings() {
return navigationPropertyBindings;
}
@Override
public List<Annotation> getAnnotations() {
return annotations;
}
}

View File

@ -21,7 +21,7 @@ package org.apache.olingo.client.core.edm.xml;
import java.io.IOException;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.olingo.client.api.edm.xml.EntityType;
import org.apache.olingo.commons.api.edm.provider.EntityType;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
@ -42,7 +42,7 @@ public class EntityTypeDeserializer extends AbstractEdmDeserializer<EntityType>
if ("Name".equals(jp.getCurrentName())) {
entityType.setName(jp.nextTextValue());
} else if ("Abstract".equals(jp.getCurrentName())) {
entityType.setAbstractEntityType(BooleanUtils.toBoolean(jp.nextTextValue()));
entityType.setAbstract(BooleanUtils.toBoolean(jp.nextTextValue()));
} else if ("BaseType".equals(jp.getCurrentName())) {
entityType.setBaseType(jp.nextTextValue());
} else if ("OpenType".equals(jp.getCurrentName())) {
@ -51,7 +51,8 @@ public class EntityTypeDeserializer extends AbstractEdmDeserializer<EntityType>
entityType.setHasStream(BooleanUtils.toBoolean(jp.nextTextValue()));
} else if ("Key".equals(jp.getCurrentName())) {
jp.nextToken();
entityType.setKey(jp.readValueAs(EntityKeyImpl.class));
EntityKeyImpl keyImpl = jp.readValueAs(EntityKeyImpl.class);
entityType.setKey(keyImpl.getPropertyRefs());
} else if ("Property".equals(jp.getCurrentName())) {
jp.nextToken();
entityType.getProperties().add(jp.readValueAs(PropertyImpl.class));

View File

@ -18,106 +18,12 @@
*/
package org.apache.olingo.client.core.edm.xml;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.client.api.edm.xml.EntityKey;
import org.apache.olingo.client.api.edm.xml.EntityType;
import org.apache.olingo.client.api.edm.xml.NavigationProperty;
import org.apache.olingo.client.api.edm.xml.Property;
import org.apache.olingo.commons.api.edm.provider.EntityType;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = EntityTypeDeserializer.class)
public class EntityTypeImpl extends AbstractStructuralType implements EntityType {
public class EntityTypeImpl extends EntityType {
private static final long serialVersionUID = -3986417775876689669L;
private final List<Property> properties = new ArrayList<Property>();
private final List<NavigationProperty> navigationProperties = new ArrayList<NavigationProperty>();
private final List<Annotation> annotations = new ArrayList<Annotation>();
private boolean abstractEntityType = false;
private String baseType;
private boolean openType = false;
private boolean hasStream = false;
private EntityKeyImpl key;
@Override
public boolean isAbstractType() {
return abstractEntityType;
}
public void setAbstractEntityType(final boolean abstractEntityType) {
this.abstractEntityType = abstractEntityType;
}
@Override
public String getBaseType() {
return baseType;
}
public void setBaseType(final String baseType) {
this.baseType = baseType;
}
@Override
public boolean isOpenType() {
return openType;
}
public void setOpenType(final boolean openType) {
this.openType = openType;
}
@Override
public EntityKeyImpl getKey() {
return key;
}
public void setKey(final EntityKey key) {
this.key = (EntityKeyImpl) key;
}
@Override
public boolean isHasStream() {
return hasStream;
}
public void setHasStream(final boolean hasStream) {
this.hasStream = hasStream;
}
@Override
public Property getProperty(final String name) {
return super.getProperty(name);
}
@Override
public List<Property> getProperties() {
return properties;
}
@Override
public NavigationProperty getNavigationProperty(final String name) {
return super.getNavigationProperty(name);
}
@Override
public List<NavigationProperty> getNavigationProperties() {
return navigationProperties;
}
@Override
public List<Annotation> getAnnotations() {
return annotations;
}
}

View File

@ -0,0 +1,43 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.core.edm.xml;
import org.apache.olingo.commons.api.edm.provider.EnumMember;
import com.fasterxml.jackson.annotation.JsonProperty;
public class EnumMemberImpl extends EnumMember {
private static final long serialVersionUID = -6138606817225829791L;
@Override
@JsonProperty(value = "Name", required = true)
public EnumMember setName(final String name) {
super.setName(name);
return this;
}
@Override
@JsonProperty("Value")
public EnumMember setValue(final String value) {
super.setValue(value);
return this;
}
}

View File

@ -46,7 +46,7 @@ public class EnumTypeDeserializer extends AbstractEdmDeserializer<EnumTypeImpl>
enumType.setFlags(BooleanUtils.toBoolean(jp.nextTextValue()));
} else if ("Member".equals(jp.getCurrentName())) {
jp.nextToken();
enumType.getMembers().add(jp.readValueAs(MemberImpl.class));
enumType.getMembers().add(jp.readValueAs(EnumMemberImpl.class));
} else if ("Annotation".equals(jp.getCurrentName())) {
jp.nextToken();
enumType.getAnnotations().add(jp.readValueAs(AnnotationImpl.class));

View File

@ -18,88 +18,13 @@
*/
package org.apache.olingo.client.core.edm.xml;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.Annotatable;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.client.api.edm.xml.EnumType;
import org.apache.olingo.client.api.edm.xml.Member;
import org.apache.olingo.commons.api.edm.provider.EnumType;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = EnumTypeDeserializer.class)
public class EnumTypeImpl extends AbstractEdmItem implements EnumType, Annotatable {
public class EnumTypeImpl extends EnumType {
private static final long serialVersionUID = 9191189755592743333L;
private final List<Annotation> annotations = new ArrayList<Annotation>();
private String name;
private String underlyingType;
private boolean flags;
private final List<Member> members = new ArrayList<Member>();
@Override
public String getName() {
return name;
}
public void setName(final String name) {
this.name = name;
}
@Override
public String getUnderlyingType() {
return underlyingType;
}
public void setUnderlyingType(final String underlyingType) {
this.underlyingType = underlyingType;
}
@Override
public boolean isFlags() {
return flags;
}
public void setFlags(final boolean flags) {
this.flags = flags;
}
@Override
public Member getMember(final String name) {
Member result = null;
for (Member member : getMembers()) {
if (name.equals(member.getName())) {
result = member;
}
}
return result;
}
@Override
public Member getMember(final Integer value) {
Member result = null;
for (Member member : getMembers()) {
if (String.valueOf(value).equals(member.getValue())) {
result = member;
}
}
return result;
}
@Override
public List<Member> getMembers() {
return members;
}
@Override
public List<Annotation> getAnnotations() {
return annotations;
}
}

View File

@ -18,24 +18,13 @@
*/
package org.apache.olingo.client.core.edm.xml;
import org.apache.olingo.client.api.edm.xml.Function;
import org.apache.olingo.commons.api.edm.provider.Function;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = FunctionDeserializer.class)
public class FunctionImpl extends ActionImpl implements Function {
public class FunctionImpl extends Function {
private static final long serialVersionUID = -5494898295282843362L;
private boolean composable = false;
@Override
public boolean isComposable() {
return composable;
}
public void setComposable(final boolean composable) {
this.composable = composable;
}
}

View File

@ -18,69 +18,12 @@
*/
package org.apache.olingo.client.core.edm.xml;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.client.api.edm.xml.FunctionImport;
import org.apache.olingo.commons.api.edm.provider.FunctionImport;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = FunctionImportDeserializer.class)
public class FunctionImportImpl implements FunctionImport {
public class FunctionImportImpl extends FunctionImport {
private static final long serialVersionUID = -1686801084142932402L;
private String name;
private String function;
private String entitySet;
private boolean includeInServiceDocument = false;
private final List<Annotation> annotations = new ArrayList<Annotation>();
@Override
public String getName() {
return name;
}
public void setName(final String name) {
this.name = name;
}
@Override
public String getFunction() {
return function;
}
public void setFunction(final String function) {
this.function = function;
}
@Override
public String getEntitySet() {
return entitySet;
}
@Override
public void setEntitySet(final String entitySet) {
this.entitySet = entitySet;
}
@Override
public boolean isIncludeInServiceDocument() {
return includeInServiceDocument;
}
public void setIncludeInServiceDocument(final boolean includeInServiceDocument) {
this.includeInServiceDocument = includeInServiceDocument;
}
@Override
public List<Annotation> getAnnotations() {
return annotations;
}
}

View File

@ -19,6 +19,7 @@
package org.apache.olingo.client.core.edm.xml;
import org.apache.olingo.client.api.edm.xml.IncludeAnnotations;
import org.apache.olingo.commons.api.edm.provider.AbstractEdmItem;
import com.fasterxml.jackson.annotation.JsonProperty;

View File

@ -19,6 +19,7 @@
package org.apache.olingo.client.core.edm.xml;
import org.apache.olingo.client.api.edm.xml.Include;
import org.apache.olingo.commons.api.edm.provider.AbstractEdmItem;
import com.fasterxml.jackson.annotation.JsonProperty;

View File

@ -1,65 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.core.edm.xml;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.Annotatable;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.client.api.edm.xml.Member;
import com.fasterxml.jackson.annotation.JsonProperty;
public class MemberImpl extends AbstractEdmItem implements Member, Annotatable {
private static final long serialVersionUID = -6138606817225829791L;
private final List<Annotation> annotations = new ArrayList<Annotation>();
@JsonProperty(value = "Name", required = true)
private String name;
@JsonProperty("Value")
private String value;
@Override
public String getName() {
return name;
}
public void setName(final String name) {
this.name = name;
}
@Override
public String getValue() {
return value;
}
public void setValue(final String value) {
this.value = value;
}
@Override
public List<Annotation> getAnnotations() {
return annotations;
}
}

View File

@ -1,53 +1,42 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.core.edm.xml;
import org.apache.olingo.client.api.edm.xml.NavigationPropertyBinding;
import org.apache.olingo.commons.api.edm.provider.NavigationPropertyBinding;
import com.fasterxml.jackson.annotation.JsonProperty;
public class NavigationPropertyBindingImpl extends AbstractEdmItem implements NavigationPropertyBinding {
public class NavigationPropertyBindingImpl extends NavigationPropertyBinding {
private static final long serialVersionUID = -7056978592235483660L;
@Override
@JsonProperty(value = "Path", required = true)
private String path;
public NavigationPropertyBinding setPath(final String path) {
super.setPath(path);
return this;
}
@Override
@JsonProperty(value = "Target", required = true)
private String target;
@Override
public String getPath() {
return path;
public NavigationPropertyBinding setTarget(final String target) {
super.setTarget(target);
return this;
}
public void setPath(final String path) {
this.path = path;
}
@Override
public String getTarget() {
return target;
}
public void setTarget(final String target) {
this.target = target;
}
}

View File

@ -1,119 +1,44 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.core.edm.xml;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.client.api.edm.xml.NavigationProperty;
import org.apache.olingo.client.api.edm.xml.OnDelete;
import org.apache.olingo.client.api.edm.xml.ReferentialConstraint;
import org.apache.olingo.commons.api.edm.provider.NavigationProperty;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = NavigationPropertyDeserializer.class)
public class NavigationPropertyImpl extends AbstractEdmItem implements NavigationProperty {
public class NavigationPropertyImpl extends NavigationProperty {
private static final long serialVersionUID = 6240231735592427582L;
@Override
@JsonProperty(value = "Name", required = true)
private String name;
public NavigationProperty setName(final String name) {
super.setName(name);
return this;
}
@Override
@JsonProperty(value = "ContainsTarget")
private boolean containsTarget = false;
private String type;
private boolean nullable = true;
private String partner;
private final List<ReferentialConstraint> referentialConstraints = new ArrayList<ReferentialConstraint>();
private OnDelete onDelete;
private final List<Annotation> annotations = new ArrayList<Annotation>();
@Override
public String getType() {
return type;
public NavigationProperty setContainsTarget(final boolean containsTarget) {
super.setContainsTarget(containsTarget);
return this;
}
public void setType(final String type) {
this.type = type;
}
@Override
public boolean isNullable() {
return nullable;
}
public void setNullable(final boolean nullable) {
this.nullable = nullable;
}
@Override
public String getPartner() {
return partner;
}
public void setPartner(final String partner) {
this.partner = partner;
}
@Override
public List<ReferentialConstraint> getReferentialConstraints() {
return referentialConstraints;
}
@Override
public OnDelete getOnDelete() {
return onDelete;
}
public void setOnDelete(final OnDelete onDelete) {
this.onDelete = onDelete;
}
@Override
public List<Annotation> getAnnotations() {
return annotations;
}
@Override
public String getName() {
return name;
}
public void setName(final String name) {
this.name = name;
}
@Override
public boolean isContainsTarget() {
return containsTarget;
}
public void setContainsTarget(final boolean containsTarget) {
this.containsTarget = containsTarget;
}
}

View File

@ -18,25 +18,19 @@
*/
package org.apache.olingo.client.core.edm.xml;
import org.apache.olingo.client.api.edm.xml.OnDelete;
import org.apache.olingo.client.api.edm.xml.OnDeleteAction;
import org.apache.olingo.commons.api.edm.provider.OnDelete;
import org.apache.olingo.commons.api.edm.provider.OnDeleteAction;
import com.fasterxml.jackson.annotation.JsonProperty;
public class OnDeleteImpl extends AbstractEdmItem implements OnDelete {
public class OnDeleteImpl extends OnDelete {
private static final long serialVersionUID = -7130889202653716784L;
@JsonProperty(value = "Action", required = true)
private OnDeleteAction action = OnDeleteAction.None;
@Override
public OnDeleteAction getAction() {
return action;
@JsonProperty(value = "Action", required = true)
public OnDelete setAction(final OnDeleteAction action) {
super.setAction(action);
return this;
}
public void setAction(final OnDeleteAction action) {
this.action = action;
}
}

View File

@ -18,102 +18,12 @@
*/
package org.apache.olingo.client.core.edm.xml;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.client.api.edm.xml.Parameter;
import org.apache.olingo.commons.api.edm.geo.SRID;
import org.apache.olingo.commons.api.edm.provider.Parameter;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = ParameterDeserializer.class)
public class ParameterImpl extends AbstractEdmItem implements Parameter {
public class ParameterImpl extends Parameter {
private static final long serialVersionUID = 7119478691341167904L;
private SRID srid;
private final List<Annotation> annotations = new ArrayList<Annotation>();
private String name;
private String type;
private boolean nullable = true;
private Integer maxLength;
private Integer precision;
private Integer scale;
@Override
public String getName() {
return name;
}
public void setName(final String name) {
this.name = name;
}
@Override
public String getType() {
return type;
}
public void setType(final String type) {
this.type = type;
}
@Override
public boolean isNullable() {
return nullable;
}
public void setNullable(final boolean nullable) {
this.nullable = nullable;
}
@Override
public Integer getMaxLength() {
return maxLength;
}
public void setMaxLength(final Integer maxLength) {
this.maxLength = maxLength;
}
@Override
public Integer getPrecision() {
return precision;
}
public void setPrecision(final Integer precision) {
this.precision = precision;
}
@Override
public Integer getScale() {
return scale;
}
public void setScale(final Integer scale) {
this.scale = scale;
}
@Override
public SRID getSrid() {
return srid;
}
public void setSrid(final SRID srid) {
this.srid = srid;
}
@Override
public List<Annotation> getAnnotations() {
return annotations;
}
}

View File

@ -18,123 +18,11 @@
*/
package org.apache.olingo.client.core.edm.xml;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.client.api.edm.xml.Property;
import org.apache.olingo.commons.api.edm.geo.SRID;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = PropertyDeserializer.class)
public class PropertyImpl extends AbstractEdmItem implements Property {
public class PropertyImpl extends org.apache.olingo.commons.api.edm.provider.Property {
private static final long serialVersionUID = 4544336801968719526L;
private static final long serialVersionUID = -4521766603286651372L;
private final List<Annotation> annotations = new ArrayList<Annotation>();
private String name;
private String type;
private boolean nullable = true;
private String defaultValue;
private Integer maxLength;
private Integer precision;
private Integer scale;
private boolean unicode = true;
private SRID srid;
@Override
public String getName() {
return name;
}
public void setName(final String name) {
this.name = name;
}
@Override
public String getType() {
return type;
}
public void setType(final String type) {
this.type = type;
}
@Override
public boolean isNullable() {
return nullable;
}
public void setNullable(final boolean nullable) {
this.nullable = nullable;
}
@Override
public String getDefaultValue() {
return defaultValue;
}
public void setDefaultValue(final String defaultValue) {
this.defaultValue = defaultValue;
}
@Override
public Integer getMaxLength() {
return maxLength;
}
public void setMaxLength(final Integer maxLength) {
this.maxLength = maxLength;
}
@Override
public Integer getPrecision() {
return precision;
}
public void setPrecision(final Integer precision) {
this.precision = precision;
}
@Override
public Integer getScale() {
return scale;
}
public void setScale(final Integer scale) {
this.scale = scale;
}
@Override
public boolean isUnicode() {
return unicode;
}
public void setUnicode(final boolean unicode) {
this.unicode = unicode;
}
@Override
public SRID getSrid() {
return srid;
}
public void setSrid(final SRID srid) {
this.srid = srid;
}
@Override
public List<Annotation> getAnnotations() {
return annotations;
}
}

View File

@ -1,53 +1,42 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.core.edm.xml;
import org.apache.olingo.client.api.edm.xml.PropertyRef;
import org.apache.olingo.commons.api.edm.provider.PropertyRef;
import com.fasterxml.jackson.annotation.JsonProperty;
public class PropertyRefImpl extends AbstractEdmItem implements PropertyRef {
public class PropertyRefImpl extends PropertyRef {
private static final long serialVersionUID = 1504095609268590326L;
@Override
@JsonProperty(value = "Name", required = true)
private String name;
public PropertyRef setName(final String name) {
super.setName(name);
return this;
}
@Override
@JsonProperty(value = "Alias")
private String alias;
@Override
public String getName() {
return name;
public PropertyRef setAlias(final String alias) {
super.setAlias(alias);
return this;
}
public void setName(final String name) {
this.name = name;
}
@Override
public String getAlias() {
return alias;
}
public void setAlias(final String alias) {
this.alias = alias;
}
}

View File

@ -22,10 +22,11 @@ import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.client.api.edm.xml.Include;
import org.apache.olingo.client.api.edm.xml.IncludeAnnotations;
import org.apache.olingo.client.api.edm.xml.Reference;
import org.apache.olingo.commons.api.edm.provider.AbstractEdmItem;
import org.apache.olingo.commons.api.edm.provider.Annotation;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

View File

@ -1,64 +1,43 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.core.edm.xml;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.client.api.edm.xml.ReferentialConstraint;
import org.apache.olingo.commons.api.edm.provider.ReferentialConstraint;
import com.fasterxml.jackson.annotation.JsonProperty;
public class ReferentialConstraintImpl extends AbstractEdmItem implements ReferentialConstraint {
public class ReferentialConstraintImpl extends ReferentialConstraint {
private static final long serialVersionUID = -5822115908069878139L;
@Override
@JsonProperty(value = "Property", required = true)
private String property;
public ReferentialConstraint setProperty(final String property) {
super.setProperty(property);
return this;
}
@Override
@JsonProperty(value = "ReferencedProperty", required = true)
private String referencedProperty;
private final List<Annotation> annotations = new ArrayList<Annotation>();
@Override
public List<Annotation> getAnnotations() {
return annotations;
}
@Override
public String getProperty() {
return property;
}
public void setProperty(final String property) {
this.property = property;
}
@Override
public String getReferencedProperty() {
return referencedProperty;
}
public void setReferencedProperty(final String referencedProperty) {
this.referencedProperty = referencedProperty;
public ReferentialConstraint setReferencedProperty(final String referencedProperty) {
super.setReferencedProperty(referencedProperty);
return this;
}
}

View File

@ -18,80 +18,12 @@
*/
package org.apache.olingo.client.core.edm.xml;
import org.apache.olingo.client.api.edm.xml.ReturnType;
import org.apache.olingo.commons.api.edm.geo.SRID;
import org.apache.olingo.commons.api.edm.provider.ReturnType;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = ReturnTypeDeserializer.class)
public class ReturnTypeImpl extends AbstractEdmItem implements ReturnType {
public class ReturnTypeImpl extends ReturnType {
private static final long serialVersionUID = 6261092793901735110L;
private String type;
private boolean nullable = true;
private Integer maxLength;
private Integer precision;
private Integer scale;
private SRID srid;
@Override
public String getType() {
return type;
}
public void setType(final String type) {
this.type = type;
}
@Override
public boolean isNullable() {
return nullable;
}
public void setNullable(final boolean nullable) {
this.nullable = nullable;
}
@Override
public Integer getMaxLength() {
return maxLength;
}
public void setMaxLength(final Integer maxLength) {
this.maxLength = maxLength;
}
@Override
public Integer getPrecision() {
return precision;
}
public void setPrecision(final Integer precision) {
this.precision = precision;
}
@Override
public Integer getScale() {
return scale;
}
public void setScale(final Integer scale) {
this.scale = scale;
}
@Override
public SRID getSrid() {
return srid;
}
public void setSrid(final SRID srid) {
this.srid = srid;
}
}

View File

@ -18,261 +18,13 @@
*/
package org.apache.olingo.client.core.edm.xml;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.olingo.client.api.edm.xml.Action;
import org.apache.olingo.client.api.edm.xml.ActionImport;
import org.apache.olingo.client.api.edm.xml.Annotatable;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.client.api.edm.xml.Annotations;
import org.apache.olingo.client.api.edm.xml.ComplexType;
import org.apache.olingo.client.api.edm.xml.EntityContainer;
import org.apache.olingo.client.api.edm.xml.EntitySet;
import org.apache.olingo.client.api.edm.xml.EntityType;
import org.apache.olingo.client.api.edm.xml.EnumType;
import org.apache.olingo.client.api.edm.xml.Function;
import org.apache.olingo.client.api.edm.xml.FunctionImport;
import org.apache.olingo.client.api.edm.xml.Schema;
import org.apache.olingo.client.api.edm.xml.Singleton;
import org.apache.olingo.client.api.edm.xml.Term;
import org.apache.olingo.client.api.edm.xml.TypeDefinition;
import org.apache.olingo.commons.api.edm.provider.Schema;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = SchemaDeserializer.class)
public class SchemaImpl extends AbstractEdmItem implements Schema {
public class SchemaImpl extends Schema {
private static final long serialVersionUID = 1911087363912024939L;
private final List<Action> actions = new ArrayList<Action>();
private final List<Annotations> annotationGroups = new ArrayList<Annotations>();
private final List<Annotation> annotations = new ArrayList<Annotation>();
private final List<ComplexType> complexTypes = new ArrayList<ComplexType>();
private EntityContainer entityContainer;
private final List<EnumType> enumTypes = new ArrayList<EnumType>();
private final List<EntityType> entityTypes = new ArrayList<EntityType>();
private final List<Function> functions = new ArrayList<Function>();
private final List<Term> terms = new ArrayList<Term>();
private final List<TypeDefinition> typeDefinitions = new ArrayList<TypeDefinition>();
private Map<String, Annotatable> annotatables;
private String namespace;
private String alias;
@Override
public String getNamespace() {
return namespace;
}
public void setNamespace(final String namespace) {
this.namespace = namespace;
}
@Override
public String getAlias() {
return alias;
}
public void setAlias(final String alias) {
this.alias = alias;
}
@Override
public EnumType getEnumType(final String name) {
return getOneByName(name, getEnumTypes());
}
@Override
public ComplexType getComplexType(final String name) {
return getOneByName(name, getComplexTypes());
}
@Override
public EntityType getEntityType(final String name) {
return getOneByName(name, getEntityTypes());
}
@Override
public List<Action> getActions() {
return actions;
}
@Override
public List<Action> getActions(final String name) {
return getAllByName(name, getActions());
}
@Override
public List<Annotations> getAnnotationGroups() {
return annotationGroups;
}
@Override
public Annotations getAnnotationGroup(final String target) {
Annotations result = null;
for (Annotations annots : getAnnotationGroups()) {
if (target.equals(annots.getTarget())) {
result = annots;
}
}
return result;
}
@Override
public Annotation getAnnotation(final String term) {
Annotation result = null;
for (Annotation annot : getAnnotations()) {
if (term.equals(annot.getTerm())) {
result = annot;
}
}
return result;
}
@Override
public List<Annotation> getAnnotations() {
return annotations;
}
@Override
public List<Function> getFunctions() {
return functions;
}
@Override
public List<Function> getFunctions(final String name) {
return getAllByName(name, getFunctions());
}
@Override
public Term getTerm(final String name) {
return getOneByName(name, getTerms());
}
@Override
public List<Term> getTerms() {
return terms;
}
@Override
public TypeDefinition getTypeDefinition(final String name) {
return getOneByName(name, getTypeDefinitions());
}
@Override
public List<TypeDefinition> getTypeDefinitions() {
return typeDefinitions;
}
@Override
public EntityContainer getEntityContainer() {
return entityContainer;
}
public void setEntityContainer(final EntityContainerImpl entityContainer) {
this.entityContainer = entityContainer;
}
@Override
public List<EntityContainer> getEntityContainers() {
return entityContainer == null
? Collections.<EntityContainer>emptyList() : Collections.singletonList(entityContainer);
}
@Override
public EntityContainer getDefaultEntityContainer() {
return entityContainer;
}
@Override
public EntityContainer getEntityContainer(final String name) {
if (entityContainer != null && name.equals(entityContainer.getName())) {
return entityContainer;
}
return null;
}
@Override
public List<EnumType> getEnumTypes() {
return enumTypes;
}
@Override
public List<ComplexType> getComplexTypes() {
return complexTypes;
}
@Override
public List<EntityType> getEntityTypes() {
return entityTypes;
}
@Override
public Map<String, Annotatable> getAnnotatables() {
if (annotatables == null) {
annotatables = new HashMap<String, Annotatable>();
for (Annotations annotationGroup : getAnnotationGroups()) {
annotatables.put(null, annotationGroup);
}
for (Annotation annotation : getAnnotations()) {
annotatables.put(annotation.getTerm(), annotation);
}
for (Action action : getActions()) {
annotatables.put(action.getName(), action);
}
for (ComplexType complexType : getComplexTypes()) {
annotatables.put(complexType.getName(), complexType);
}
for (EntityType entityType : getEntityTypes()) {
annotatables.put(entityType.getName(), entityType);
}
for (EnumType enumType : getEnumTypes()) {
annotatables.put(enumType.getName(), (EnumTypeImpl) enumType);
}
for (Function function : getFunctions()) {
annotatables.put(function.getName(), function);
}
for (Term term : getTerms()) {
annotatables.put(term.getName(), term);
}
for (TypeDefinition typedef : getTypeDefinitions()) {
annotatables.put(typedef.getName(), typedef);
}
if (entityContainer != null) {
annotatables.put(entityContainer.getName(), entityContainer);
for (Annotation annotation : entityContainer.getAnnotations()) {
annotatables.put(annotation.getTerm(), annotation);
}
for (ActionImport actionImport : entityContainer.getActionImports()) {
annotatables.put(actionImport.getName(), actionImport);
}
for (FunctionImport functionImport : entityContainer.getFunctionImports()) {
annotatables.put(functionImport.getName(), functionImport);
}
for (EntitySet entitySet : entityContainer.getEntitySets()) {
annotatables.put(entitySet.getName(), entitySet);
}
for (Singleton singleton : entityContainer.getSingletons()) {
annotatables.put(singleton.getName(), singleton);
}
}
}
return annotatables;
}
}

View File

@ -39,7 +39,7 @@ public class SingletonDeserializer extends AbstractEdmDeserializer<SingletonImpl
if ("Name".equals(jp.getCurrentName())) {
singleton.setName(jp.nextTextValue());
} else if ("Type".equals(jp.getCurrentName())) {
singleton.setEntityType(jp.nextTextValue());
singleton.setType(jp.nextTextValue());
} else if ("NavigationPropertyBinding".equals(jp.getCurrentName())) {
jp.nextToken();
singleton.getNavigationPropertyBindings().add(

View File

@ -1,77 +1,30 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.core.edm.xml;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.client.api.edm.xml.NavigationPropertyBinding;
import org.apache.olingo.client.api.edm.xml.Singleton;
import org.apache.olingo.commons.api.edm.provider.Singleton;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = SingletonDeserializer.class)
public class SingletonImpl extends AbstractEdmItem implements Singleton {
public class SingletonImpl extends Singleton {
private static final long serialVersionUID = 1656749615107151921L;
private String name;
private String entityType;
private final List<NavigationPropertyBinding> navigationPropertyBindings = new ArrayList<NavigationPropertyBinding>();
private final List<Annotation> annotations = new ArrayList<Annotation>();
@Override
public List<Annotation> getAnnotations() {
return annotations;
}
@Override
public String getName() {
return name;
}
public void setName(final String name) {
this.name = name;
}
@Override
public String getEntityType() {
return entityType;
}
public void setEntityType(final String entityType) {
this.entityType = entityType;
}
@Override
public List<NavigationPropertyBinding> getNavigationPropertyBindings() {
return navigationPropertyBindings;
}
//TODO: includeInServiceDocument is always false for singletons
@Override
public boolean isIncludeInServiceDocument() {
return false;
}
}

View File

@ -18,131 +18,13 @@
*/
package org.apache.olingo.client.core.edm.xml;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.client.api.edm.xml.Annotation;
import org.apache.olingo.client.api.edm.xml.Term;
import org.apache.olingo.commons.api.edm.geo.SRID;
import org.apache.olingo.commons.api.edm.provider.Term;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = TermDeserializer.class)
public class TermImpl extends AbstractEdmItem implements Term {
public class TermImpl extends Term {
private static final long serialVersionUID = -8350072064720586186L;
private String name;
private String type;
private String baseTerm;
private String defaultValue;
private boolean nullable = true;
private Integer maxLength;
private Integer precision;
private Integer scale;
private SRID srid;
private final List<String> appliesTo = new ArrayList<String>();
private final List<Annotation> annotations = new ArrayList<Annotation>();
@Override
public List<Annotation> getAnnotations() {
return annotations;
}
@Override
public String getName() {
return name;
}
public void setName(final String name) {
this.name = name;
}
@Override
public String getType() {
return type;
}
public void setType(final String type) {
this.type = type;
}
@Override
public String getBaseTerm() {
return baseTerm;
}
public void setBaseTerm(final String baseTerm) {
this.baseTerm = baseTerm;
}
@Override
public String getDefaultValue() {
return defaultValue;
}
public void setDefaultValue(final String defaultValue) {
this.defaultValue = defaultValue;
}
@Override
public boolean isNullable() {
return nullable;
}
public void setNullable(final boolean nullable) {
this.nullable = nullable;
}
@Override
public Integer getMaxLength() {
return maxLength;
}
public void setMaxLength(final Integer maxLength) {
this.maxLength = maxLength;
}
@Override
public Integer getPrecision() {
return precision;
}
public void setPrecision(final Integer precision) {
this.precision = precision;
}
@Override
public Integer getScale() {
return scale;
}
public void setScale(final Integer scale) {
this.scale = scale;
}
@Override
public SRID getSrid() {
return srid;
}
public void setSrid(final SRID srid) {
this.srid = srid;
}
@Override
public List<String> getAppliesTo() {
return appliesTo;
}
}

Some files were not shown because too many files have changed in this diff Show More