Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the type methods of Java

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the relevant knowledge of "what are the types and methods of Java". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Type (Type)

The type interface represents a general view of a data object model or data type.

Most programming languages or data modeling languages have the concept of data types; SDO types are similar to other data types. Unless the type is a simple data type, a SDO type has a collection of property objects.

Mapping of SDO types to programming language and data modeling language types

Java, Clippers, UML or EMOF classes

Classes can be expressed using the SDO type.

Each property of a class can be expressed as a SDO property.

XML Schema

You can use SDO types to express complex or simple types.

Elements and attributes can be expressed using SDO attributes.

C structure

C structures can be expressed using the SDO type.

Each field of a structure can be expressed using the SDO attribute.

Relation database

The table can be expressed as a SDO type.

The column can be expressed as a SDO property.

All of the above areas share some concepts, and SDO types and attribute interfaces express a subset of these concepts. These interfaces are useful for data object programmers because they need to reflect on the shape and nature of the data at run time.

A relatively complete metamodel API (for example, XML Schema or EMOF) that expresses all domain-specific information is beyond the scope of this specification.

Type content

A type always has:

First name-A unique string between types within the same URI.

URI-- A package's logical URI or a target namespace, depending on your point of view.

Used to indicate whether the type is open, abstract, sequential, or a Boolean field of a data type.

A type may have:

Properties-A list of property objects defined by this type. Types that are consistent with simple data types have no properties defined.

Instance class-- used to implement java.lang.Class of type SDO.

If DataType is true, then a type must have an instance class. For example, classes like java.lang.Integer and java.lang.String.

If the DataType is false and the code generated by the code generator is used, an instance class is optional. For example, classes like PurchaseOrder and Customer.

Alias-A string containing an extra name. Aliases must be unique within the same URI.

All name-based methods on a type can also operate using aliases. For example, a type can be given an alias for the domain: a XML Schema named PurchaseOrderType, a Java name PurchaseOrder, and a database table name PRCHORDR.

The uniqueness of names

Within a URI, type names and type aliases are unique. Attribute names and property aliases are unique within a type and any underlying type.

SDO data type

SDO defines Type for the common data types it supports to facilitate consistency in defining the types and properties used by the service. See the "Standard SDO Types" section for details.

Multiple inheritance

Types (Type) support multiple inheritance by allowing multiple base types. When using multiple inheritance, the order of attributes obtained using the getProperties () method can be different from that of a type and the underlying type.

Type method

The getName () method returns a type name.

The getURI method returns a URI of this type.

The getInstanceClass () method returns a class that implements the SDO type.

If the specified object is an instance of that type, the isInstance (Object object) method returns true.

The isDataType () method returns true if the type is used to describe DataType and false if it is used to describe DataObject.

If the type describes a sequential data object, the isSequenced () method returns true, and when it is true, the data object can return a Sequence.

If this type allows open content, the isOpen () method returns true. If the return value is false, the return value of dataObject.getInstanceProperties () must be the same as the return value of the dataObject.getType (). GetProperties () method of any data object of that type.

If the type is abstract, the isAbstract () method returns true, and the type cannot be instantiated. Abstract types cannot be used in data objects or data factory (DataFactory) creation methods. Abstract types are often used as the base type for instantiated types.

The getBaseTypes () method returns a list of the underlying types of that type. If there is no underlying type, the list is empty. The XSD, and Java "extends" keywords are mapped to the underlying type list.

GetAliasNames () returns a list of aliases for this type. If there is no alias, the list is empty.

The getProperties () method returns all properties of the type, including those declared in the underlying type.

The getDeclaredProperties () method is used to get the properties declared in the type and is not valid for the properties declared in the underlying type.

The getProperty (String propertyName) method returns a special property, which returns null if no property with a name is specified.

Type interface

Public interface Type

{

String getName ()

String getURI ()

Class getInstanceClass ()

Boolean isInstance (Object object)

Boolean isDataType ()

Boolean isSequenced ()

Boolean isOpen ()

Boolean isAbstract ()

List / * Type*/ getBaseTypes ()

List / * String*/ getAliasNames ()

List / * Property*/ getProperties ()

List / * Property*/ getDeclaredProperties ()

Property getProperty (String propertyName)

}

This is the end of the content of "what are the types and methods of Java". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report