Adding missing method to Edm interfaces to check whether an entity or a complex type is abstract

This commit is contained in:
Francesco Chicchiriccò 2014-04-30 09:13:08 +02:00
parent 8a6bcb3d2a
commit 10f03a2c0a
8 changed files with 38 additions and 2 deletions

View File

@ -69,4 +69,8 @@ public class EdmComplexTypeImpl extends AbstractEdmComplexType {
return helper.isOpenType();
}
@Override
public boolean isAbstract() {
return helper.isAbstract();
}
}

View File

@ -83,4 +83,8 @@ public class EdmEntityTypeImpl extends AbstractEdmEntityType {
return helper.isOpenType();
}
@Override
public boolean isAbstract() {
return helper.isAbstract();
}
}

View File

@ -80,4 +80,12 @@ public class EdmStructuredTypeHelperImpl implements EdmStructuredTypeHelper {
: false;
}
@Override
public boolean isAbstract() {
return complexType instanceof org.apache.olingo.client.api.edm.xml.v4.ComplexType
? ((org.apache.olingo.client.api.edm.xml.v4.ComplexType) complexType).isAbstractEntityType()
: complexType instanceof EntityType
? ((EntityType) complexType).isAbstractEntityType()
: false;
}
}

View File

@ -81,9 +81,16 @@ public interface EdmStructuredType extends EdmType {
boolean compatibleTo(EdmType targetType);
/**
* Indicates if the entity type is an open type.
* Indicates if the structured type is an open type.
*
* @return <code>true</code> if the entity type is open
* @return <code>true</code> if the structured type is open
*/
boolean isOpenType();
/**
* Indicates if the structured type is abstract.
*
* @return <code>true</code> if the structured type is abstract
*/
boolean isAbstract();
}

View File

@ -31,4 +31,5 @@ public interface EdmStructuredTypeHelper {
boolean isOpenType();
boolean isAbstract();
}

View File

@ -59,4 +59,8 @@ public class EdmComplexTypeImpl extends AbstractEdmComplexType {
return helper.isOpenType();
}
@Override
public boolean isAbstract() {
return helper.isAbstract();
}
}

View File

@ -93,4 +93,8 @@ public class EdmEntityTypeImpl extends AbstractEdmEntityType {
return helper.isOpenType();
}
@Override
public boolean isAbstract() {
return helper.isAbstract();
}
}

View File

@ -76,4 +76,8 @@ public class EdmStructuredTypeHelperImpl implements EdmStructuredTypeHelper {
return structuredType.isOpenType();
}
@Override
public boolean isAbstract() {
return structuredType.isAbstract();
}
}