
ingo.pojogen-maven-plugin.4.2.0.source-code.container.vm Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pojogen-maven-plugin Show documentation
Show all versions of pojogen-maven-plugin Show documentation
Java client API for OData services: Maven plugin generating POJOs from metadata.
#*
* 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.
*#
#set( $clsSuffix = ".class" )
package ${package};
//CHECKSTYLE:OFF (Maven checkstyle)
import org.apache.olingo.commons.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.PersistenceManager;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.ext.proxy.api.ComplexCollection;
import org.apache.olingo.ext.proxy.api.ComplexType;
import org.apache.olingo.ext.proxy.api.EntityCollection;
import org.apache.olingo.ext.proxy.api.EntityType;
import org.apache.olingo.ext.proxy.api.PrimitiveCollection;
import org.apache.olingo.ext.proxy.api.EdmStreamValue;
#foreach($ns in $namespaces)
import #if($basePackage)${basePackage}.#end${ns}.types.*;
#end
import org.apache.olingo.commons.api.edm.geo.Geospatial;
import org.apache.olingo.commons.api.edm.geo.GeospatialCollection;
import org.apache.olingo.commons.api.edm.geo.LineString;
import org.apache.olingo.commons.api.edm.geo.MultiLineString;
import org.apache.olingo.commons.api.edm.geo.MultiPoint;
import org.apache.olingo.commons.api.edm.geo.MultiPolygon;
import org.apache.olingo.commons.api.edm.geo.Point;
import org.apache.olingo.commons.api.edm.geo.Polygon;
import java.math.BigDecimal;
import java.net.URI;
import java.io.Serializable;
import java.io.InputStream;
import java.util.UUID;
import java.util.Collection;
import java.util.Calendar;
import javax.xml.datatype.Duration;
//CHECKSTYLE:ON (Maven checkstyle)
@org.apache.olingo.ext.proxy.api.annotations.Namespace("$namespace")
@org.apache.olingo.ext.proxy.api.annotations.EntityContainer(name = "$container.Name",
namespace = "$namespace")
public interface $utility.capitalize($container.Name) extends PersistenceManager {
#foreach($entitySet in $container.EntitySets)
$utility.capitalize($entitySet.Name) get$utility.capitalize($entitySet.Name)();
#end
#foreach($singleton in $container.Singletons)
@org.apache.olingo.ext.proxy.api.annotations.Singleton(
name = "$singleton.Name",
container = "${container.Namespace}.${container.Name}")
$utility.getJavaType($singleton.EntityType) get$utility.capitalize($singleton.Name)();
#end
Operations operations();
public interface Operations extends org.apache.olingo.ext.proxy.api.Operations {
#foreach($operation in $container.FunctionImports)
#foreach($function in $operation.UnboundFunctions)
#if($function.ReturnType)#*
*##set($defaultType = $utility.getJavaType($function.ReturnType.Type, $function.ReturnType.Collection))#*
*##if($function.Composable)#*
*##set($composable = "ComposableInvoker<$defaultType, ${defaultType}.Operations>")#*
*##{else}#*
*##set($composable = "Invoker<$defaultType>")#*
*##end#*
*##if(!($function.getReturnType().isCollection() || ${function.ReturnType.Type.Kind} == "ENTITY" || ${function.ReturnType.Type.Kind} == "COMPLEX" || $utility.isStreamType($function.ReturnType.Type)))#*
*##set($returnType = "org.apache.olingo.ext.proxy.api.Invoker<$defaultType>")#*
*##else#*
*##if(${function.ReturnType.Type.Kind} == "ENTITY" || ${function.ReturnType.Type.Kind} == "COMPLEX")#*
*##if($function.getReturnType().isCollection())#*
*##if($function.Composable)#*
*##set($returnType = "${defaultType}ComposableInvoker")#*
*##{else}#*
*##set($returnType = "org.apache.olingo.ext.proxy.api.StructuredCollectionInvoker<$defaultType>")#*
*##end#*
*##{else}#*
*##if($function.Composable)#*
*##set($returnType = "${defaultType}ComposableInvoker")#*
*##{else}#*
*##set($returnType = "org.apache.olingo.ext.proxy.api.StructuredInvoker<$defaultType>")#*
*##end#*
*##end#*
*##{else}#*
*##if($function.getReturnType().isCollection())#*
*##set($returnType = "org.apache.olingo.ext.proxy.api.PrimitiveCollectionInvoker<$defaultType>")#*
*##{else}#*
*##set($returnType = "org.apache.olingo.ext.proxy.api.Invoker<$defaultType>")#*
*##end#*
*##end#*
*##end#*
*##{else}#*
*##set($returnType = "org.apache.olingo.ext.proxy.api.Invoker")#*
*##end
@org.apache.olingo.ext.proxy.api.annotations.Operation(name = "$function.Name",
type = OperationType.FUNCTION,
isComposable = $function.Composable#if($function.ReturnType),
#if($function.ReturnType)referenceType = ${defaultType.replaceAll("<.*>", "")}.class,#end
returnType = "#if( $function.ReturnType.Collection )Collection(#end$function.ReturnType.Type.FullQualifiedName.toString()#if( $function.ReturnType.Collection ))#end"#end)
$returnType $utility.uncapitalize($function.Name)(
#if($function.ParameterNames)
#set( $count = $function.ParameterNames.size() )#*
*##foreach($paramName in $function.ParameterNames)#*
*##set( $count = $count - 1 )#*
*##set( $param = $function.getParameter($paramName) )#*
*# @org.apache.olingo.ext.proxy.api.annotations.Parameter(name = "$param.Name", type = "#if( $param.Collection )Collection(#end$param.Type.FullQualifiedName.toString()#if( $param.Collection ))#end", nullable = $param.Nullable) $utility.getJavaType($param.Type, $param.Collection) $utility.uncapitalize($param.Name)#if( $count > 0 ), #end
#end#*
*##end);
#end
#end
#foreach($operation in $container.ActionImports)
#set( $action = $operation.UnboundAction )
#if($action)
#if($action.ReturnType)#*
*##set($defaultType = $utility.getJavaType($action.ReturnType.Type, $action.ReturnType.Collection))#*
*##if(!($action.getReturnType().isCollection() || ${action.ReturnType.Type.Kind} == "ENTITY" || ${action.ReturnType.Type.Kind} == "COMPLEX" || $utility.isStreamType($action.ReturnType.Type)))#*
*##set($returnType = "org.apache.olingo.ext.proxy.api.Invoker<$defaultType>")#*
*##else#*
*##if(${action.ReturnType.Type.Kind} == "ENTITY" || ${action.ReturnType.Type.Kind} == "COMPLEX")#*
*##if($action.getReturnType().isCollection())#*
*##set($returnType = "org.apache.olingo.ext.proxy.api.StructuredCollectionInvoker<$defaultType>")#*
*##{else}#*
*##set($returnType = "org.apache.olingo.ext.proxy.api.StructuredInvoker<$defaultType>")#*
*##end#*
*##{else}#*
*##if($action.getReturnType().isCollection())#*
*##set($returnType = "org.apache.olingo.ext.proxy.api.PrimitiveCollectionInvoker<$defaultType>")#*
*##{else}#*
*##set($returnType = "org.apache.olingo.ext.proxy.api.Invoker<$defaultType>")#*
*##end#*
*##end#*
*##end#*
*##{else}#*
*##set($returnType = "org.apache.olingo.ext.proxy.api.Invoker")#*
*##end
@org.apache.olingo.ext.proxy.api.annotations.Operation(name = "$action.Name",
type = OperationType.ACTION#if($action.ReturnType),
#if($action.ReturnType)referenceType = ${defaultType.replaceAll("<.*>", "")}.class,#end
returnType = "#if( $action.ReturnType.Collection )Collection(#end$action.ReturnType.Type.FullQualifiedName.toString()#if( $action.ReturnType.Collection ))#end"#end)
$returnType $utility.uncapitalize($action.Name)(
#if($action.ParameterNames)
#set( $count = $action.ParameterNames.size() )#*
*##foreach($paramName in $action.ParameterNames)#*
*##set( $count = $count - 1 )#*
*##set( $param = $action.getParameter($paramName) )#*
*# @org.apache.olingo.ext.proxy.api.annotations.Parameter(name = "$param.Name", type = "#if( $param.Collection )Collection(#end$param.Type.FullQualifiedName.toString()#if( $param.Collection ))#end", nullable = $param.Nullable) $utility.getJavaType($param.Type, $param.Collection) $utility.uncapitalize($param.Name)#if( $count > 0 ), #end
#end#*
*##end);
#set( $action = false )
#end
#end
}
> NE newEntityInstance(Class ref);
, NEC extends EntityCollection> NEC newEntityCollection(Class ref);
> NE newComplexInstance(Class ref);
, NEC extends ComplexCollection> NEC newComplexCollection(Class ref);
> NEC newPrimitiveCollection(Class ref);
EdmStreamValue newEdmStreamValue(String contentType, InputStream stream);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy